function SystemThemeHooks::themeSuggestionsField
Same name and namespace in other branches
- 11.x core/modules/system/src/Hook/SystemThemeHooks.php \Drupal\system\Hook\SystemThemeHooks::themeSuggestionsField()
Implements hook_theme_suggestions_HOOK().
Attributes
#[Hook('theme_suggestions_field')]
File
-
core/
modules/ system/ src/ Hook/ SystemThemeHooks.php, line 226
Class
- SystemThemeHooks
- Hook implementations for system.
Namespace
Drupal\system\HookCode
public function themeSuggestionsField(array $variables) : array {
$suggestions = [];
$element = $variables['element'];
$suggestions[] = 'field__' . $element['#field_type'];
$suggestions[] = 'field__' . $element['#field_name'];
$suggestions[] = 'field__' . $element['#entity_type'] . '__' . $element['#bundle'];
$suggestions[] = 'field__' . $element['#entity_type'] . '__' . $element['#field_name'];
$suggestions[] = 'field__' . $element['#entity_type'] . '__' . $element['#field_name'] . '__' . $element['#bundle'];
return $suggestions;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.