Speak to our experts today 0333 004 0333
Speak to one of our experts today
User Guides

EKM Tag: [ekm:recordcount]

This tag is used to output an integer value for the number of products or categories on a specific page. This page, by default, is the page you are currently viewing, however you can define a specific page by ID.

This tag cannot be used to count products or categories on the homepage

  • Tag Information
  • Nesting This Tag
Basic Use
This tag will output, in plain text, the number of products within the currently category.

[ekm:recordcount]data='products';[/ekm:recordcount]
                                
This outputs the following.
16
Advanced Use
Using the tag this way will allow you to find the number of products within a specific category by using that category's ID.

[ekm:recordcount]
    data='products';
    location='12';
[/ekm:recordcount]
                                
This outputs the following.
32
Tag Attributes
Data
data='products';

This attribute is used to select the type of data you would like to count. You can use the recordcount tag to count both categories and products.

Value
Description
products
Outputs the number of products on the page
categories
Outputs the number of categories/subcategories on the page
Location
location='auto';

Select the location from which you would like to count the data.

Value
Outputs
auto
Selects your current location and counts data from that.
{user defined}
Enter the ID of a category page and the data will be counted from there.

The EKM system allows for some tags to be nested within other tags.

Nesting This Tag

When nesting this tag you need to prefix the opening tag with ekm:nested_ and all single quotes ' within the tag need to be changed to double quotes "


[ekm:showdata]
    ...
    output_item='
        [ekm:nested_recordcount]
            data="products";
            location="[id]";
        [/ekm:nested_recordcount]
    ';
    ...
[/ekm:showdata]