Silverstripe Version: 4.3.1
How can I add formfields to the SilverStripes CMS Settings Page (where you can edit page title and slogan)?
I searched on google but only found how to add custom fields to a Root.Settings of a page.
Do I need to create an extension for DataExtension to add custom fields on the Settings Page?
This is the code I use to add a textfield to the settings tab of a page.
namespace {
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Forms\TextField;
class Page extends SiteTree
{
private static $db = [
'Intro' => 'Varchar',
];
private static $has_one = [];
function getSettingsFields() {
$fields = parent::getSettingsFields();
$fields->addFieldToTab("Root.Settings", new TextField('Intro'));
return $fields;
}
}
}
Thanks for the help.