Tags API

by Justin Bodeutsch | Last edited: 5/26/2011

Parameters

display

Either cloud or select. Cloud simply outputs a list of links with classes based on the frequency of use. Select will output the tags in a select dropdown.

Example:

"display:cloud",

delimiter

If display:cloud, will specify which characters will separate the links. Default is a single space.

Example:

"delimiter:, ",

selectextra

If display:select, this will be added to the open select tag. The name and id are both specified as 'tag_select'. This parameter can be used to specify a class, disable the form or add javascript.

Example:

"selectextra:class="tags"",

styles

If set to 'yes' the some basic default styles will be output before the cloud div to size the different tags.

Example:

"styles:yes",id

Sets the id for the cloud div. Default is "cloud"

Example:

"id:tag_cloud",

find_module

Will limit tag results to a single module. hide_module will be ignored. Available modules are:

  • articles
  • sermons
  • media
  • products
  • skus
  • songs
  • blogs
  • books
  • pages

Example:

"find_module:sermons",

hide_module

A comma separated list of modules to not include in the tag cloud.

Example:

"hide_module:media,books",

link

Sets where the tags will link to. Default will send lead to the generic search results page. If using find_module, the detaul is "module-about-tag". So if an article tag 'staff' would leat to "articles-about-staff".

Use __tag__ to specify where the tag will be placed.

Examples:

"link:/content-about-__tag__/",

"link:/articles-on-__tag__/",

hide_tags

Will prevent certain tags from appearing in the cloud.

Example:

"hide_tags:test,hello",

howmany

Limits the number of tags returned to the X most popular.

Example:

"howmany:10",

tagmin

Only shows tags that have been used X amount of times.

Example:

"tagmin:3",

find_group

Only show items assigned to that group Uses group slugs.

Example:

"find_group:group-slug",

order

The tag list can either be ordered alphabetically or by popularity. Default is alphabetically. The options are:

  • popular
  • title

Example:

"order:popular",Full Examples

  getContent(
    "tags",
    "display:cloud",
    "order:popular",
    "hide_tags:test,hello",
    "find_module:articles",
    "tagmin:5",
    "id:tag_cloud",
    "styles:yes",
    "link:/article-tags/__tag__/"
  );

  getContent(
    "tags",
    "display:cloud",
    "hide_module:media,books"
  );

  getContent(
    "tags",
    "display:select",
    "selectextra:class="tags""
  );