1. tags

    Zena has a basic tagging facility now:

    tags seizure

    Simply type a list of comma separated values in the tags field on the edit popup.

    API

    Tags can be added by defining the “tag” pseudo attribute:

    node.update_attributes(:tag => 'foo') # add "foo" to tags
    node.update_attributes(:tag_list => 'bar, foo') # define tag list
    

    pseudo sql

    You can use tags in queries. Simply use the pseudo attribute ‘tag’:

    images where tag = "family" in site

    Or (using a query parameter):

    images where tag = param:t in site

    zafu

    To list the tags:

    <r:tags><r:each join=', ' do='[name]'/></r:tags>

    To create a list of tag links (notice how the t attribute is dynamically set to the tag name) :

    <r:tags do='each' join=', ' do='link' href='root' t='[name]'/>

    If you want a pretty ajax field with delete buttons on the tags:

    <r:form update='tags' done='$("node_tag").clear()'>
      <r:input id='node_tag' name='tag'/>
    </r:form>
    <div id='tags' do='block' do='tags'>
      <span do='each' join=', '>
        <r:show attr='name'/><r:unlink/>
      </span>
    </div>

    This is just the beginning of tags. Tag cloud, improved search and other helpers will come later.

    PS: Tags are implemented as “comments” on anonymous links. This means that you can use the “l_status” information to scope tags.

    Gaspard Bucher

    comments

    1. leave a comment