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.
How about we add couple of twig blocks into the paragraph.html.twig. Other modules/theme will then have less work when they want to add specific paragraph template implementation - because they can just use {% extends "@paragraphs/paragraph.html.twig" %} and overwrite only parts.
And as i understand introducing this blocks should not break existing template overrides, correct?
Comment | File | Size | Author |
---|---|---|---|
#4 | interdiff-2850450-2-4.txt | 665 bytes | pivica |
#4 | add-twig-blocks-2850450-4.patch | 1.36 KB | pivica |
Comments
Comment #2
pivica CreditAttribution: pivica at MD Systems GmbH commentedHere is a patch, also fixed some indent errors.
Comment #3
pivica CreditAttribution: pivica at MD Systems GmbH commentedComment #4
pivica CreditAttribution: pivica at MD Systems GmbH commentedChange my mind a little bit about position of first outer block, no sense that it wrap classes var, who ever wants to change that it is easier then to define the whole template override from a start and not to use extend.
Comment #5
zerolab CreditAttribution: zerolab at Torchbox for Mencap commentedStraightforward change and outright improvement.
LGTM!
Leaving this blog post as a reference on extending twig templates.
Cheers,
Dan
Comment #6
miro_dietikerToo much back-and-forth... Accidentally committed this with f866bdf in #2849503: Use subform state for the BehaviorForm() functions
Setting to fixed, reopen if further changes are needed.