You are here

function layout_builder_ids_preprocess_layout in Layout builder ids 2.0.x

Same name and namespace in other branches
  1. 8 layout_builder_ids.module \layout_builder_ids_preprocess_layout()

Implements template_preprocess_layout.

File

./layout_builder_ids.module, line 11
Functions for layout_builder_ids.

Code

function layout_builder_ids_preprocess_layout(&$variables) {

  // If there is a layout builder id, set it in the attributes.
  if (isset($variables['content']['#settings']['layout_builder_id']) && $variables['content']['#settings']['layout_builder_id'] !== '') {

    // Set the id attribute.
    $variables['attributes']['id'] = $variables['content']['#settings']['layout_builder_id'];
  }
}