Passing a complete context to a simple_tag doesn't (yet?) work, as
described here:
http://groups.google.com/group/django-users/browse_thread/thread/ee830466be465704/a41d89fd476becb1#a41d89fd476becb1
I finally solved my problem by defining my own tag as follows:
===
from django.te
That's seems to be working, the only thing I've left to do is passing
the complete context from the template to the simple_tag, else the
simple_tag won't be able to render the template. How is that normally
done in Python?
2B
On May 31, 7:32 am, Alex Morega <[EMAIL PROTECTED]> wrote:
> Create yo
On 5/31/08, Alex Morega <[EMAIL PROTECTED]> wrote:
>
>
>
> On May 31, 2008, at 00:36 , Berco Beute wrote:
>
> >
> > Unfortunately that doesn't work. This works:
> >
> > {{ include dir|concat:"/tag.html" }}
> >
> > But not this:
> >
> > {% include dir|concat:"/tag.html" %}
> >
> > Thanks, but I'm st
On May 31, 2008, at 00:36 , Berco Beute wrote:
>
> Unfortunately that doesn't work. This works:
>
> {{ include dir|concat:"/tag.html" }}
>
> But not this:
>
> {% include dir|concat:"/tag.html" %}
>
> Thanks, but I'm still searching for a solution...
Create your own tag - not an inclusion tag, b
Unfortunately that doesn't work. This works:
{{ include dir|concat:"/tag.html" }}
But not this:
{% include dir|concat:"/tag.html" %}
Thanks, but I'm still searching for a solution...
2B
On May 29, 11:18 pm, Johannes Dollinger
<[EMAIL PROTECTED]> wrote:
> You could use a filter:
>
> @regist
You could use a filter:
@register.filter(name='concat')
def concat(value, arg):
return "%s%s" % (value, arg)
and then {% include dir|concat:"/tag.html" %}.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"
I can surely pass the path variable into the context from within my
view, but the view doesn't know which filename to include. So in the
template, I would still have to combine path and filename when
creating an include tag such as:
{% include "dir/tag.html" %}
But how can I combine the path 'di
Inclusion tags sound good, but I'm not sure how it could solve my
problem. In my template I would like to use an inclusion tag this way:
###template
{% showTag 'tagName' %}
###inclusion tag
@register.inclusion_tag('tag.html')
def showTag(tagname):
#...
###tag.html
bla
But ho
Could you set the entire path variable from within your view, then
pass the path, including the filename, into the context?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
You should create an inclusion tag:
http://www.djangoproject.com/documentation/templates_python/#inclusion-tags
Juanjo
--
mi blog: http://www.juanjoconti.com.ar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Dja
In the following 'include' tag the 'dir' may vary:
{% include "dir/tag.html" %}
so I would rather use something like:
{% include {{ dir }}"/tag.html" %}
which of course doesn't work. Is there a way to accomplish this? Being
able to set a variable inside a template would solve the problem, but
11 matches
Mail list logo