2๐
โ
You can create template with list of businesses and include it everywhere:
inc/business_list.html
<ul>
{% for object in object_list %}
<li>{{ object }}</li>
{% endfor %}
</ul>
search_list.html
...
{% include "inc/business_list.html" with object_list=search_list %}
...
๐คSan4ez
0๐
Yep, you can include templates within other templates
Snippet
<ul>
<li>...</li>
</ul>
Template
<html>
{% include "snippet.html" %}
</html>
https://docs.djangoproject.com/en/dev/ref/templates/builtins/#include
๐คTimmy O'Mahony
- [Answered ]-Can not find CSS file path in Django on Apache with mod_wsgi
- [Answered ]-If / else in Django View
- [Answered ]-Django count in template on object attribute
Source:stackexchange.com