Skip to content
Zotonic
  • Start
  • Cookbook
  • Reference
  • Releases

Live search

Search across all Zotonic content

Type at least two characters

Results are matched against titles, summaries and topics as you type.

Filters ยท mod_base
  • Reference
  • Frontend developer
  • Template filter
  • Compare
  • Number

minmax

Module

mod_base

Force the given value in the given range.

This clamps the filter value between the two filter arguments.

Example:

{% print 3|to_integer|minmax:10:20 %}

This will print 10, since that is the minimum value allowed.

Passing in undefined will not clamp the value but return undefined.

Edit on GitHub

Related documentation

Filters

is_number

Test if a value is a number (integer or floating point):

Filters

max

Take the maximum of the filter value and its first argument.

Filters

is_even

Test if an integer value is even:

Filters

min

Take the minimum of the filter value and its first argument.

Filters

survey_is_history_back

Test whether a survey respondent may return to the previous page in a history.

Filters

floor

Round down a floating point value.

Filters

sum

Sum a list of numbers.

Filters

survey_is_save_intermediate

Check if the given survey is configured to save intermediate results. Always returns a boolean value.

Filters

default_if_none

Provide an alternative value in case a value is undefined.

GitHub © 2026 Zotonic