function LayoutBuilderHighlightTrait::blockAddHighlightId

Same name in other branches
  1. 9 core/modules/layout_builder/src/LayoutBuilderHighlightTrait.php \Drupal\layout_builder\LayoutBuilderHighlightTrait::blockAddHighlightId()
  2. 8.9.x core/modules/layout_builder/src/LayoutBuilderHighlightTrait.php \Drupal\layout_builder\LayoutBuilderHighlightTrait::blockAddHighlightId()
  3. 11.x core/modules/layout_builder/src/LayoutBuilderHighlightTrait.php \Drupal\layout_builder\LayoutBuilderHighlightTrait::blockAddHighlightId()

Provides the ID used to highlight the active Layout Builder UI element.

Parameters

string $delta: The section the block is in.

string $region: The section region in which the block is placed.

Return value

string The highlight ID of the block.

4 calls to LayoutBuilderHighlightTrait::blockAddHighlightId()
AddBlockForm::buildForm in core/modules/layout_builder/src/Form/AddBlockForm.php
Builds the form for the block.
ChooseBlockController::build in core/modules/layout_builder/src/Controller/ChooseBlockController.php
Provides the UI for choosing a new block.
ChooseBlockController::inlineBlockList in core/modules/layout_builder/src/Controller/ChooseBlockController.php
Provides the UI for choosing a new inline block.
LayoutBuilder::buildAdministrativeSection in core/modules/layout_builder/src/Element/LayoutBuilder.php
Builds the render array for the layout section while editing.

File

core/modules/layout_builder/src/LayoutBuilderHighlightTrait.php, line 21

Class

LayoutBuilderHighlightTrait
A trait for generating IDs used to highlight active UI elements.

Namespace

Drupal\layout_builder

Code

protected function blockAddHighlightId($delta, $region) {
    return "block-{$delta}-{$region}";
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.