This page last changed on Jul 22, 2011 by kristin.bradley@involver.com.

Overview

Exactly like capture, but captures the result of SML code to a variable as a number. Useful for capturing results from filters that return numbers and then using the result in a numeric comparison.


Examples

{% capture_int total_polls %}
  {{ current_poll.poll_items | size }}
{% endcapture_int %}

{% if total_polls == 0 %}
  No polls
{% endif %}

Assuming total_polls is 0 would result in:

No polls
Capture a number then perform some math on it and output result:
{% capture_int static_number %}600{% endcapture_int %}

<p>{{ static_number | times:0.05 }}</p>
Document generated by Confluence on Feb 12, 2013 09:09