Re: Template inheritance with dynamic content

2020-11-16 Thread Tristania W
Thanks, David, for answering the following-up question. I have figured out the problem. The "zip" object works with "include" as you have anticipated. The issue that I found is that, in my view, I am zipping the lists in a different function (called "*def **give_me_zip*"). This function returns

Re: Template inheritance with dynamic content

2020-11-14 Thread Tristania W
Hi, To follow up, when I tried the following: * {% include "child_template.html" with zip_list=zip_list%}* if the variable *zip_list* is a zip object, defined as following in the view, * zip_list= zip (list1, list2, list3)* the "*include*" does not work. But if I pass any other normal variable

Re: Template inheritance with dynamic content

2020-11-13 Thread David Nugent
You can achieve what you are looking for using the include directive. Just have your parent and child include the same block and use with… phrase to override variables within the included template. Regards, David On 20201

Template inheritance with dynamic content

2020-11-13 Thread Tristania W
Is it possible to make one sub-template inherit a div with dynamic content from an upper level template? For eg., Template2 extends Template1. Within Template1, there is a div XXX that depends on a variable {{ var1 }}. This variable is passed to the view *def view1*, which renders Template 1. W