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

EKM Tag: category_menu

This tag is designed for outputting top level category menus. The tag can output categories up to three levels deep and should be used instead of the ekm:showdata tag for category menus.

Conditional Tokens
  • Tag Information

The category_menu tag has been specially designed for outputting category menus up to three levels deep as quickly as possibly. It's much faster than the showdata tag and should always be used where categories need to be output.

Basic Use
In its most basic use the category_menu tag can be implemented this way to output the shops top level categories.

[ekm:category_menu]
	output_start='<ul>';
	output_item='<li>[link]</li>';
	output_end='</ul>';
[/ekm:category_menu]
								
Advanced Use
Here is an example of advanced use of the ekm:category_menu tag.

[ekm:category_menu]

	levels='3';

	location='0';
	order_by='orderlocation, name';

	edit_buttons='YES';

	limit='99';
	level_1_limit='98';
	level_2_limit='97';

	image_width='100';
	image_height='100';

	output_start='';
	output_item='';
	output_end='';

	output_level_1_start='';
	output_level_1_item='';
	output_level_1_end='';

	output_level_2_start='';
	output_level_2_item='';
	output_level_2_end='';
	exclude_list='';

[/ekm:category_menu]
								
Tag Attributes
Levels
levels='1';

Sets the number of category levels to output. Set this to 1 and the tag will output top level categories only. Set to 2 to also output child categories or 3 for child and grand child categories.

Value
Description
1
Will output the top level categories only.
2
Will output the top level categories and any first level categories.
3
Will output the top level categories, any first level categories and any second level categories.
Location

Here you can specify which category this tag treats as containing the top level categories. This is defined by either specifying a category ID (found in the address bar) or 0 which will show categories in the "home" category.

Value
Description
0
This is the predefined ID for the EKM homepage.
{user defined number}
A single category page ID hardcoded by yourself.
Order By

You can choose the order of the categories output in a category_menu tag using this attribute. It will allow you to order by name, id or orderlocation

Note: Remember if you change this from auto you will be unable to use the 'Order' controls in the front end of EKM.

Value
Description
auto
The default action for order_by is to order first by orderlocation which is set using 'Order' controls in 'View Shop' and secondly by name (if two orderlocation values are the same).
orderlocation

Orders the outputted data in the order the user has set in the front end (View Shop) of EKM using the order controls.

id

Orders the product/catgeory by it's product/catgeory ID.

name

Orders the products or categories by their [name].

You are also able to change the direction of the order for this attribute by appending DESC or ASC to the end of each value.

Example: Order by id from lowest to highest order_by='id ASC'; or to order highest to lowest use order_by='id DESC';

Edit Buttons

During the output of categories you can decide whether or not you wish to output edit buttons for each of the items.

Value
Description
YES
Edit buttons will be display categories.
NO
Edit buttons will NOT be display categories.
Limit

The limit attribute will ensure that the number of top level categories output does not exceed the value you've set.

Value
Description
{user defined number}
Define the maximum number of categories to output.
Level 1 Limit

The level_1_limit attribute will ensure that the number of level 1 categories output does not exceed the value you've set.

If not set then default to the value of limit.

Value
Description
{user defined number}
Define the maximum number of categories to output.
Level 2 Limit

The level_2_limit attribute will ensure that the number of level 2 categories output does not exceed the value you've set.

If not set then default to the value of level_1_limit.

Value
Description
{user defined number}
Define the maximum number of categories to output.
Image Width Size

The EKM shop has a powerful image resizing feature that allows you to upload high resolution images and have the system resize them to a smaller size for displaying on your online shop.

You can specify to only limit the width. This means your images can exceed whatever height you like, but will never exceed the defined width.

Example 1: You have a portrait image of your category. The image is 300 high and 150 wide. You set your image_width to 100 because you want the width to never be more than 100 pixels width. When the image system does this the height will remain unrestrained and only the width will be reduced.

