5099 Posts in 1519 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1056 Views |
-
getCMSFields

23 July 2010 at 10:24am Last edited: 23 July 2010 10:24am
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?
-
Re: getCMSFields

23 July 2010 at 10:39pm
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.
-
Re: getCMSFields

23 July 2010 at 10:51pm Last edited: 23 July 2010 10:51pm
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.
| 1056 Views | ||
|
Page:
1
|
Go to Top |
