You are here

function title_form_node_type_form_builder in Title 8.2

Entity builder for the node type form with title options.

See also

title_form_node_type_edit_form_alter().

1 string reference to 'title_form_node_type_form_builder'
title_form_node_type_edit_form_alter in ./title.module
Implements hook_form__FORM_ID_alter().

File

./title.module, line 47
Convert titles into fields which can be display manipulated.

Code

function title_form_node_type_form_builder($entity_type, $type, &$form, FormStateInterface $form_state) {
  $config_manager = \Drupal::service('title.config_manager');
  $state = $form_state
    ->getValue('display_configurable_title');
  $config_manager
    ->setEnabled($type, $state);

  // Setup some basic state such as placing the title into the correct regions
  // on the view modes.
  if ($state) {
    $config_manager
      ->setupBundleState($type
      ->id());
  }
  else {
    $config_manager
      ->tearDownBundleState($type
      ->id());
  }
}