Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Show in menu & missing content

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1760 Views
  • benedictporter
    Avatar
    Community Member
    16 Posts

    Show in menu & missing content Link to this post

    I am building a site that uses part of it's Home page to hold content from a couple of subpages. I don't want these pages to show up in my dropdown menu so I have unchecked the 'Show in menu box' and now the content has disappeared from the Home page.

    I'm using <% control Children %> to put the content there in the first place (I have a 'HomePage' page type with 'DidYouKnow' specified as its children). Is this the right thing to do? How do I get my content back without it appearing in the menu?

    Code:
    <div id="holder">
       <% control Children %>
          <div class="image">$Photo.SetWidth(96)</div>
          <div class="title"><h1>$Title</h1></div>
          <div class="text">$Content</div>
          <div class="clear"></div><!-- clearing div -->
       <% end_control %>
    </div>

  • benedictporter
    Avatar
    Community Member
    16 Posts

    Re: Show in menu & missing content Link to this post

    I've managed to sort this now.

    I wrote a jQuery script to apply the class .hideme to the menu items I wanted to disappear and used CSS to display: none;

    Seemed a lot easier that trying to muck about with the code. If anyone has an alternative solution then I would love to hear it.

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Show in menu & missing content Link to this post

    <% control AllChildren %> will show all content, even those where the option to 'show in menu' is not checked.

  • benedictporter
    Avatar
    Community Member
    16 Posts

    Re: Show in menu & missing content Link to this post

    Thanks for that, LeeUmm. A very simple solution to a problem that had been driving me nuts for most of the day. Still, at least I learnt a little jQuery along the way which can't be a bad thing.

    1760 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.