On 8/12/06, Michal <[EMAIL PROTECTED]> wrote:
>
> Hello,
> I was trying to include some of the menu templates according to
> flatpage.url variable (I have several local menu templates):
>
> {% include flatpage.url|menu %}
>
> But this doesn't work. It seems to me, that flatpage.url|menu isn't
> evaluated, because find_template_source from django/template/loader.py
> wasn't call (I put there print name, and for menu include it doesn't
> print anything; for some other includes with hardcoded template name print).
>
>
> Could anybody tell me, if my approach is bad or not, please.
>
>
Yeah, there are some default tags in Django which can not support
template variables plus filter, just like include, so you cann't use
variable and filter tegether as the parameter of the "include" tag.
But you can use expr tag written by me[1] to evaluate the expression
and saved it to another variable, and then use this new variable in
"include" tag.

catch tag is used to catch the result of a block of template code and
save it to a named variable.

For example:
{% catch as t %}{{ flatpage.url|menu }}{% endcatch %}

[1]http://code.djangoproject.com/wiki/CatchTag

-- 
I like python!
My Blog: http://www.donews.net/limodou
My Django Site: http://www.djangocn.org
NewEdit Maillist: http://groups.google.com/group/NewEdit

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to