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.
Give the case I would like to implement a web site structure with 2 independent menu trees like:
- Contact Us
- About Us
and the second with:
What would be best practice implementing this including all facettes of silverstripe like breadcrumps, controlling menus and so on?
I would gues I could need something like that:
----- About Us
Am I wrong/right?
look at http://doc.silverstripe.com/doku.php?id=recipes:page_selection_for_special_menu
I think this is what you need.
Thanks for the answer.
This is a interesting feature. It provides a kind of "quick link" feature and can be applied to any menu item. Also it could be changed by the admin whenever needed by checking the checkbox.
But unfortunately this is not what I am looking for.
What I would need is a really independent second menu which is not integrated into the rest of the menu.
Hello, you may use it totally independent:
in your Page_Controller
$whereStatement = "ShowInTopMenu = 1";
return DataObject::get("Page", $whereStatement);
and in your template:
<ul><% control topMenu %>
<li class="$FirstLast $LinkingMode"><a href="$Link" title="$Title.XML"><span>$MenuTitle.XML</span></a></li>
<% end_control %></ul>
And you get new menu by checking "Show in Top Menu" checkbox and uncheck show in menu.
Thanks a lot. This one indeed is what I was looking for.
This hint was what I needed:
"And you get new menu by checking "Show in Top Menu" checkbox and uncheck show in menu."
Also changing the where statement to get it:
Just grab those which are flagged with "ShowInTopMenu".