Jump to:

1133 Posts in 1966 Topics by 403 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » SilverStripe 3.0.0 - Unable to Add Fields

Ask questions about upgrading SilverStripe to the latest version.

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

Page: 1
Go to End
Author Topic: 1557 Views
  • Garrett
    Avatar
    Community Member
    245 Posts

    SilverStripe 3.0.0 - Unable to Add Fields Link to this post

    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

  • PeMu
    Avatar
    Community Member
    2 Posts

    Re: SilverStripe 3.0.0 - Unable to Add Fields Link to this post

    Hi Garrett,

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

    Peter

  • Lukereative
    Avatar
    Community Member
    8 Posts

    Re: SilverStripe 3.0.0 - Unable to Add Fields Link to this post

    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.

  • Garrett
    Avatar
    Community Member
    245 Posts

    Re: SilverStripe 3.0.0 - Unable to Add Fields Link to this post

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

    //Garrett

  • PeMu
    Avatar
    Community Member
    2 Posts

    Re: SilverStripe 3.0.0 - Unable to Add Fields Link to this post

    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

    1557 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.