Answers for "alter paragraph form drupal 8"

0

alter paragraph form drupal 8

/**  
 * 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';
  }
}
Posted by: Guest on June-10-2020

Browse Popular Code Answers by Language