21309 Posts in 5738 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 111 Views |
-
Replace CMS field name and change field type

25 February 2013 at 3:52pm
I've searched the docs but couldn't find it.
I want to change the name of the CMS field "Content" to something else and also change the HtmlEditorField to a textField.
Thanks
-
Re: Replace CMS field name and change field type

25 February 2013 at 10:09pm
The easiest way to do it is in your Page class getCMSFields(), untested:
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->removeByName('Content'); // Might be 'Root.Content' or 'Root.Main.Content', not sure which
$fields->insertAfter(new TextField('Content', 'Your Field Name'), 'MenuTitle');
return $fields;
}'Content' has a data type of 'HTMLText', but I think you should be okay to save standard text input into it. Not sure how to change its datatype if not.
| 111 Views | ||
|
Page:
1
|
Go to Top |


