21489 Posts in 5783 Topics by 2621 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1205 Views |
-
Add Top and Footer Navigation Menu

10 November 2010 at 12:24am
Hi,
I would like to have a footer and top navigation that is independent from the normal navigation menu.
I came up with a solution that is not really satisfying. My solution was to add a page, that is not in the menu and then add pages under it like this:
- TopNavigation (not in menu)
- Page 1
- Page 2and then in the template:
<% control ChildrenOf(TopNav) %>
<li><a href="$Link" title="$Title">$MenuTitle</a></li>
<% end_control %>But clicking on the link it has /topNav/ or /FooterNav always in it. I would like to only have /page1 /page2
What would be the correct solution to this? I think more people have more than one menu on their page...
Kind regards
Spanky -
Re: Add Top and Footer Navigation Menu

10 November 2010 at 2:14am
you can use recipe here http://doc.silverstripe.org/recipes:page_selection_for_special_menu
you just create checkbox in admin panel that will decide if the page will be shown in menu (you should create two)
static $db = array(
"ShowInTabMenu" => "Boolean"
);function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Behaviour", new CheckboxField("ShowInTabMenu", "Show special menu "));
return $fields;
}then in page controller create functions, you shuold create two function e.g. headerMenu() nad footerMenu()
function topTabbers() {
$whereStatement = "ShowInTabMenu = 1 AND ShowInMenus = 1";
return DataObject::get("Page", $whereStatement);
}then jus use $headerMenu or $footerMenu Page.ss
-
Re: Add Top and Footer Navigation Menu

10 November 2010 at 4:21am
Hi,
that worked and was excactly what I wanted ;-)
Thanx
-
Re: Add Top and Footer Navigation Menu

17 November 2012 at 3:07am
hi
I've created a module to deal with footer links, though I guess there is no reason why it could not be applied to header links also. Details can be found at http://weboftalent.asia/blog/links-module/
Regards
Gordon [Anderson]
| 1205 Views | ||
|
Page:
1
|
Go to Top |

