De-duplicate code in twig templates

Created on 23 November 2023, about 1 year ago
Updated 26 April 2024, 8 months ago

The code in block--lb-cards--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-cards.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-cards--variation-*.html.twig have set statements to assign variables, then use extends to reference the base template.

Acceptance Criteria

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

Fixed

Version

2.0

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