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.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

SilverStripe 3.0.0 - Unable to Add Fields


Reply


5 Posts   1757 Views

Avatar
Garrett

Community Member, 245 Posts

4 May 2011 at 2:54am

Hi,

Why are none of the specified in getCMSFields() showing up in the CMS? I can see in the changelog (http://doc.silverstripe.org/sapphire/en/trunk/changelogs/3.0.0) that "The fields and tabs are now split into two separate forms, which required a structural change to the underlying class logic. In case you have added or removed fields in the "Behaviour" or "Access" tab, please move these customizations to a new getSettingsFields() method." However, I have not added/removed any fields from the Behaviour or Settings tabs -- Only the Content tab. And I am adding new tabs as well.

Since the upgrade, I removed the ".Main" part of the tabname argument to get rid of an error, and I now have Two Content tabs, and my fields aren't showing up on either of them. What gives? How do I use/manipulate/configure tabs in 3.0?

Thanks,
Garrett

Avatar
PeMu

Community Member, 2 Posts

6 May 2012 at 9:30pm

Hi Garrett,

I'm just wondering if you ever figured this out? I'm also scratching my head on this one.

Peter

Avatar
Lukereative

Community Member, 8 Posts

8 May 2012 at 3:58pm

Edited: 08/05/2012 3:58pm

I had this problem too and forgot to post my fix.

To add fields to the main tab -
Instead of

$fields->addFieldToTab('Root.Content.Main'


Just remove the .Content part

$fields->addFieldToTab('Root.Main'

Similarly to add fields to your own tab -
Instead of

$fields->addFieldToTab('Root.Content.MyTab'


Just remove the .Content part

$fields->addFieldToTab('Root.MyTab'

Hope that helps.

Avatar
Garrett

Community Member, 245 Posts

9 May 2012 at 2:10am

That more than helps, it solves ;) I figured this out just like you a long time ago though but thanks anyways for replying!

//Garrett

Avatar
PeMu

Community Member, 2 Posts

9 May 2012 at 8:31am

Hi Lukereative and Garrett,

I also figured this out after posting but didn't quite get round to updating - so that make three of us. Glad the answer is here for others now though as this was the first result in my search for answers.

I'm very new to Silverstripe and have made the 'interesting' decision to try out SS 3.0 by following tutorials for previous versions so may see you around on the forum again in the future.

Peter