#30671: Conditional for Template Block Content.
-------------------------------------+-------------------------------------
     Reporter:  novomotus            |                    Owner:  nobody
         Type:  New feature          |                   Status:  closed
    Component:  Template system      |                  Version:  master
     Severity:  Normal               |               Resolution:  wontfix
     Keywords:  block, conditional,  |             Triage Stage:
  extends                            |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by felixxm):

 * status:  new => closed
 * version:  2.2 => master
 * resolution:   => wontfix


Comment:

 Thanks for this proposition, however I'm not sure if it's feasible, I
 don't see a wide usage, and IMO this can be solved with different tags. I
 would use `include` instead of `block` and `extend`, e.g.

 {{{
 titles.html

 {% if obj.title and obj.subtitle %}
     <h1>{{ obj.title }}</h1>
     <h2>{{ obj.subtitle }}</h2>
 {% endif %}
 }}}

 {{{
 article.html

 <article class="article">
     {% include "titles.html" with obj=article %}
     <p class="article-body">{{ article.body }}</p>
 </article>
 }}}

 Even if it's not a proper solution for you I am convinced that you can
 solve your issue with existing tags, please use one of
 [https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels
 support channels].

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30671#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.98574813c642eec57e00feeeee485094%40djangoproject.com.

Reply via email to