Skip to main content

Document

The document loop process, cache and display products, categories, contents and folders documents.
{loop type="document" name="the-loop-name" [argument="value"], [...]}

Arguments

ArgumentDescriptionDefaultExample
category **a category identifier. The loop will return this category's documentscategory="2"
content **a content identifier. The loop will return this content's documentscontent="2"
excludeA single or a comma-separated list of document IDs to exclude from the list.exclude="456,123"
folder **a folder identifier. The loop will return this folder's documentsfolder="2"
force_returna boolean to define if the return is forcedtrueforce_return="no"
idA single or a list of document ids.id="2", id="1,4,7"
orderA list of values see sorting possible valuesmanualorder="alpha_reverse"
product **a product identifier. The loop will return this product's documentsproduct="2"
query_namespacea namespaceThelia\Model
source **see Expected valuessource="category"
source_idThe identifier of the object provided in the "source" parameter. Only considered if the "source" argument is presentsource_id="2"
visibleA boolean value.yesvisible="no"
with_prev_next_infoA boolean. If set to true, $HAS_PREVIOUS, $HAS_NEXT, $PREVIOUS, and $NEXT output variables are available.false

Plus the global arguments

Outputs

VariableValue
$CHAPOthe document chapo
$DESCRIPTIONthe document description
$DOCUMENT_FILEthe document file
$DOCUMENT_PATHThe absolute path to the generated document file
$DOCUMENT_URLThe absolute URL to the generated document
$HAS_NEXTOnly available if with_prev_next_info parameter is set to true
$HAS_PREVIOUSOnly available if with_prev_next_info parameter is set to true
$IDthe document ID
$LOCALEthe locale
$NEXTOnly available if with_prev_next_info parameter is set to true
$OBJECT_IDThe object ID
$OBJECT_TYPEThe object type (e.g., produc, category, etc. see 'source' parameter for possible values)
$ORIGINAL_DOCUMENT_PATHThe absolute path to the original document file
$POSITIONthe position of this document in the object's document list
$POSTSCRIPTUMthe document postscriptum
$PREVIOUSOnly available if with_prev_next_info parameter is set to true
$TITLEthe document title
$VISIBLEtrue if the document is visible. False otherwise

Plus the global outputs

Order possible values

Arguments

Ascending valueDescending valueSorted fields
alphaalpha-reversetitle
manualmanual-reverseposition
randompseudo-random order

Souce expected values

Arguments

value
brand
category
content
folder
product