Hello everyone,

I was wondering if there is a way to test for the existence of content
in a block.

For example I have a layout template that is extended by all my other
templates. If those child templates don't specify content for a
specific block, how can I determine in the parent template if the
child template didn't specify anything for the content block so I can
have default content if it's not specified?

For example:

{% block build_options %}{%endblock%}

Is in the parent template,

if in the child template I specify nothing or it renders to nothing
because there are no variables or something.


{% block build_options %}{%endblock%}

How can I set default content in the parent template so, something
like

{% if block build_options %}

{{ build_options }}

{% else %}

{{ default_build_options }}

{% endif %}

-- 
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pocoo-libs?hl=en.

Reply via email to