From ff410565bf1cf1a2905c1ef83db408d455211446 Mon Sep 17 00:00:00 2001 From: Jonathan Slenders Date: Wed, 14 Aug 2013 16:14:32 +0200 Subject: Fixed #20709 -- Allowed {% widthratio %} to accept an "as" parameter. Thanks clay.evil@ for the suggestion. --- docs/ref/templates/builtins.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs/ref') 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 -- cgit v1.3