Jump to:

5516 Posts in 1734 Topics by 1221 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Add checkbox within visibility in page settings

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

Page: 1
Go to End
Author Topic: 503 Views
  • Vix
    Avatar
    Community Member
    23 Posts

    Add checkbox within visibility in page settings Link to this post

    I am using 3.1 and I want to add a field to the page settings tab. I have got the following code

    function getSettingsFields() {
          $fields = parent::getSettingsFields();
          $fields->addFieldToTab("Root.Settings", new CheckBoxField('ShowFooter', 'Show link in footer?'));
          return $fields;
       }

    and this works great, but what I want to do is add the checkbox in the same row as 'Visibility'. So that row would read 'Show in menus?', 'Show in Search?', 'Show in Footer?' (not all menu items will be shown in the website footer for this site).

    What do I need to do to add this field into that location?

    Thanks
    Vix

  • Vix
    Avatar
    Community Member
    23 Posts

    Re: Add checkbox within visibility in page settings Link to this post

    Figured it out I just had to add ,'ShowInSearch' after my new CheckBoxField.

    eg:

    $fields->addFieldToTab("Root.Settings", new CheckBoxField('ShowFooter', 'Show link in footer?'), 'ShowInSearch');

    503 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.