Example 2: You have a landscape image of a category. The image is 150px wide with 100px high. You set your image_width to 100. The image system will now resize this image so the width is no wider than 100px but disregards the height as this can be anything.

NOTE: The image scaling system will never make an image bigger. So if you have an image width smaller than your image_width the image will remain unchanged at it's original size.

Value
Description
{user defined number}
Define the maximum width you wish your images to be. Enter 200 which will resize images to 200px wide.
Image Height Size

This works exactly like the image_width attribute however instead of reducing the width to the specified value it will reduce only the height leaving the width to be anything regardless of whether it is greater or less than the value you set.

Example 1: You have a portrait image of one of your categories, you want the height to never exceed 250 pixels, so you set the image_height to 250. Now when your image is resized the width will be ignored but the height will be forced down to 250 pixels.

NOTE: The image scaling system will never make an image bigger. So if you have an image height smaller than your image_height the image will remain unchanged at it's original size.

Value
Description
{user defined number}
Define the maximum height you wish your images to be. Enter 200 which will resize images to 200px high.
Output Start

Here you can specify what will be output at the start of the ekm:category_menu. Typically you would start to output some HTML.

Example: You would open a containing div at this point inside followed by a h1 tag for the title "Categories".

Value
Description
{user defined}
Specify your own starting HTML.
[parent_id]
Outputs the id of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_name]
Outputs the name of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_url]
Outputs the url of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_description]
Outputs the description of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_image]
Outputs the scaled category image for the parent category.
[parent_image-url]
Outputs the url of the scaled category image for the parent category.
[parent_image-width]
Outputs the width of the scaled category image for the parent category.
[parent_image-height]
Outputs the height of the scaled category image for the parent category.
[parent_active]
Outputs "active" when the parent category is the page currently being viewed by the user.
[parent_counter]
Outputs the numeric counter for the parent category.
[is_limited]
Outputs the value "is-limited" categories being output have been limited by the limit, level_1_limit or level_2_limit attributes.
Output Item

When an category is output from the category_menu it is contained within this attribute. Here you can choose what information will be output and in what order.

Value
Description
{user defined}
Specify your own item HTML and include the tags you wish to use. A full list of these tags can be seen below.

Within [ekm:tags] you would need to open and close them in the same way you would open and close HTML tags. However with attribute tags, like the ones below, they are self closing and work alone without any need to close them.

Value
Description
[link]
Outputs a link to the category with its name, status and edit buttons.
[id]
Outputs the category's ID
[name]
Outputs the category's name.
[url]
Outputs the category's relative URL.
Example: super-dry-tshirts-c-23.asp which can be used within a <a href=""> tag.
[description]
Outputs the category's full description.
[image]
Outputs the category's main image. This will be scaled as per the image_width or image_height attributes.
[image-url]
Outputs the category's main image as a URL. This can be implemented then as a background-image using CSS or within img HTML tag.
[image-width]
Outputs the category's main image width.
[image-height]
Outputs the category's main image height.
[active]
Outputs "active" when the category is the page currently being viewed by the user.
[children]
Outputs any subcategories formated using output_level_1_start, output_level_1_item, output_level_1_end, output_level_2_start, output_level_2_item and output_level_2_end.
[parent_id]
Outputs the id of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_name]
Outputs the name of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_url]
Outputs the url of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_description]
Outputs the description of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_image]
Outputs the scaled category image for the parent category.
[parent_image-url]
Outputs the url of the scaled category image for the parent category.
[parent_image-width]
Outputs the width of the scaled category image for the parent category.
[parent_image-height]
Outputs the height of the scaled category image for the parent category.
[parent_active]
Outputs "active" when the parent category is the page currently being viewed by the user.
[parent_counter]
Outputs the numeric counter for the parent category.
[is_limited]
Outputs the value "is-limited" categories being output have been limited by the limit, level_1_limit or level_2_limit attributes.
Output End

Here you will close any HTML tags that were opened within the output_start attribute.

