I'm trying to figure out how to add an extra field to content type field settings page.
Basically I want to alter field instance settings form on admin/structure/types/manage//fields/node../storage .
I'm going with hook_form_FORM_ID_alter for FORM_ID field_config_edit_form. The new form element appears on the form but after submit I'm not able to see the value.
Am I missing something? Is an extra form submit function required other than the default one to submit my new value?
Here is my snippet -
/**
* Implements hook_form_FORM_ID_alter().
*/
function mymod_form_field_storage_config_edit_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
$form['enabled'] = array(
'#type' => 'checkbox',
'#title' => t('Enable'),
'#description' => t('If enabled then this module will alter the field settings.'),
'#default_value' => $form['enabled'],
);
}
$form['#entity_builders'][]
andThirdPartySettingsInterface
. Will try it out and update here.