Create reusable HTML components with the "include" tag in TwigJS
In this lesson, we take a repeating block of HTML and turn it into a dynamic, reusable TwigJS component. The "include" tag allows us to generate multiple instances of the component, each with their own custom content.
Make your HTML components dynamic with the "with" keyword in TwigJS
In this lesson, we make TwigJS components output custom content via the "with" keyword of the "include" tag. We also set up fallback values to make our component work in a variety of scenarios.
Generate multiple HTML components from an array with the "for loop" in TwigJS
In this lesson, we transform a series of TwigJS "includes" into a clean "for loop". We store our content into an array and let the loop generate one HTML component for each entry.