36π
β
You can try the with
template tag:
{% with table_header1 as table_header %}
{% with table_data1 as table_data %}
{% include 'default_table.html' %}
{% endwith %}
{% endwith %}
{% with table_header2 as table_header %}
{% with table_data2 as table_data %}
{% include 'default_table.html' %}
{% endwith %}
{% endwith %}
But I donβt know if it works, I didnβt try it myself.
Notice: If you have to include this very often, consider to create a custom template tag.
π€Felix Kling
77π
You may use with
inside include
:
{% include "default_table.html" with table_header=table_header1 table_data=table_data1 %}
See also documentation on include
tag.
π€zag
- [Django]-How to get the current language in Django?
- [Django]-Mac OS X β EnvironmentError: mysql_config not found
- [Django]-Disable Django South when running unit tests?
Source:stackexchange.com