function layout_builder_entity_build_defaults_alter
Same name in other branches
- 9 core/modules/layout_builder/layout_builder.module \layout_builder_entity_build_defaults_alter()
- 10 core/modules/layout_builder/layout_builder.module \layout_builder_entity_build_defaults_alter()
- 11.x core/modules/layout_builder/layout_builder.module \layout_builder_entity_build_defaults_alter()
Implements hook_entity_build_defaults_alter().
File
-
core/
modules/ layout_builder/ layout_builder.module, line 176
Code
function layout_builder_entity_build_defaults_alter(array &$build, EntityInterface $entity, $view_mode) {
// Contextual links are removed for entities viewed in Layout Builder's UI.
// The route.name.is_layout_builder_ui cache context accounts for this
// difference.
// @see layout_builder_entity_view_alter()
// @see \Drupal\layout_builder\Cache\LayoutBuilderUiCacheContext
$build['#cache']['contexts'][] = 'route.name.is_layout_builder_ui';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.