Value
Description
[parent_id]
Outputs the id of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_name]
Outputs the name of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_url]
Outputs the url of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_description]
Outputs the description of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_image]
Outputs the scaled category image for the parent category.
[parent_image-url]
Outputs the url of the scaled category image for the parent category.
[parent_image-width]
Outputs the width of the scaled category image for the parent category.
[parent_image-height]
Outputs the height of the scaled category image for the parent category.
[parent_active]
Outputs "active" when the parent category is the page currently being viewed by the user.
[parent_counter]
Outputs the numeric counter for the parent category.
[is_limited]
Outputs the value "is-limited" categories being output have been limited by the limit, level_1_limit or level_2_limit attributes.
Output Level 1 Start

Here you can specify what will be output before an level 1 categories. Typically you would start to output some HTML.

Example: You would open a containing div at this point.

Value
Description
{user defined}
Specify your own starting HTML.
[parent_id]
Outputs the id of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_name]
Outputs the name of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_url]
Outputs the url of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_description]
Outputs the description of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_image]
Outputs the scaled category image for the parent category.
[parent_image-url]
Outputs the url of the scaled category image for the parent category.
[parent_image-width]
Outputs the width of the scaled category image for the parent category.
[parent_image-height]
Outputs the height of the scaled category image for the parent category.
[parent_active]
Outputs "active" when the parent category is the page currently being viewed by the user.
[parent_counter]
Outputs the numeric counter for the parent category.
[is_limited]
Outputs the value "is-limited" categories being output have been limited by the limit, level_1_limit or level_2_limit attributes.
Output Level 1 Item

When an level 1 category is output from the category_menu it is contained within this attribute. Here you can choose what information will be output and in what order.

Value
Description
{user defined}
Specify your own item HTML and include the tags you wish to use. A full list of these tags can be seen below.

Within [ekm:tags] you would need to open and close them in the same way you would open and close HTML tags. However with attribute tags, like the ones below, they are self closing and work alone without any need to close them.

Value
Description
[link]
Outputs a link to the category with its name, status and edit buttons.
[id]
Outputs the category's ID
[name]
Outputs the category's name.
[url]
Outputs the category's relative URL.
Example: super-dry-tshirts-c-23.asp which can be used within a <a href=""> tag.
[description]
Outputs the category's full description.
[image]
Outputs the category's main image. This will be scaled as per the image_width or image_height attributes.
[image-url]
Outputs the category's main image as a URL. This can be implemented then as a background-image using CSS or within img HTML tag.
[image-width]
Outputs the category's main image width.
[image-height]
Outputs the category's main image height.
[children]
Outputs any subcategories formated using output_level_2_start, output_level_2_item and output_level_2_end.
[active]
Outputs "active" when the category is the page currently being viewed by the user.
[parent_id]
Outputs the id of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_name]
Outputs the name of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_url]
Outputs the url of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_description]
Outputs the description of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_image]
Outputs the scaled category image for the parent category.
[parent_image-url]
Outputs the url of the scaled category image for the parent category.
[parent_image-width]
Outputs the width of the scaled category image for the parent category.
[parent_image-height]
Outputs the height of the scaled category image for the parent category.
[parent_active]
Outputs "active" when the parent category is the page currently being viewed by the user.
[parent_counter]
Outputs the numeric counter for the parent category.
[is_limited]
Outputs the value "is-limited" categories being output have been limited by the limit, level_1_limit or level_2_limit attributes.
Output Level 1 End

Here you will close any HTML tags that were opened within the output_level_1_start attribute.

Value
Description
[parent_id]
Outputs the id of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_name]
Outputs the name of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_url]
Outputs the url of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_description]
Outputs the description of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_image]
Outputs the scaled category image for the parent category.
[parent_image-url]
Outputs the url of the scaled category image for the parent category.
[parent_image-width]
Outputs the width of the scaled category image for the parent category.
[parent_image-height]
Outputs the height of the scaled category image for the parent category.
[parent_active]
Outputs "active" when the parent category is the page currently being viewed by the user.
[parent_counter]
Outputs the numeric counter for the parent category.
[is_limited]
Outputs the value "is-limited" categories being output have been limited by the limit, level_1_limit or level_2_limit attributes.
Output Level 2 Start

