djangosnippets.org: Latest snippets tagged with 'capture'https://djangosnippets.org/tags/capture/2008-01-14T13:25:47.786348-06:00Capture template output as a variable
2008-01-14T13:25:47.786348-06:00kcarnoldhttps://djangosnippets.org/snippets/545/<p>Tags like <code>url</code> and <code>trans</code> provide no way to get the result as a context variable. But how would you get a computed URL into a <code>blocktrans</code>?</p>
<p>This snippet solves the general problem. Just put the template code whose output you want to capture within <code>captureas</code> tags. For example: …</p>
Freely redistributable