I've added a hook after the '"ProcessPageEdit::buildFormContent" event.
I've added a new config option to the language settings:
public function beforeAdminProcessPageEditBuildFormContent (HookEvent $event)
{
$editPage = $this->getPage(wire('input')->get('id'));
if ($editPage->template->name == 'language') { // only add field when editing language page
$field = wire('modules')->get('InputfieldText');
$field->attr('name+id', 'locale');
$field->label = __('Locale');
$event->return->insertAfter($field, $event->return->getChildByName('title'));
}
}
I've also created a field (Setup > Fields > Add new) which I've also named 'locale'.
The field is displayed, but the value isn't saved when I click the save button. How do I make sure the input of the field is saved as well? And how can I access the stored value once it's saved?