I saw an old post in the archive that referenced "doing a print_r of getCMSFields()" to get the variable names of all the fields 'parent' fields in the CMS. Does anyone have a copy of this list to post, or can anyone show me how to use this print_r to generate the list??
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
When on the Page class, or a subclass of, you usually have something like this:
function getCMSFields() {
$fields = parent::getCMSFields();
Debug::show($fields);
$fields->addFieldToTab('Root.Content.Main', new TextField('Author'));
return $fields;
}
The Debug::show($fields) will show you all fields that were automatically added in the CMS, and you can manipulate those as necessary, removing fields that you don't want or adding new ones.
Cheers,
Sean