3217 Posts in 853 Topics by 812 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 277 Views |
-
Make children collapse

5 May 2012 at 12:52am
Hi! I am all new to SilverStripe. I am learning SilverStripe because I really like the CMS. I am starting my own company and I want my site to be SS based. I really can use your help. If if have something like this:
<% control Menu(1) %>
// ul - li etc //
<% control Children %>
// ul - li etc //
<% end_control %>
<% end_control %>The children just won't disappear. They are visible no matter what parent item is active. Now I can use jQuery or some PHP to make them successfully disappear, but I rather have SilverStripe to do so. I don't actually need this for my own site, but I just want to learn SS the best way possible, so that my own site will be as clean and fast as possible. Thank you so much!
-
Re: Make children collapse

7 May 2012 at 6:30pm
What you want is to check if the current page is the page or a descendant of the menu item using LinkOrSection:
<% control Menu(1) %>
// ul - li etc //
<% if LinkOrSection = section %>
<% control Children %>
// ul - li etc //
<% end_control %>
<% end_if %>
<% end_control %>
| 277 Views | ||
|
Page:
1
|
Go to Top |


