phoebebright wrote:
> Is there a way to get this to work:
>
> {% for tag in tags %}
> <font size="{{tag.font_size}}">{% tag_link
> "{{tag.name}}" %}</font>
> {% endfor %}
>
>
> The outer loop is using the standard tagging application and the
> tag_link is my custom template tag which has a different url depending
> on the type of tag.
> I don't really want to amend the tagging app, so what is the correct
> way of doing this. Extending the template tag class?
>
Probab ly. I think the easiest thing might be to adjust tag_link
to take a context variable name argument so you just write e.g.
{% tag_link tag %}
- have your template tag look up the variable name passed
as an argument to tag_link (in this case tag_link would see
literally "tag") in the template context as per the django docs.
http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#passing-template-variables-to-the-tag
Then you should be able to do what you want based on that value.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---