Categories

Categories of articles can be created with the Ionize menu Content > Categories or, when editing one article, in the Options > Attributes > Categories panel, by clicking on Add one category.

Display all categories : <ion:categories />

By using the <ion:categories /> tag outside any parent <ion:page /> tag, it will iterate through all used categories of the website.

<ion:categories tag="ul" active_class="my-active-class">
<li>
<a <ion:category:is_active> class="<ion:category:active_class />" </ion:category:is_active> href="<ion:category:url />">
<ion:category:title /> : <ion:category:nb_articles /> articles
</a>
</li>
</ion:categories>

Display categories linked to articles of the current page

Purpose : Build on categories menu which links to the category filtering URL, but in the context of the current page.

<ion:page:categories tag="ul" active_class="my-active-class">
<li>
<a <ion:category:is_active> class="<ion:category:active_class />" </ion:category:is_active> href="<ion:category:url />">
<ion:category:title />
</a>
</li>
</ion:page:categories>

Display categories linked to one article : <ion:categories:list />

For each articles, display the categories list with one link to the category URL.

<ion:page:articles>
<ion:article>
<ion:categories:list link="true" separator=", " />
</ion:article>
</ion:page:articles>

OK, but I want to display the list of categories names (their code), instead of the titles !
Easy :

<ion:page:articles>
<ion:article>
<ion:categories:list key="name" separator=" " />
</ion:article>
</ion:page:articles>

Children tags

TagDescriptionExample
<ion:list/> Returns the current linked categories in list.
<ion:page:articles>
    Categories of this article, displayed in list :
    <ion:article:categories:list link="true" separator=" &bull; "/>
</ion:page:articles>
<ion:count/> Returns the number of categories
<ion:page:articles>
    Number of categories this article is linked to : 
<ion:article:categories:count />

</ion:page:articles>

Number of website's used categories :
<ion:categories:count />

Number of categories used by the current page :
<ion:page:categories:count />

categoryTop of Page

Tag : <ion:category />

Displays data from one category.

Used inside one <ion:categories /> parent tag or standalone to get the current browsed category.

Display the current category

<ion:category:current:title expression="!=''">
    <ion:category:current:title/>
</ion:category:current:title>

Children tags

TagDescriptionExample
<ion:title /> Returns the category title
<ion:category:title />
<ion:nb_articles /> Returns the number of articles linked to this category.
The returned value depends on the context of usage of the tag.
<ion:category:nb_articles />
<ion:is_active /> Displays the content between the open and closing tag if the current category is currently been displayed.
<ion:category:is_active> 
<ion:category:active_class />
</ion:category:is_active>
<ion:active_class/> Returns "active" by default.

<ion:url /> URL to the category.
This is a link to the special URL which displays categories.
This URL is build depending of the context of the category.
<ion:current Get the current category if the URL is one category filtering URL