Here is the code:
#list.html
{% if intentions %}
<table class="table">
{% for i in intentions %}
{% url 'intentions.views.show' i.id as iUrl %}
<tr>
<td width="20%">
<span class="label label-success">x prayers</span>
</td>
<td><h3><a href="{{ iUrl }}">{{ i }}</a></h3></td>
</tr>
{% endfor %}
</table>
{% else %}
<p>
No intentions are available.
</p>
{% endif %}
If this code is inside index.html everything is ok. If I try to move this code to separate file list.html and include in index.html like:
{% include "list.html" with intentions=entries %}
I have no values in url attribute of <a> tag. Could someone give me answer why?
Your list.html template might be missing
Because you are using the ‘as’ syntax, the url tag fails silently.