Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Out of the box Drupal provides sometheme hook suggestions for field templates, however, it does not take into account the current entity view mode.
It would be great if it also provided more templates suggestions so you can customize the teaser and search results display fields more readily.
Proposed resolution
Add additional template suggestions during hook_theme_suggestions_field().
Remaining tasks
Update documentation so that themers are aware that this is available to them by default.
User interface changes
None
API changes
None, only needs changes to themer's notes.
Comment | File | Size | Author |
---|---|---|---|
#1 | field_theme_suggestions-2160065-1.patch | 1.3 KB | plopesc |
Comments
Comment #1
plopescAttaching a first approach patch.
There are many more possible combinations of possible theme hook suggestions, but I considered these good for now.
Any thoughts?
Thank you.