Hi,

In my base.html I'm trying to do this:

        <title>{% block title %}{{title|default:"{{SITE_NAME}}"}}{%
endblock %}</title>

But I'm getting this:

TemplateSyntaxError at /
default requires 1 arguments, 0 provided

So, SITE_NAME is not passed to the filter.

As a workaround I did this:

        <title>{% block title %}{% if not title %}{{SITE_NAME}}{% else
%}{{title}}{% endif %}{% endblock %}</title>

But it's pretty ugly... Is there anyway to passing a variable to a
template filter??

Thanks,
Andres

-- 
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 this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to