Wednesday, October 28, 2015

Re: include template which extends something else

Yes, sorry I was confused... No I don't get what you mean. I think thats exactly what I tried to do. 

I have kind of a main.html doing that:

{% block my-wall %}
<div id="wall-container">
<ul id="wall-list">
{% for obj in objects %}
<li>
{% include 'wall_item.html' with object=obj %}
</li>
{% endfor %}
</ul>
</div>
{% endblock %}
wall_item.html looks like that:

{% extends "wallitem.html" %}

{% block wall_item_header %}
<p>something</p>
{% endblock %}
and wallitem.html like that:

<div class="wall-list-item">
<div class="userprofile-container">
{% block wall_item_header %}
{% endblock %}
</div>
</div>

2015-10-28 17:13 GMT+01:00 Carl Meyer <carl@oddbird.net>:
On 10/28/2015 10:11 AM, Sven Wanner wrote:
> Ok, it's a pitty, but you're totally right. Using if in my template
> should be also fine. Not of that elegance I planned  ;) , but will
> definitely work, too.

I'm not sure what you mean. I thought I just explained how you can use
`extends` in an included template -- I think that should work just fine
for your use case (and I just tested to verify that it does work).

Carl

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/SFh41AI0dcM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5630F421.2020906%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAH4Xs%2BP_C6PYeih9L7tr1GAH4%3D6QMtGOFGbfUSi9TK1O87WEXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment