Jump to:

5513 Posts in 1732 Topics by 1218 members

Customising the CMS

SilverStripe Forums » Customising the CMS » getCMSFields

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

Page: 1
Go to End
Author Topic: 1424 Views
  • mattclegg
    Avatar
    Community Member
    56 Posts

    getCMSFields Link to this post

    Hello Silverstripe Community,

    Ok, I have tried debugging this problem although I know its probably something silly. I want to extend (forum) module so I can customise it and easily keep uptodate from SVN. I have something like;

    _config.php

    Object::add_extension('Forum', 'ForumExtender');

    ForumExtender.php

    class ForumExtender extends DataObjectDecorator {
       function updateCMSFields(&$fields) {
          $fields->removeFieldFromTab("Root.Content","Moderators");
          Debug::show('Hello World!');
       }
    }

    I know the function is running because of the debug message, but the FieldSet is not being updated. I presume its running in the wrong order? Is there anything I can do to override this? Or should I be doing this a different way?

  • TotalNet
    Avatar
    Community Member
    181 Posts

    Re: getCMSFields Link to this post

    It's likely the tabname is incomplete, try "Root.Content.Main" instead.

    If in doubt, check the corresponding addFieldToTab in forum.php to check it matches.

  • mattclegg
    Avatar
    Community Member
    56 Posts

    Re: getCMSFields Link to this post

    Ah, well spotted. However I dont think it is a typo issue as changing it didn't work, and what I'm actually trying to do is add;

    $fields->addFieldToTab("Root.Access", new TreeDropdownField("ForumPendingGroupID", "Group"));


    with the same principle of the code above.

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