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
  • Transform
  • Collection

split_in

Module

mod_base

This filter split a list in shorter lists. It splits an array in N sub-arrays of more or less equal length. This is useful when displaying a list of items in columns.

For example:

{% with [1,2,3,4,5,6]|split_in:3 as a,b,c %}
    {% for n in a %}{{ n|format_number }} {% endfor %}
{% endwith %}

This displays 1 4. The variable b will be [2,5] and the variable c will be [3,6].

Edit on GitHub

Related pages

  • chunk This filter splits a list in shorter lists. It splits an array in sub-arrays of at most a given length. This is useful when displaying a list of items in… →
  • vsplit_in This filter splits a list in shorter lists. It splits an array in N sub-arrays of more or less equal length. This is useful when displaying a list of items in… →

Referred by

Filters

vsplit_in

This filter splits a list in shorter lists. It splits an array in N sub-arrays of more or less equal length. This is useful when displaying a list of items in…

Related documentation

Filters

language_sort_localized

Sort a list of language codes or map with languages on their localized name in the currently selected language. This is useful for…

Filters

make_list

Forces the value to a list.

Filters

vsplit_in

This filter splits a list in shorter lists. It splits an array in N sub-arrays of more or less equal length. This is useful when displaying…

Filters

reversed

Reverse a list.

Filters

menu_expand

Takes a menu, or a menu resource id, and adds all haspart objects connected to the menu ids.

Filters

tail

Fetch the tail of a list.

Filters

insert

Prepends the argument in front of the value.

Filters

language_sort

Sort a list of language codes or map with languages on their sort key. Return a list of {Code, LanguageProps} pairs.

Filters

join

Joins the elements of a list. Joins the elements of the input list together, separated by the argument.

GitHub © 2026 Zotonic