Problem/Motivation
Several drupal theme functions result in exactly the same markup structures.
<div class="{{ attributes.class }}" {{ attributes }}>{{ children }}</div>
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('container')
wherever possible, and add theme_hook_suggestions for all variations, including:
Remaining tasks
#2041825: Remove theme_radios() and call theme('container') instead
#2041845: Remove theme_checkboxes() and call theme('container') instead
Related tasks
#939462: Specific preprocess functions for theme hook suggestions are not invoked
#1751194: Introduce hook_theme_suggestions[_HOOK]() and hook_theme_suggestions[_HOOK]_alter()
#1804614: [meta] Consolidate theme functions and properly use theme suggestions in core
#1285506: Radios select in form dont have unique wrapper class
#1898480: [meta] form.inc - Convert theme_ functions to Twig
User interface changes
None.
API changes
TBD
Comments
Comment #1
jenlamptonUpdating title.
Comment #1.0
jenlamptonadded info about container.html.twig
Comment #2
jenlamptonupdating again :/
Comment #3
jenlamptonupdating title.
Comment #3.0
jenlamptonadd links to api.drupal.org
Comment #3.1
jenlamptonissue summary
Comment #3.2
jenlamptonclean
Comment #4
c4rl CreditAttribution: c4rl commentedRelated #1848116: Revise usage of {% include %}
Comment #5
jenlamptontagging
Comment #5.0
jenlamptonrelated
Comment #5.1
jenlamptonadd element
Comment #5.2
jenlamptonsub issues
Comment #5.3
jenlamptonreorg
Comment #6
mitokens CreditAttribution: mitokens as a volunteer commentedComment #8
JohnAlbin#1114398: Form element & Form element label theming is broken was fixed in D8. Removing it from the issue summary.
Comment #14
andypost