New answers tagged


Implement hook_field_widget_alter It will give control of paragraph fields. function hook_field_widget_entity_reference_paragraphs_form_alter(&$element, &$form_state, $context) { if ($element['#paragraph_type'] == 'xyz') { $element['subform']['field_name']['#access'] = FALSE; } }


I'm assuming that the paragraphs are attached to your node via field. Let's assume the field is called field_paragraphs. Try the following: $node = \Drupal::routeMatch()->getParameter('node'); $paragraphs = $node->get('field_paragraphs')->getValue(); This works because Drupal's routing system utilizes upcasting to promote the nid to a fully loaded ...


I'd imagine the first didn't work because your custom submit handler is run after the form default submit handler so it's too late (You didn't provide this code so can't be certain). You'd need to make sure your submit handler is run before any other submit handlers. To do that in the array of submit handlers your needs to be first in the array Similarly ...

Top 50 recent answers are included