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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Secondary independent menu


Go to End


4 Posts   2526 Views

Avatar
Sergi_Jini

Community Member, 3 Posts

1 November 2013 at 7:16am

Hello everyone,

I am migrating my site to SS and trying to add secondary menu apart from main one (f.eg Home, Career, About us, Contact). I'm a bit new to silverstripe and can't find a solution/advice that will simply explain a walk through. Particularly, when I am adding new pages through CMS, links to them are listed all together in a website

<% loop $Menu(1) %>
<li><a href="$Link" title="$Title.XML">$MenuTitle.XML</a></li>
<% end_loop %>

What I need is a secondary independent menu that would list only particular page links, something like "Show in menus?" option in CMS page settings..I've tried adding a custom field to page object via MySQL and to filter it with "IF" statement in above loop but no use..

Thanks for any help

Attached Files
Avatar
Webdoc

Community Member, 349 Posts

3 November 2013 at 9:45am

Have u tried this - Menumanager - i have used it in some websites: http://www.seadmed.ee/

--------------------------------
Arvixe Web Hosting / SilverStripe Community Liaison | Looking for quality SilverStripe Web Hosting? Look no further than Arvixe Web Hosting!

Avatar
Sergi_Jini

Community Member, 3 Posts

4 November 2013 at 9:28am

Webdoc thanks!

Works as expected.

Installation steps just in case:
Put "silverstripe-menumanager" and "silverstripe-gridfieldextensions" in root folder of your Silverstripe.

https://github.com/heyday/silverstripe-menumanager
https://github.com/ajshort/silverstripe-gridfieldextensions

Rebuild the db - http://localhost/your-site/index.php/dev/build?flush=1

There might be some errors during rebuild, asking to change Private declaration to Public. I didn't went too deep for the reason but it worked.

After db rebuild you must have extra item in CMS called - Menu Management. Works pretty simple and intuitive. I've created 2 menu sets and associated my pages to them accordingly. You can nest them in layouts by:

<% loop $MenuSet('your_menu').MenuItems %>
<li class="$LinkingMode"><a href="$Link" title="გადადით $Title.XML გვერდზე">$MenuTitle.XML</a></li>
<% end_loop %>

As you see $MenuSet('your_menu').MenuItems is used instead of $menu(1).

Enjoy.
Thanks Again

Attached Files
Avatar
nzvlad

Community Member, 2 Posts

29 June 2016 at 4:11pm

if using composer installing just menu manager it will install gridfieldextensions automatically