De-duplicate code in twig templates

Created on 23 November 2023, 12 months ago
Updated 9 July 2024, 5 months ago

The code in block--lb-hero--variation-*.html.twig contains highly duplicated code. In order to maintain a DRY codebase and reduce our codebase β€œweight”, we should de-duplicate code wherever possible.

A possible model for this could be:

  • block--lb-hero.html.twig contains the base code for all variants with block statements and switching logic.
  • set statements should all be made before any div to maintain separation of concerns.
  • block--lb-hero--variation-*.html.twighave set statements to assign variables, then use extends to reference the base template.

Acceptance Criteria

  • code diff should have lots of deletions
  • front-end should have no changes from prior behavior
πŸ“Œ Task
Status

Fixed

Version

1.2

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine david-b Kropyvnytskyi

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024