I have static text that should appear in two places in the template.
For example:
<div>
{% if something %}
This is a static text
{% else %}
Something else happened
{% endif %}
</div>
... more html
<span>
{% if something %}
This is a static text
{% else %}
Something else happend
{% endif %}
</span>
- I can do this by duplicating the above text in two different places in the template file (as shown above).
- I could also create a model that will store text (this is DRY, but cost a DB call for a simple task)
- I am thinking of using
include template, but this is probably not the best way to achieve my goal.
What is the best way to do this?
source
share