Here you can specify what will be output before an level 2 categories. Typically you would start to output some HTML.

Example: You would open a containing div at this point.

Value
Description
{user defined}
Specify your own starting HTML.
[parent_id]
Outputs the id of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_name]
Outputs the name of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_url]
Outputs the url of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_description]
Outputs the description of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_image]
Outputs the scaled category image for the parent category.
[parent_image-url]
Outputs the url of the scaled category image for the parent category.
[parent_image-width]
Outputs the width of the scaled category image for the parent category.
[parent_image-height]
Outputs the height of the scaled category image for the parent category.
[parent_active]
Outputs "active" when the parent category is the page currently being viewed by the user.
[parent_counter]
Outputs the numeric counter for the parent category.
[is_limited]
Outputs the value "is-limited" categories being output have been limited by the limit, level_1_limit or level_2_limit attributes.
Output Level 2 Item

When an level 2 category is output from the category_menu it is contained within this attribute. Here you can choose what information will be output and in what order.

Value
Description
{user defined}
Specify your own item HTML and include the tags you wish to use. A full list of these tags can be seen below.

Within [ekm:tags] you would need to open and close them in the same way you would open and close HTML tags. However with attribute tags, like the ones below, they are self closing and work alone without any need to close them.

Value
Description
[link]
Outputs a link to the category with its name, status and edit buttons.
[id]
Outputs the category's ID
[name]
Outputs the category's name.
[url]
Outputs the category's relative URL.
Example: super-dry-tshirts-c-23.asp which can be used within a <a href=""> tag.
[description]
Outputs the category's full description.
[image]
Outputs the category's main image. This will be scaled as per the image_width or image_height attributes.
[image-url]
Outputs the category's main image as a URL. This can be implemented then as a background-image using CSS or within img HTML tag.
[image-width]
Outputs the category's main image width.
[image-height]
Outputs the category's main image height.
[active]
Outputs "active" when the category is the page currently being viewed by the user.
[parent_id]
Outputs the id of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_name]
Outputs the name of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_url]
Outputs the url of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_description]
Outputs the description of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_image]
Outputs the scaled category image for the parent category.
[parent_image-url]
Outputs the url of the scaled category image for the parent category.
[parent_image-width]
Outputs the width of the scaled category image for the parent category.
[parent_image-height]
Outputs the height of the scaled category image for the parent category.
[parent_active]
Outputs "active" when the parent category is the page currently being viewed by the user.
[parent_counter]
Outputs the numeric counter for the parent category.
[is_limited]
Outputs the value "is-limited" categories being output have been limited by the limit, level_1_limit or level_2_limit attributes.
Output Level 2 End

Here you will close any HTML tags that were opened within the output_level_2_start attribute.

Value
Description
[parent_id]
Outputs the id of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_name]
Outputs the name of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_url]
Outputs the url of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_description]
Outputs the description of the parent category. If there is no parent category (because it is at top level) then output an empty value.
[parent_image]
Outputs the scaled category image for the parent category.
[parent_image-url]
Outputs the url of the scaled category image for the parent category.
[parent_image-width]
Outputs the width of the scaled category image for the parent category.
[parent_image-height]
Outputs the height of the scaled category image for the parent category.
[parent_active]
Outputs "active" when the parent category is the page currently being viewed by the user.
[parent_counter]
Outputs the numeric counter for the parent category.
[is_limited]
Outputs the value "is-limited" categories being output have been limited by the limit, level_1_limit or level_2_limit attributes.
Exclude List

Here you can specify the IDs of categories you wish to exclude from the output. All records will then be output, apart from the IDs listed.

Value
Description
{user defined number}
The IDs of products or categories you wish to exclude. Each is to be comma seperated.