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
Several Drupal theme functions result in exactly the same markup structures. As we convert to twig we should take the opportunity to consolidate what can be consolidated, and add theme_hook suggestions where particular instances of these structures may need to be overridden independently.
Proposed resolution
Implement theme('table')
wherever possible, and add theme_hook_suggestions for all variations, including:
Remaining tasks
- #1751194: Introduce hook_theme_suggestions[_HOOK]() and hook_theme_suggestions[_HOOK]_alter()
- #2035897: remove theme_image_style_list() and call theme('table__image_styles__list') instead
- #2035903: Remove theme_image_style_effects() and call theme('table__image_styles__effects') instead.
- #2035905: Remove theme_book_admin_table and call theme('table__book_admin') instead
User interface changes
None.
API changes
Removal of the following theme functions:
Related
#1804614: [meta] Consolidate theme functions and properly use theme suggestions in core
Comments
Comment #1
jenlamptonupdating title
Comment #1.0
jenlamptonadded theme_tableselect too
Comment #2
jenlamptonupdating component too :)
Comment #3
aspilicious CreditAttribution: aspilicious commentedDon't forget the custom views table function ;)
Comment #3.0
aspilicious CreditAttribution: aspilicious commentedreformat
Comment #3.1
jenlamptonadd image style list
Comment #4
jenlamptonupdating title. and yes, we'll need to get views to use our default components as well. :)
Comment #5
jenlamptonupdating title, again
Comment #5.0
jenlamptonclearer explanation of table consolidation
Comment #5.1
jenlamptonsummary
Comment #5.2
jenlamptonupdate
Comment #6
sunPlease note that #1876712: [meta] Convert all tables in core to new #type 'table' will eliminate a couple of these.
Comment #6.0
sunadd image_style_effects
Comment #7
jenlamptonComment #7.0
jenlamptonadded theme admin book table
Comment #7.1
jenlamptonissue cleanup
Comment #7.2
jenlamptonlinks to more issues
Comment #7.3
jenlamptoncreate issues for each template removal
Comment #8
mitokens CreditAttribution: mitokens as a volunteer commentedComment #9
akalata CreditAttribution: akalata commentedSince all tasks are completed, this can be closed, right?