sectionUpdateHighlightId example

        '#weight' => min($weights) - 1,
      ];
    }

    $build['#attributes']['data-layout-update-url'] = Url::fromRoute('layout_builder.move_block', [
      'section_storage_type' => $storage_type,
      'section_storage' => $storage_id,
    ])->toString();

    $build['#attributes']['data-layout-delta'] = $delta;
    $build['#attributes']['class'][] = 'layout-builder__layout';
    $build['#attributes']['data-layout-builder-highlight-id'] = $this->sectionUpdateHighlightId($delta);

    return [
      '#type' => 'container',
      '#attributes' => [
        'class' => ['layout-builder__section'],
        'role' => 'group',
        'aria-label' => $section_label,
      ],
      'remove' => [
        '#type' => 'link',
        '#title' => $this->t('Remove @section', ['@section' => $section_label]),
        
$form['actions']['submit']['#ajax']['callback'] = '::ajaxSubmit';
      // @todo static::ajaxSubmit() requires data-drupal-selector to be the same       // between the various Ajax requests. A bug in       // \Drupal\Core\Form\FormBuilder prevents that from happening unless       // $form['#id'] is also the same. Normally, #id is set to a unique HTML       // ID via Html::getUniqueId(), but here we bypass that in order to work       // around the data-drupal-selector bug. This is okay so long as we       // assume that this form only ever occurs once on a page. Remove this       // workaround in https://www.drupal.org/node/2897377.       $form['#id'] = Html::getId($form_state->getBuildInfo()['form_id']);
    }
    $target_highlight_id = $this->isUpdate ? $this->sectionUpdateHighlightId($delta) : $this->sectionAddHighlightId($delta);
    $form['#attributes']['data-layout-builder-target-highlight-id'] = $target_highlight_id;

    // Mark this as an administrative page for JavaScript ("Back to site" link).     $form['#attached']['drupalSettings']['path']['currentPathIsAdmin'] = TRUE;
    return $form;
  }

  /** * {@inheritdoc} */
  public function validateForm(array &$form, FormStateInterface $form_state) {
    

  public function buildForm(array $form, FormStateInterface $form_state, SectionStorageInterface $section_storage = NULL, $delta = NULL) {
    $this->sectionStorage = $section_storage;
    $this->delta = $delta;

    $form = parent::buildForm($form$form_state);

    if ($this->isAjax()) {
      $form['actions']['submit']['#ajax']['callback'] = '::ajaxSubmit';
      $form['actions']['cancel']['#attributes']['class'][] = 'dialog-cancel';
      $target_highlight_id = !empty($this->uuid) ? $this->blockUpdateHighlightId($this->uuid) : $this->sectionUpdateHighlightId($delta);
      $form['#attributes']['data-layout-builder-target-highlight-id'] = $target_highlight_id;
    }

    // Mark this as an administrative page for JavaScript ("Back to site" link).     $form['#attached']['drupalSettings']['path']['currentPathIsAdmin'] = TRUE;
    return $form;
  }

  /** * {@inheritdoc} */
  
Home | Imprint | This part of the site doesn't use cookies.