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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

problem with addfieldstotab in 2.3.3


Go to End


3 Posts   1857 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
bummzack

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