Template Tags
Last updated
Was this helpful?
Last updated
Was this helpful?
Advanced Categories has been deprecated and is no longer for sale or supported. ExpressionEngine 7.4 introduces many of Advanced Categories features as natively to ExpressionEngine.
Advanced Categories is a fieldtype, and as such it works just like any other fieldtype in ExpressionEngine. The following examples assume you created a custom field with the label of "My Category Field", and the field template short name is {my_category_field}
Every Advanced Categories field is a tag pair, and even though it is a field, the tag pair functions almost exactly the same as the {categories}{/categories}
tag pair from the {exp:channel:entries}
tag ().
This tag pair does not have support for the show
or show_group
parameters
Since it is also a fieldtype you have access to several tag modifiers:
{my_category_field:ids}
This will list all the IDs of the categories chosen in the field separated by pipe. For example: 1|2|3
. If only a single category is selected, then its output would be that category ID.
{my_category_field:url_titles}
This will list all the IDs of the categories chosen in the field separated by pipe. For example: alpha|beta|charlie
. If only a single category is selected, then its output would be that category ID.
{my_category_field:category_names}
This will list all the IDs of the categories chosen in the field separated by pipe. For example: Alpha|Beta|Charlie
. If only a single category is selected, then its output would be that category ID.
All tag modifiers above support the separator=","
parameter where you can change the pipe separator to another character of your choice. For example{my_category_field:ids separator=","}
will output 1,2,3
If you wanted to see if an entry is assigned to a category you can use a simple conditional: