djangosnippets.org: Latest snippets tagged with 'withtag'https://djangosnippets.org/tags/withtag/2008-06-30T06:42:56.084603-05:00WithTag Tag
2008-06-30T06:42:56.084603-05:00versaehttps://djangosnippets.org/snippets/835/<p>Set a context variable with the returned value by any templatetag.
Useful for example in order to use url templatetag inside blocktrans:</p>
<p><code>{% withtag url my_app.views.my_view as my_view_url %}</code>
<code>{% blocktrans %}</code>
<code>Click <a href="{{ my_view_url }}">here</a></code>
<code>{% endblocktrans %}</code>
<code>{% endwithtab %}</code></p>
<p>Or with include templatetag:
<code>{% withtag include …</code></p>
Freely redistributable