Reputation: 8283
I want to create a template for a component that is used many times on a single page, with very few changes (simply 2 or 3 variables). How can I create this template and render it within another template?
Upvotes: 12
Views: 7145
Reputation: 2546
How about include?
Like so:
{% include "name_snippet.html" with person="Jane" greeting="Hello" %}
Upvotes: 23
Reputation: 798476
We usually create a custom inclusion tag for this.
Upvotes: 4