Re: Django Templates: Using the "with" statement and "block.super" together

2013-09-24 Thread Russell Keith-Magee
dif %} > …stuff... > {% endblock %} > > > # child.html > {% extends "parent.html" %} > > {% block someblock %} > {% with True as cool_optional_feature_is_enabled %} > {{ block.super }} > {% endwith %} > {% endblock %} > > > The cool thing

Re: Django Templates: Using the "with" statement and "block.super" together

2013-09-24 Thread Vijay Katam
%} > …stuff… > {% if cool_optional_feature_is_enabled %} > …optional stuff... > {% endif %} > …stuff... > {% endblock %} > > > # child.html > {% extends "parent.html" %} > > {% block someblock %} > {% with True as cool_optional_feature_is_enabled %} > {

Re: Django Templates: Using the "with" statement and "block.super" together

2013-09-24 Thread Tomas Ehrlich
> …stuff… > {% if cool_optional_feature_is_enabled %} > …optional stuff... > {% endif %} > …stuff... > {% endblock %} > > > # child.html > {% extends "parent.html" %} > > {% block someblock %} > {% with True as cool_optional_feature_

Re: Django Templates: Using the "with" statement and "block.super" together

2013-09-24 Thread Bill Freeman
This sounds safe to me. After all, we pass context variables in from views and expect them to be available within block.super code. Perhaps some folks aren't sufficiently clear as to when stuff in a template is evaluated. So, I'd do it if I needed it. On Tue, Sep 24, 2013 at 1:59

Django Templates: Using the "with" statement and "block.super" together

2013-09-24 Thread Warren Smith
block someblock %} {% with True as cool_optional_feature_is_enabled %} {{ block.super }} {% endwith %} {% endblock %} The cool thing is that this technique allows a child template to essentially enable a feature in the parent template. The same technique can also be used to disable a feature in the

No exception in template using with and block.super

2012-08-30 Thread Skirmantas
I am am using with tag to transfer flags to block.super like this: {% with something=1 %} {{ block.super }} {% endwith %} Now if block.super rises an exception, for example NoReverseMatch, instead of error page, the {{ block.super }} renders to an empty string, the exception is

Re: Template-Include and block.super

2010-02-05 Thread newspaper-django-lackey
into your block js while the html is included into your block content. You can put includes into nested folders in your app or a separate includes folder if you would like to keep them together. for instance {% block js %}{{ block.super }} {% if myapp.has_nav %} {% include &q

Re: Template-Include and block.super

2010-02-03 Thread Alex Robbins
ne. But what i > want now (and i guess isnt possible and im just on the wrong way here > ^^) is : > > -- menu.html -- > {% block extrahead %} > {{ block.super }} > > > {% endblock extrahead %} > >  ... > > > So the content of menu will be inserted at the

Re: Template-Include and block.super

2010-02-03 Thread Daishy
ere ^^) is : -- menu.html -- {% block extrahead %} {{ block.super }} {% endblock extrahead %} ... So the content of menu will be inserted at the include-tag and the extra js should be inserted into the extrahead-block. I hope thats a better example of what i want to do. Again, i wouldnt be suprised if

Re: Template-Include and block.super

2010-02-02 Thread Alex Robbins
Daishy, it would help if you posted the template code you already tried. This is basically how you could do what you are describing: base.html {% block extrahead %} {% endblock %} sub_page.html {% extends "base.html" %} {% block extrahead %} {{ block.super }}

Template-Include and block.super

2010-02-01 Thread Daishy
Hi, i'm pretty new to django and just stumbled upon a question i didnt found a solution to, despite the good docs :). I have a base-template which defines a block calles js and css. Now i can extend that template and use these blocks and block.super, to add javascript or css-files to

Re: block.super returning html character codes - NOT html

2007-11-14 Thread Michael Radziej
so > I've switched to that instead of using safe. > > Here's my base.html now: > > {% autoescape off %} > {% block breadcrumbs %} > Home > {% endblock %} > {% endautoescape %} > > I guess a "DRY-alert" didn't go off in my head

Re: block.super returning html character codes - NOT html

2007-11-14 Thread Josh
Hi Michael, > This should only be needed if you did not do what Malcolm called "Simple > backwards compatibility", i.e. to set {% autoescape off %}. > > So, am I right that you didn't put such a {% autoescape off %} tag in your > root template? Then you have to examine whether you use any html fr

Re: block.super returning html character codes - NOT html

2007-11-14 Thread Michael Radziej
Hi Josh, On Wed, Nov 14, Josh wrote: > > Fixed it. > > New feature in django-dev is HTML escaping for any template tags (good > against cross-site scripting problems). > > Had to apply the safe filter to any template tags I don't want auto- > escaped.

Re: block.super returning html character codes - NOT html

2007-11-14 Thread Josh
Fixed it. New feature in django-dev is HTML escaping for any template tags (good against cross-site scripting problems). Had to apply the safe filter to any template tags I don't want auto- escaped. OLD: {{ block.super|safe }} NEW: {{ block.super|safe }} Read more about it in django

block.super returning html character codes - NOT html

2007-11-14 Thread Josh
block.super was working great before i did an svn up this morning.. All of my block.super template tags are returning the HTML character codes instead of the actual HTML - so instead of getting proper HTML links, i get the text of the HTML link. Has anyone come across this? New bug? - Josh

Re: block.super

2007-02-12 Thread daev
I think that you can only use {{block.super}}. May be you have to change your template design On Feb 12, 12:09 pm, "Rob Slotboom" <[EMAIL PROTECTED]> wrote: > Sorry that isn't working (at least not in my template ) --~--~-~--~~~---~--~~ Y

Re: block.super

2007-02-12 Thread Rob Slotboom
Sorry that isn't working (at least not in my template ) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from t

Re: block.super

2007-01-29 Thread Jeremy Dunck
On 1/29/07, Rob Slotboom <[EMAIL PROTECTED]> wrote: ... > > I tried > {{ block.super }} > {{ block.super.super }} > {{ block.super.block.super }} > But none of these are doing the right thing. Is there a way to call > the parents parent blocks? > > Perhaps bl

block.super

2007-01-29 Thread Rob Slotboom
On my base template I have a block, say X One level down there is a section template (extending base) overwriting block X Further down there are templates (extending section). On these templates I want to be able to get the original value of X. I tried {{ block.super }} {{ block.super.super