Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

Add checkbox within visibility in page settings


Reply


2 Posts   601 Views

Avatar
Vix

Community Member, 25 Posts

26 September 2013 at 5:24pm

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

Avatar
Vix

Community Member, 25 Posts

26 September 2013 at 8:03pm

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