21491 Posts in 5783 Topics by 2622 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1342 Views |
-
[solved] Menu structure - Best practice

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:
- Products
- Contact Us
- About Us
....and the second with:
- Legal
- Login
....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:
- MenuContainer
-- TopNavigation
----- Products
----- About Us
----- ....
-- SecondNavigation
----- Legal
----- Login
----- ...Am I wrong/right?
-
Re: [solved] Menu structure - Best practice

13 March 2009 at 9:37am
Hello,
look at http://doc.silverstripe.com/doku.php?id=recipes:page_selection_for_special_menu
I think this is what you need. -
Re: [solved] Menu structure - Best practice

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.
-
Re: [solved] Menu structure - Best practice

13 March 2009 at 11:35am
Hello, you may use it totally independent:
in your Page_Controllerfunction topMenu(){
$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.
-
Re: [solved] Menu structure - Best practice

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".Thanks again.
| 1342 Views | ||
|
Page:
1
|
Go to Top |


