[asa2_collection]

Introduction

The shortcode [asa2_collection] gives you the ability to access the products stored in your Collections.

The supported options are documented on this page.

Basic usage

[asa2_collection tplid="16"]lego_starwars_spaceships[/asa2_collection]

Options

associate_id_set

Defines which Associate ID set to use. The Associate ID of a product’s country code will be used if it was found in the set.

Note

Option tracking_id is dominant, meaning that if you set tracking_id, this ID will be used and associate_id_set will be ignored.

[asa2_collection associate_id_set="my-i18n-ids"]lego_starwars_spaceships[/asa2_collection]

disabled

If you want to hide a collection temporarily but not to delete the whole shortcode, you can use option disabled. If it is set to 1, the shortcode will not be rendered.

[asa2_collection disabled="1" s="LEGO"]lego_starwars_spaceships[/asa2_collection]

no_cache

The no_cache option will prevent the collection result from being loaded from cache. This is useful if you want to test template updates in the frontend. In production you should use it with care.

[asa2_collection no_cache="1"]lego_starwars_spaceships[/asa2_collection]

limit

To limit the result of a collection, use the limit option. To reset the limit, set it to 0.

The following example will generate a list of 5 collection items.

[asa2_collection limit="5"]lego_starwars_spaceships[/asa2_collection]

mobile_tpl

With option mobile_tpl you can define a template which will be used on mobile devices (Smartphones). Note that option Mobile templates has to be activated before this will work.

[asa2 tpl="my_desktop_template" mobile_tpl="my_template_for_smartphones"]ASIN[/asa2]

orderby

If you want to order the collection items, use the orderby option.

Options are:

  • title (product title) (Default)

  • timestamp (when added to collection)

  • rand (random order)

  • sort_id (ordered by custom sort ID)

[asa2_collection orderby="rand" limit="5"]lego_starwars_spaceships[/asa2_collection]

order

The order direction.

Options are:

  • asc (ascending)

  • desc (descending)

Default is “asc”.

[asa2_collection orderby="title" order="desc"]lego_starwars_spaceships[/asa2_collection]

s

A search string. You can use it to filter Collections items by their title.

This example will generate a collection only including items with “LEGO” in their title:

[asa2_collection s="LEGO"]lego_starwars_spaceships[/asa2_collection]

short_url

Use the option short_url to transform the Amazon page URL into a shorter format.

[asa2_collection short_url="1"]lego_starwars_spaceships[/asa2_collection]

// results in links like: http://www.amazon.de/exec/obidos/ASIN/B0094J2BZ0/tracking-id

tpl

If you do not want to use the default tempalte to render the collection items, you can define a custom template by name using the tpl option.

[asa2_collection tpl="my_awsome_template"]lego_starwars_spaceships[/asa2_collection]

tplid

If you want to define a template by ID, use the tplid option. You can find the ID in the first column of the template table. Using the template ID allows you to change the template’s name afterwards.

[asa2_collection tplid="16"]lego_starwars_spaceships[/asa2_collection]
Templates table column ID

tracking_id

You can also set a custom Associate ID in the asa2_collection options.

[asa2_collection short_url="1" tracking_id="other-id"]lego_starwars_spaceships[/asa2_collection]

Custom Values

Additionally to the shortcode options, you can also define custom values to use as placeholders in templates.

It is very easy. Just define a unique shortcode option with a value and use the exact same option name as placeholder in a template.

[asa2 my_custom_text="Banana!"]B0094J2BZ0[/asa2]

# use placeholder {{ my_custom_text }} in your template