Hi,
Is it possible to build pages which would be used on a bottom menu only, but excluded from the top menu? Like for example terms and conditions, privacy policy
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
Hi,
Is it possible to build pages which would be used on a bottom menu only, but excluded from the top menu? Like for example terms and conditions, privacy policy
This recipe shows the code how to do that
http://doc.silverstripe.com/doku.php?id=recipes:page_selection_for_special_menu
Cool thanks. Using other cms's for the last 7 years has made me lazy
This is mine. a slight difference in the Page_Controller extends ContentController class:
<?php
class Page extends SiteTree {
static $db = array(
"ShowInTabMenu" => "Boolean"
);
static $defaults = array(
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Behaviour", new CheckboxField("ShowInTabMenu", "Show In Bottom Menu"));
return $fields;
}
}
class Page_Controller extends ContentController {
function init() {
parent::init();
Requirements::themedCSS("layout");
Requirements::themedCSS("typography");
Requirements::themedCSS("form");
}
function topTabbers() {
$whereStatement = "ShowInTabMenu = 1 AND ShowInMenus = 1";
return DataObject::get("Page", $whereStatement);
}
}
?>