Lang Loop

Lang loop.

{loop type="lang" name="the-loop-name" [argument="value"], [...]}

Important informations :

* : argument is required
** : at least one of ** marked argument is required

Global arguments

Argument Description
backend_context

Determine if loop is use in backend context.

default : false

example : backend_context="on"

force_return

force return result for i18n tables even if there is no record

default : false

example : force_return="on"

limit

The maximum number of results to display.

example : limit="10"

name *

The loop name. This name must be unique and is used to reference this loop further in the page (see ifloop, elseloop or pageloop)

offset

The first product to display offset. Will not be used if `page` argument is set.

default : 0

example : offset="1"

page

The page to display.

example : page="2"

Loop arguments

Argument Description
code
Thelia >= 2.2

A single or list of lang code.

example : code="fr", code="fr,en"

default_only
Thelia >= 2.2

returns only the default language

default : false

example : default_only="true"

exclude

A single or list of lang ids.

example : exclude="2", exclude="1,3"

exclude_default

exclude the default language from results

default : false

example : exclude_default="true"

id

A single or list of lang ids.

example : id="2"

locale
Thelia >= 2.2

A single or list of lang locale.

example : code="fr_FR", code="fr_FR,fr_CA"

order

A list of values

Expected values :
  • alpha : sort results by lang title ascending alphabetic order
  • alpha_reverse : sort results by lang title descending alphabetic order
  • id : sort results by ascending id order
  • id_reverse : sort result by descending id order
  • position : sort result by ascending position order
  • position_reverse : sort result by descending position order

default : position

example : order="alpha_reverse"

Global outputs

Variable Description
$LOOP_COUNT the current results index, starting from 1
$LOOP_TOTAL the total number of results returned by the loop
$CREATE_DATE The creation date of this Lang
$UPDATE_DATE The last modification date of this Lang

Loop outputs

Variable Description
$CODE lang code, example : fr
$DATE_FORMAT the lang date format
$DECIMAL_COUNT >= 2.2 the number of digits after the decimal separator
$DECIMAL_SEPARATOR >= 2.2 the lang decimal separator, such as , or .
$ID the order id
$IS_DEFAULT check if the current result is the default one
$LOCALE lang locale, example : fr_FR
$POSITION lang position
$THOUSANDS_SEPARATOR >= 2.2 the lang thousangs separator
$TIME_FORMAT the lang time format
$TITLE lang title
$URL the lang URL, only if a specific URL is defined for each lang