Include Other Twig Templates

Last updated January 12, 2022
Sprout Video

Using a base layout is very common, and we’ve implemented that in the previous tutorial. Sometimes you also need to include some other templates on only select pages. In this tutorial you are going to add a sales banner to the pages using the include function, and working with the variables we can pass there.

Additional resources

Be sure to check the documentation for the version of Twig in your codebase for the correct syntax and usage.

  • Documentation for include function: 1.x | 2.x | 3.x