Hello,
I have a base template file which is base.html and every other template extends to it and generates content using its blocks.
Now, at my base.html file I want to include a variable that will be using some variable such as querylist.
In example:
assume I hav some NavigationObject model and at the base.html I want to loop through it and generate navigation links such as:
Say I have this querylist:
nav_obj = NavigationObject.objects.all()
At the base html:
{% for object in nav_obj %}
<a href="{{ object.link }}">{{ object.title }}</a>
{% endfor %}
For any view, I need to pass this nav_obj while rendering, istead of this, is there any way to globally declear to be used without passing for every view ?
Thanks