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 /

problem with addfieldstotab in 2.3.3


Reply


3 Posts   1377 Views

Avatar
mtz

Community Member, 17 Posts

20 October 2009 at 11:08pm

I have a Problem adding Fields to a existing Tab.
My Code is

public function getCMSFields()
   {
      $f = parent::getCMSFields();
      
      
      $f->addFieldsToTab("Root.Content.Right Box", new TextField('RightTitle','Right Title'), 'Content');
      $f->addFieldsToTab("Root.Content.Right Box", new HtmlEditorField('RightColumn','Content'), 'Content');
      
return $f;
}

I get two Tabs named Right Box. How can i add the new HtmlEditorField in the Right Box tab above?

I did it this way in SS 2.2 and it was working.

Am i blind?

Avatar
mtz

Community Member, 17 Posts

20 October 2009 at 11:11pm

OK helps talk about.

      $f->addFieldsToTab("Root.Content.Right Box", new TextField('RightTitle','Right Title'), 'Content');

it must be "Root.Content.RightBox" instead...

Avatar
banal

Community Member, 901 Posts

20 October 2009 at 11:59pm

Edited: 21/10/2009 12:00am

AFAIK there are two different functions to add Fields to a tab.
One is called addFieldToTab and expects parameters as you set them, the other one is addFieldsToTab and it expects an array of fields as the second parameter (and it ignores the third parameter).