Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Menu2 not working in my template like it did in the tutorial

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

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

Page: 1 2
Go to End
Author Topic: 3835 Views
  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Menu2 not working in my template like it did in the tutorial Link to this post

    Ok I see.

    Well, I don't think that is possible 'out of the box', but first of all I would set those less important pages to 'not appear in menu'.

    If it's only five pages you might want to hardcode them in your template. Otherwise you might think of creating some special method for it on your page/pagecontroller (page.php) or the pages that extend them.

    Can't think of something out of my head now, but it can't be too hard...

  • sonicparke
    Avatar
    74 Posts

    Re: Menu2 not working in my template like it did in the tutorial Link to this post

    OK. That's cool. The numbers were jsut examples but I had planned to set the secondary ones not to appear in the menu. What I was trying to do was make a page called "Footer Menu" and make redirector pages as sub pages of footer menu. I thought that would do it but apparently not. For now I'll just add the link manually since they probably wont change all that much anyway. Then as I get more PHP proficient I'll work on figuring out some sort of module way to do it unless somebody else beats me to it.

    Thanks for all the help! At least now I can mark this off my "list" and move on to the next thing.

  • dio5
    Avatar
    Community Member
    501 Posts

    Re: Menu2 not working in my template like it did in the tutorial Link to this post

    No problem...

    I know how frustrating it can be when you're stuck at something

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Menu2 not working in my template like it did in the tutorial Link to this post

    The other thing you can do is make a page called "utility navigation" with a URLSegment of utility-navigation.

    Put your less important pages under that, and set ShowInMenus = 0 on the utility-navigation page.

    Then, in your template put

    <% control ChildrenOf(utility-navigation) %>
    <a href="$Link">$Title</a>
    <% end_control %>

  • sonicparke
    Avatar
    74 Posts

    Re: Menu2 not working in my template like it did in the tutorial Link to this post

    Wow. That's exactly what I didn't know how to do. And so easy too. I already had half of it setup. I just didn't know how to make it show up. Sam, you are the man. Thank you so very much.

    3835 Views
Page: 1 2
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.