[meta] Consolidate similar twig templates and properly use theme suggestions in core

Created on 5 October 2012, about 12 years ago
Updated 3 July 2024, 6 months ago

Problem/Motivation

Too many theme functions and theme templates that duplicate the same resulting markup structure.

Proposed resolution

  1. Consolidate theme functions and templates into single implementations
  2. Leverage theme hook suggestions to allow targeted theme/template overrides and variable preprocessing.

Procedure

  1. See Twig conversion/refactoring/clean-up issues
  2. Find existing issues or create a new to consolidate groups of similar theme functions, using theme suggestions and preprocess to handle minor differences (or just skipping the differences if they're superfluous).

Details

Remaining tasks

Blockers

Not actually blockers for consolidating theme functions and templates, but without resolving these issues, modules and themes will not be able to easily target/override a specialized theme hook, which means a critical regression compared to D7:

Issues Pt 1 (theme functions that are grouped together)

Entities
TODO Can we do entity.html.twig entity--node.html.twig etc?

links

tables

item lists

containers

Issues Pt 2 (other theme functions that need attention)

User interface changes

None.

API changes

None.

Related Issues

🌱 Plan
Status

Active

Version

11.0 🔥

Component
Theme 

Last updated about 3 hours ago

Created by

🇬🇧United Kingdom catch

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom catch

    Probably time to update the title given its over a decade since we switched to Twig templates.

    With SDCs we are adding more template-y things on top of the template-y things we already have, so it would still make sense to rationalise the twig templates we have.

Production build 0.71.5 2024