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.
The code in block--lb-hero--canada-*.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--canada-*.html.twig have 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
Issue fork ws_colorway_canada-3404032
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #6
froboy