You are here

function layout_builder_theme_suggestions_test_preprocess_item_list__layouts in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/tests/modules/layout_builder_theme_suggestions_test/layout_builder_theme_suggestions_test.module \layout_builder_theme_suggestions_test_preprocess_item_list__layouts()

Implements hook_preprocess_HOOK() for the list of layouts.

1 string reference to 'layout_builder_theme_suggestions_test_preprocess_item_list__layouts'
LayoutBuilderThemeSuggestionsTest::testLayoutListSuggestion in core/modules/layout_builder/tests/src/Functional/LayoutBuilderThemeSuggestionsTest.php
Tests alterations of the layout list via preprocess functions.

File

core/modules/layout_builder/tests/modules/layout_builder_theme_suggestions_test/layout_builder_theme_suggestions_test.module, line 24
For testing theme suggestions.

Code

function layout_builder_theme_suggestions_test_preprocess_item_list__layouts(&$variables) {
  foreach (array_keys($variables['items']) as $layout_id) {
    if (isset($variables['items'][$layout_id]['value']['#title']['icon'])) {
      $variables['items'][$layout_id]['value']['#title']['icon'] = [
        '#markup' => __FUNCTION__,
      ];
    }
  }
}