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

EKM Tag: [ekm:productattributes]

This tag is used to output all or a selection of custom product attributes on a page.

This tag requires the product attributes feature to be installed before it will work.

  • Tag Information
  • Nesting This Tag
Basic Use
In its basic use the product attributes tag will output all product attributes associcated with a product when placed on a product page.

[ekm:productattributes][/ekm:productattributes]
								
This would output something like...

Brand : ASOS

Colour : Blue

Advanced Use
The advanced use of this tag allows you to select the product attributes that output on a page using their key as well as adding custom HTML to the output.

[ekm:productattributes]
	key='BRAND,COLOUR';
	productid='auto';
	output_start='<div>';
	output_item='<strong>[name]:</strong> <em>[value]</em>';
	output_end='</div>';
[/ekm:productattributes]
								
This would output something like...
Tag Attributes
Output All Attributes
output_all_attributes='yes';

Specify whether or not to output default product attributes as part of this tag. This includes product weight, condition, etc.

Key
key='BRAND,COLOUR';

Specify either a single attribute key or multiple keys separated by a comma (no space). The tag will then only output the product attributes for the given keys. Keys can be found in the variants section of a product.

Product ID
productid='auto';

Specify the ID of a product you'd like to output product attributes for. When on a product page you can use the value auto which will pull product attributes for the current product.

Output Start
output_start='<div id="product-attributes">';

Define any HTML you wish to be output before the product attributes. This will only output if there are attributes to output.

Value
Description
{user defined}
Define any opening HTML or Titles to go before the product attributes.
Output Item
output_item='<strong>[name]:</strong> <em>[value]</em>';

Define any HTML you want to output for each product attribute.

Value
Description
[name]
Outputs the name of the product attribute.
[value]
Outputs the value of the product attribute.
Output End
output_end='</div>';

Define any HTML you wish to be output after all product attributes have been output.

Value
Description
{user defined}
Define any closing HTML to be displayed after all product attributes are output.
Value Only
value_only='no';

Specify whether or not you want the attribute value outputting with no surrounding HTML.

Value
Description
yes
Will output only the attribute value.
no
Will output the value and surrounding HTML.

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

Nesting This Tag

When nesting this tag you should prefix the [ekm:productattributes] tag with nested_ in order for it to work.


[ekm:showdata]
   data='products';
   location='auto';
   output_item='[ekm:nested_productattributes]productid="[id]";[/ekm:nested_productattributes]';
[/ekm:showdata]