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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

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

problem with addfieldstotab in 2.3.3

Go to End

3 Posts   1669 Views


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?


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


Community Member, 904 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).