Question : alter paragraph form drupal 8
Answered by : liam-roels
/** * Implements hook_field_widget_WIDGET_TYPE_form_alter(). */
function paragraphs_test_field_widget_entity_reference_paragraphs_form_alter(&$element, &$form_state, $context) { if ($element['#paragraph_type'] == 'altered_paragraph') { $element['subform']['field_text']['widget'][0]['#title'] = 'Altered title'; }
}
Source : https://drupal.stackexchange.com/questions/167053/how-do-i-alter-the-behavior-of-the-form-fields-contained-within-the-paragraph-fi | Last Update : Wed, 17 Jun 20