Blair Wadman: Need to reuse HTML in multiple templates? Try using partial Twig templates

0 Flares Twitter 0 Facebook 0 Filament.io 0 Flares ×

You have a piece of HTML code that needs to be included in multiple Twig templates. The code will be consistent across all of them – if you need to change it, you need to change it everywhere it is used.

As an example, I recently had to include a piece of code from a social share service called RhythmOne. I want to include this code in some, but not all, of the node templates.