Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Level 3 Childs


Go to End


2 Posts   2074 Views

Avatar
MrHyde

Community Member, 23 Posts

15 January 2009 at 9:14am

Edited: 15/01/2009 9:17am

Hey, i'm posting some code from my SideBar.ss.
I'm using <% if InSection(news) %>to not display children of news in my level(2) menu. Works so far, but i'm wondering why these childs are displayed when one of them are the current page (level3).

I just want none of the childs of news to display in my level 2 menu. Any help?

SideBar.ss

<% control Menu(2) %>
	
		<% if LinkOrSection = section %>

  			<li class="current">
  			
  				<% if InSection(news) %>
  					<a class="current" href="$Link">$MenuTitle</a>
  				<% else %>
  
	  				<% if Children %>
	  					<a class="children" href="$Link">$MenuTitle</a>
	  					
	  					<ul class="navlist2">
	  					<% control Children %>
								<% if LinkOrSection = section %>
									<li><a class="current" href="$Link">$MenuTitle</a></li>
								<% else %>
									<li><a href="$Link">$MenuTitle</a></li>
								<% end_if %>			
						<% end_control %>
						</ul>
	
	  				<% else %>
	  					<a class="current" href="$Link">$MenuTitle</a>
	  				<% end_if %>
	  				
	  			<% end_if %>
	  			
  			</li>
  		<% else %>
		  	<li><a href="$Link">$MenuTitle</a></li>
		<% end_if %>
		
	<% end_control %>

Avatar
MrHyde

Community Member, 23 Posts

16 January 2009 at 7:04am

Edited: 16/01/2009 7:04am

Sorry guys. The same code worked fine this morning, after i restarted my local webserver. Seems to be a cache issue. (Yes, i did flush=1).