sectionAddHighlightId example

'layout-builder__link--add',
              ],
              'data-dialog-type' => 'dialog',
              'data-dialog-renderer' => 'off_canvas',
            ],
          ]
        ),
      ],
      '#type' => 'container',
      '#attributes' => [
        'class' => ['layout-builder__add-section'],
        'data-layout-builder-highlight-id' => $this->sectionAddHighlightId($delta),
      ],
    ];
  }

  /** * Builds the render array for the layout section while editing. * * @param \Drupal\layout_builder\SectionStorageInterface $section_storage * The section storage. * @param int $delta * The delta of the section. * * @return array * The render array for a given section. */
$item['#attributes']['data-dialog-renderer'][] = 'off_canvas';
      }
      $items[$plugin_id] = $item;
    }
    $output['layouts'] = [
      '#theme' => 'item_list__layouts',
      '#items' => $items,
      '#attributes' => [
        'class' => [
          'layout-selection',
        ],
        'data-layout-builder-target-highlight-id' => $this->sectionAddHighlightId($delta),
      ],
    ];

    return $output;
  }

}
$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) {
    
Home | Imprint | This part of the site doesn't use cookies.