Jump to:

3439 Posts in 1028 Topics by 869 members

Template Questions

SilverStripe Forums » Template Questions » Hide in Menu, but show in Content

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

Page: 1
Go to End
Author Topic: 909 Views
  • sashion
    Avatar
    Community Member
    23 Posts

    Hide in Menu, but show in Content Link to this post

    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

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: Hide in Menu, but show in Content Link to this post

    Hide them from menus and try:

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

  • sashion
    Avatar
    Community Member
    23 Posts

    Re: Hide in Menu, but show in Content Link to this post

    Hey Pigeon,

    thanx! That was the solution!

    cheers

    909 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.