function layout_builder_theme_suggestions_test_preprocess_item_list__layouts

Same name and namespace in other branches
  1. 8.9.x 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()
  2. 10 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()
  3. 11.x 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

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__,
            ];
        }
    }
}

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