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.

Archive /

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

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

Menu2 not working in my template like it did in the tutorial


Go to End


13 Posts   4794 Views

Avatar
dio5

Community Member, 501 Posts

16 November 2007 at 12:45pm

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

Avatar
sonicparke

74 Posts

16 November 2007 at 12:49pm

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.

Avatar
dio5

Community Member, 501 Posts

16 November 2007 at 12:52pm

No problem...

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

Avatar
Sam

Administrator, 690 Posts

16 November 2007 at 1:55pm

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 %>

Avatar
sonicparke

74 Posts

16 November 2007 at 3:30pm

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.

Go to Top