By bobbygryzynger on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.8.x
Introduced in version:
8.8.0
Issue links:
Description:
Field formatters will now pass their third party settings as part of their render array.
An example usage is to create additional template suggestions:
/**
* Implements hook_theme_suggestions_HOOK_alter().
*/
function my_module_theme_suggestions_field_alter(&$suggestions, array $variables) {
$third_party_setting = $variables['element']['#third_party_settings']['my_module']['foo'];
$suggestions[] = 'field__' . $third_party_setting;
}
Impacts:
Module developers
Themers