Wednesday, October 28, 2015

Re: include template which extends something else

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBCAAGBQJWMPeMAAoJEC0ft5FqUuEh9wAQAJSDtX60Ym5KcNwdbMZ4Sa2Z
AvDPsdFjn3dxfnSHoWjLVopzibRQgLx5ulhyNVIJ4rm77FfS0gY6HEDU8yv4zPup
Dj96+tegxk/qdvDjLLsczLQBONCgunIoBI2VH1tWTXISUU0Sgk89oe7glSc2WGtP
yOGmm7EJ4ZBlexKZT3g8n6oWYx9kzReeXlZg8HjRMR+q51hGpqr2zhJVR66XxOPz
wOEIPmXvXuP+3w+a0+lZK4mvi0n9HHVAEi75kJj9PxNoTx7LJ+EtVfbYUs0U8hrg
BrJ9O8NSpjw1dO7Oerb/dRZuM7lTIrGvoUdDf/8TyBHsScCb3rj8Xe5BUHbzAO/b
WIgitoo0HgqzLNUmv0J5HVw254ZpANZpPVbbMB8O/smmQBiOsN1VHq4/HQOfq6vv
sfaV3mMCtMa5O7cW/36FEmlkY36PbxSa4J9+leBUIK1IxkOaVfeNC/vdnS0KjIAe
ziw5b4//2YNnWbNT9QjFZzA9jdvtcdykqxoP09eLjHDJCTx7eJKkGAg+71B9SOvf
8RIkVqWmrSTqe/v9iDeTtS2RE+zyEkUkH2E9PhDhENVpOvBbm+QZgFHoe2ZXxLBV
G21YnNPTcknvcoofPjNnTCmvEuRCMWomTXmB/RIu604lmuZaPODWPuTGuUzrBECQ
IMiHdgOmTZMrYkTgXh8w
=m5J7
-----END PGP SIGNATURE-----
On 10/28/2015 10:25 AM, Sven Wanner wrote:
> 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>

That template structure should work just fine. I just tested here with a
similar set of templates and it worked. So there's something else going
on. Can you be more specific about how it fails? Do you get an error?
Unexpected output in some way?

Carl

--
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/5630F788.90202%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment