Skip to main content

Category

Category loop lists categories from your shop.
{loop type="category" name="the-loop-name" [argument="value"], [...]}

Arguments

ArgumentDescriptionDefaultExample
contentOne or more content ID. When this parameter is set, the loop returns the categories related to the specified content IDs.content="3"
currentA boolean value which allows either to exclude current category from results either to match only this categorycurrent="yes"
excludeA single or a list of category ids.exclude="2", exclude="1,4,7"
exclude_parentA single or list of categories id to exclude.exclude_parent="12,22"
exclude_productA single or list product id to exclude.exclude_product="3"
idA single or a list of category ids.id="2", id="1,4,7"
langA lang idlang="1"
need_count_childA boolean. If set to true, count how many subcategories contains the current categoryfalseneed_count_child="yes"
need_product_countA boolean. If set to true, count how many products contains the current categoryfalseneed_product_count="yes"
not_empty(not implemented yet) A boolean value. If true, only the categories which contains at least a visible product (either directly or through a subcategory) are returnednonot_empty="yes"
orderA list of values
Expected values
manualorder="random"
parentA single or a list of category ids.parent="3", parent="2,5,8"
productA single or list of product IDs.product="3"
return_urlA boolean value which allows the urls generation.yesreturn_url="no"
visibleA boolean value.yesvisible="no"
with_prev_next_infoA boolean. If set to true, $PREVIOUS and $NEXT output arguments are available.falsewith_prev_next_info="yes"

Plus the global arguments and search arguments

Outputs

VariableValue
$IDthe category id
$TITLEthe category title
$CHAPOthe category chapo
$CREATE_DATEthe category create date
$DESCRIPTIONthe category description
$IS_TRANSLATEDcheck if the category is translated or not
$LOCALEthe locale used for this loop
$META_DESCRIPTIONthe category meta description
$META_KEYWORDthe category meta keyword
$META_TITLEthe category meta title
$PARENTthe parent category
$POSITIONthe category position
$POSTSCRIPTUMthe category postscriptum
$TEMPLATEthe template id associated to this category
$UPDATE_DATEthe category update date
$URLthe category URL
$VERSIONthe category version
$VERSION_AUTHORthe category version author
$VERSION_DATEthe category version date
$VISIBLEReturn if the category is visible or not
$PRODUCT_COUNTNumber of visible products contained by the current category.
Only available if "need_product_child" is set to true
$CHILD_COUNTNumber of subcategories contained by the current category.
Only available if "need_count_child" is set to true
$HAS_NEXTtrue if a category exists after this one in the current parent category, following categories positions.
Only available if "with_prev_next_info" is set to true
$NEXTThe ID of category after this one in the current parent category, following categories positions, or null if none exists.
Only available if "with_prev_next_info" is set to true
$HAS_PREVIOUStrue if a category exists before this one in the current parent category, following categories positions.
Only available if "with_prev_next_info" is set to true
$PREVIOUSThe ID of category before this one in the current parent category, following categories positions, or null if none exists.
Only available if "with_prev_next_info" is set to true

Plus the global outputs

Order possible values

Arguments

Ascending valueDescending valueSorted fields
alphaalpha_reversetitle
createdcreated_reversedate of content creation
idid_reverseOrder ID
manualmanual_reverseposition
random
updatedupdated_reversedate of content update
visiblevisible_reverseonline items