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.

Template Questions /

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

Hide in Menu, but show in Content


Go to End


3 Posts   1968 Views

Avatar
sashion

Community Member, 25 Posts

9 January 2011 at 8:12am

Edited: 09/01/2011 8:13am

Hey there,

I have a Content site called "Accordion Holder" where all its subpages are listet as an accordion.
This works fine. But the subpages are also shown in the menu where I don´t want them to be shown.
If I activate the checkbox "Hide in menu" they disappear on BOTH - the menu AND on the "Accordion Holder" site.

Of course I could hide the second menu in general, but there are other pages where i do need the second menu level to be shown.
Has anyone a solution for this problem?

Here´s a cod snippet.

<div class="accordion">
			<% control Children %>
			 	<div class="box">
				 	<h3><a id="$Title" name="$Title">$Title<span>&and;</span></a></h3>
				 	<div>
				 	$Content
				 	<a href="#top" class="toplink">&uArr; top</a>
				 	</div>	
				 </div>
			<% end_control %>
		</div>

Thanks in advance,
sash

Avatar
dhensby

Community Member, 253 Posts

9 January 2011 at 12:11pm

Edited: 09/01/2011 12:12pm

Hide them from menus and try:

<% control AllChildren %>
...
<% end_control %>

Avatar
sashion

Community Member, 25 Posts

10 January 2011 at 3:26am

Hey Pigeon,

thanx! That was the solution! :)

cheers