22997 Posts in 11620 Topics by 2827 members
|Go to End|
13 March 2009 at 6:59am Last edited: 13 March 2009 9:08pm
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?
13 March 2009 at 9:37am
look at http://doc.silverstripe.com/doku.php?id=recipes:page_selection_for_special_menu
I think this is what you need.
13 March 2009 at 10:30am
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.
13 March 2009 at 11:35am
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.
13 March 2009 at 9:07pm
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".
|Go to Top|