function layout_builder_theme_suggestions_field_alter
Same name in other branches
- 9 core/modules/layout_builder/layout_builder.module \layout_builder_theme_suggestions_field_alter()
- 10 core/modules/layout_builder/layout_builder.module \layout_builder_theme_suggestions_field_alter()
- 11.x core/modules/layout_builder/layout_builder.module \layout_builder_theme_suggestions_field_alter()
Implements hook_theme_suggestions_HOOK_alter().
File
-
core/
modules/ layout_builder/ layout_builder.module, line 412
Code
function layout_builder_theme_suggestions_field_alter(&$suggestions, array $variables) {
$element = $variables['element'];
if (isset($element['#third_party_settings']['layout_builder']['view_mode'])) {
// See system_theme_suggestions_field().
$suggestions[] = 'field__' . $element['#entity_type'] . '__' . $element['#field_name'] . '__' . $element['#bundle'] . '__' . $element['#third_party_settings']['layout_builder']['view_mode'];
}
return $suggestions;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.