Datafeedr Support Forums  

Go Back   Datafeedr Support Forums > Current Version (V3) Forum > Questions
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Important - The support forums are now in "read-only" mode as we transition to an alternative help desk solution. Feel free to contact us here with any of your questions or search the forums for an existing solution.
 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 2nd, 2011, 03:15 PM
wccoder wccoder is offline
 
Join Date: Apr 2011
Posts: 4
Default Getting grandparent category

Hey there,

I'd like to display the direct child categories (2nd level) of the top-level category the user is in, no matter how deep they go. Currently I can make this work for my second level cats (just use active='parent') however I can't seem to find a way to get anything other than a category's direct parent. I'm looking for something like active='ancestor' which would be true if a category is a parent (at any level) of the current category.

Thanks,
-e.
  #2  
Old May 2nd, 2011, 04:13 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

I think I posted this solution here: http://www.datafeedr.com/forums/showthread.php?t=4401

Eric
  #3  
Old May 2nd, 2011, 06:42 PM
wccoder wccoder is offline
 
Join Date: Apr 2011
Posts: 4
Default

That solution displays the children of the current category as you traverse the categories and changes as I navigate down. What I want to do is display the second level categories of the current parent, no matter how deep I go in the tree. For example:

Code:
Foo
  Bar
    BarSub1
    BarSub2
      BarSubSub1
      BarSubSub2
  Baz
Bam
When I am in *any* of Bar's children, I want the submenu to show Bar and Baz. I can't do this currently, because if I am in BarSubSub2 the "parent" is BarSub2, not Bar. That's why I need the ability to tell if the category in the loop is an ancestor of the user's current category.

My original idea was to do something like this:

Code:
[category.list before='<ul>' after='</ul>']
<?php if ($depth == 2): ?>
    [category.if active='ancestor]
      <li><a href="[category.link]">[category.name]</a></li>
    [/category.if]
 <?php endif ?>
 [category.repeat]
[/category.list]
-e.

Last edited by wccoder : May 2nd, 2011 at 06:52 PM.
  #4  
Old May 2nd, 2011, 08:05 PM
Eric's Avatar
Eric Eric is offline
Datafeedr Team
 
Join Date: Feb 2008
Posts: 16,902
Default

Hi

This is not currently possible.

Eric
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:50 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.