summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorJonathan Slenders <jonathan@slenders.be>2013-08-14 16:14:32 +0200
committerTim Graham <timograham@gmail.com>2013-08-14 12:40:19 -0400
commitff410565bf1cf1a2905c1ef83db408d455211446 (patch)
tree5f2ecee536c3a2ae1a9bea58d20ec537d669ee71 /docs/ref
parent71c491972eecae8783cf46e69fac7e5f9f83fc59 (diff)
Fixed #20709 -- Allowed {% widthratio %} to accept an "as" parameter.
Thanks clay.evil@ for the suggestion.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/templates/builtins.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index afb6e4b123..1fadf77d50 100644
--- a/docs/ref/templates/builtins.txt
+++ b/docs/ref/templates/builtins.txt
@@ -1108,6 +1108,14 @@ If ``this_value`` is 175, ``max_value`` is 200, and ``max_width`` is 100, the
image in the above example will be 88 pixels wide
(because 175/200 = .875; .875 * 100 = 87.5 which is rounded up to 88).
+.. versionchanged:: 1.7
+
+In some cases you might want to capture the result of ``widthratio`` in a
+variable. It can be useful, for instance, in a :ttag:`blocktrans` like this::
+
+ {% widthratio this_value max_value max_width as width %}
+ {% blocktrans %}The width is: {{ width }}{% endblocktrans %}
+
.. templatetag:: with
with