I'm trying to add another field into a module so I can sort by a different column and allow the user more control over how the content is ordered. I have this so far in mysite/code/ExtendedForum.php:
class ExtendedForum extends DataExtension {
private static $db = array(
'StackableOrder' => 'Int'
);
public function updateCMSFields(FieldList $fields) {
$fields->addFieldToTab('Root.Main', new TextField("StackableOrder", "Order Page Appears In"), "Content");
}
}
Then I added this into my config:
DataObject::add_extension('Forum', 'ExtendedForum');
It added the "StackableOrder" column into the database, but the field will not show in the CMS. It will only show if I use $fields->push(), but I don't want to use that because I want it to come after a certain column and every time I use push, the CSS is really jagged and the text appears right against the left side of the content instead of padded like the other fields and appears in every single tab... which I only want it to be in the Root.Main tab. If I get rid of the third parameter in the AddFieldToTab() it works fine.. but it appears as the very last field. The third parameter should place it above the field you specify which "Content" should work correct?
Thanks for any help!