Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Pages for bottom menu only

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1294 Views
  • Tyndie
    Avatar
    Community Member
    9 Posts

    Pages for bottom menu only Link to this post

    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

  • Liam
    Avatar
    Community Member
    470 Posts
  • Tyndie
    Avatar
    Community Member
    9 Posts

    Re: Pages for bottom menu only Link to this post

    Cool thanks. Using other cms's for the last 7 years has made me lazy

  • Tyndie
    Avatar
    Community Member
    9 Posts

    Re: Pages for bottom menu only Link to this post

    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);
    }
    }

    ?>

    1294 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.