Could you provide a solid, minimal example of how you get this case?
I have seen duplicate rendering of nested blocks happen in the past, and it
was because in the resulting template, two blocks wind up with the child
defined in them [this actually lead to me writing a {% reuse %} tag to take
advantage of this :)]
--
Curtis
On 24 May 2015 at 21:28, anentropic <[email protected]> wrote:
> Currently there is a problem (correct me if wrong) when you need to
> override the content of an inner nested block.
>
> {% block parent %}
> some stuff
> {% block child %}
> child stuff
> {% endblock %}
> some other stuff
> {% endblock %}
>
> if you are in a template which extends the one above and you want to
> override just the content of 'child' block you are stuck
>
> if you just do:
>
> {% block child %}
> new child stuff
> {% endblock %}
>
> ...you get two of the 'child' block, because you haven't overridden the
> parent block, so there's another one from there.
>
> But then if you need to override the parent block you have to copy and
> paste all the content that you *don't* want to change, since {{
> block.super }} can't be used (the part you want to override is going to
> be reproduced by the super).
>
> Possible implementation difficulties aside, is it a namespacing problem?
> Do we need a syntax for saying like:
>
> {% block parent:child %}
> new child stuff
> {% endblock %}
>
> ...then Django can know you want to just override the inner nested block,
> with everything else from the parent blocks being reproduced verbatim
> (without having to copy and paste it breaking DRY)
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/26e7d546-0a49-408b-8480-b8d6b4aba608%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/26e7d546-0a49-408b-8480-b8d6b4aba608%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/CAG_XiSA0yp48fybRubE-_fNwE5y5P1jzdro%2BUUkBUaQoHckCSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.