You are here

function faq_form_node_faq_edit_form_alter in Frequently Asked Questions 8

Implements hook_form_FORM_ID_alter().

If question_long_form is disabled, hide the 'detailed question' from node editing.

File

./faq.module, line 207
The FAQ module allows users to create a FAQ page, with questions and answers displayed in different styles, according to the settings.

Code

function faq_form_node_faq_edit_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  $faq_settings = \Drupal::config('faq.settings');
  if (!$faq_settings
    ->get('question_long_form')) {
    $form['field_detailed_question']['#access'] = FALSE;
  }
}