Tags

fi.aisti.tags

Enables adding tags for a content
Current version0.14
Author Aisti
Visit Aisti's site

Download now

Currently you are only able to download controls through Bildy Editor.

Description

Tag control creates a tag cloud that can be shared across different datamodels. Tags from that cloud can then be attached to a content.

You can input tags by writing a preferred word or words and then hitting enter or comma. Tags that are already in use are listed below and can be added by clicking on them.

Customizing output

<h2>Tags</h2>
<b:page.tags>
  <b:before><ul></b:before>
  <li><b:data/></li>
  <b:after></ul></b:after>
</b:page.tags>

Displaying tag cloud

<h2>Tag cloud</h2>
<b:page.tags show="cloud">
  <b:before><ul></b:before>
  <li><a href="/tags?t=<b:format.urlencode><b:data.tag/></b:format.urlencode>">
  <b:data.tag/></a></li>
  <b:after></ul></b:after>
</b:page.tags>

Displaying a tag cloud from a certain data model

This version also doesn't show a tag that isn't in use and displays the use count of a tag.

<b:get name="cloud" from="news" limit="1">
  <b:before><h3>News tags</h3></b:before>
  <b:cloud.tags show="cloud">
    <b:before><ul></b:before>
    <b:value.tagcount><b:getcount from="news" where="tags like '%\"<b:format.sqlsafe><b:data.tag/></b:format.sqlsafe>\"%'"/></b:value.tagcount>   
    <b:if condition="<b:value.tagcount/> > 0">
    	<li><a href="/tags?t=<b:format.urlencode><b:data.tag/></b:format.urlencode>"><b:data.tag/></a> (<b:value.tagcount/>)</li>
    </b:if>
    <b:after></ul></b:after>
  </b:cloud.tags>
</b:get>

Displaying pages with a given tag

<h2>News with tag '<b:env.get.t default=""/>'</h2>

<b:get name="news" from="news"
  where="tags like '%\"<b:format.sqlsafe><b:env.get.t default=\"\"/></b:format.sqlsafe>\"%'">
  <b:before><ul></b:before>
  <li><a href="<b:news.metadata.url/>"><b:news.name/></a></li>
  <b:after></ul></b:after>
  <b:nodata>No news with this tag.</b:nodata>
</b:get>

Documentation

Attributes for output tag:

delimiter

Given delimiter is used between tags in output. Defaults to single space.

raw

If set to "true", raw JSON formatted tag information is output.

url

Will create tag links with given url as prefix to the tag. If url attribute is not used, the tag list is displayed without links.

show

If set to "cloud", all the available tags are displayed instead of the actual tags in the control.