17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1188 Views |
-
Find parents of nested menu items

28 August 2008 at 3:52am Last edited: 28 August 2008 3:55am
If this is the menu tree I have in the cms...
Content
..home
..
..browse
..-> pictures
..-> -> gallery1
..-> -> gallery2
..
..-> videos
..-> -> gallery1When I'm in gallery1, I obviously want my breadcrumbs to read " home > browse > pictures > gallery1 " but I feel it's not setup to do that based on the friendly-url design :-\ .
But my question is.. My main nav reads "Home - Browse - ... etc" .. When I'm in the "Browse" section, the nav highlights to let you know where you are. But, when I go deeper into that section, it doesn't realize it's in Browse anymore.
Is there a built in way to determine the furthest parent of a nested item? I need it to realize that gallery1 is a grandchild of "Browse". And also a direct child of "Pictures" would be nice too.
Thanks!
And if you have a solution to the breadcrumbs above, I'm all ears. I could use the DataObject::get but I don't know if I wanna run a separate query on every page-load if it's already happening somewhere.
-
Re: Find parents of nested menu items

28 August 2008 at 4:27am
Go to
http://doc.silverstripe.com/doku.php?id=built-in-page-controls
The 'Links and Class' paragraph should help you...
-
Re: Find parents of nested menu items

28 August 2008 at 8:21am Last edited: 28 August 2008 8:24am
no that doesn't really help
--------------------------EDIT: Actually, I jumped the gun. The <% if InSection(recipes) %> works. I was using it improperly at first.
| 1188 Views | ||
|
Page:
1
|
Go to Top |

