Tags

Tags

In Ametys v3, the tags are hierarchical that means they can be classified in categories and sub categories. So they are presented in a tree.

The categories can not be affected to a page or a content, only the tags can be.

Tags providers

A tag provider is a provider of tags . There is differents providers :

- the skin provides the tags relatives to the navigation (section, footer, direct access, ....)

- the content types provides the tags relative to the content (news, focus, article, ...)

- ...

Static tags provider

This is a particular provider which is defined in plugin.xml as an extension point. To defined such a provider do this way :

 <extension point="org.ametys.web.tags.TagProviderExtensionPoint"
            id="org.ametys.modules.tags.SampleTagProvider"
            class="org.ametys.web.tags.StaticTagProvider">
       <label i18n="false">Statiques</label>
       <description i18n="false">Ceci est une exemple de provider statique pouvant être défini dans une fichier 'plugin.xml'.</description>
       <category id="MA_CATEGORY_1">
            <label i18n="false">Ma catégorie 1</label>
            <description i18n="false">Description de ma catégorie</description>
            <tag id="TAG_1" target="CONTENT">
                 <label i18n="false">Tag 1</label>
           	 <description i18n="false">Description du tag 1</description>
            </tag>
           <tag id="TAG_2" target="CONTENT">
                 <label i18n="false">Tag 2</label>
           	 <description i18n="false">Description du tag 2</description>
           </tag>
           <category id="SOUS_CATEGORY">
                 <label i18n="false">Une sous catégorie</label>
                 <description i18n="false">Description de la sous catégorie</description>
                 <tag id="TAG_11" target="CONTENT">
                       <label i18n="false">Tag 1.1</label>
           	        <description i18n="false">Description du tag 1.1</description>
                 </tag>
           </category>
       </category>
       <category id="MA_CATEGORY_2">
           <label i18n="false">Ma catégorie 2</label>
           <description i18n="false">Description de ma catégorie</description>
           <tag id="TAG_22" target="PAGE">
                <label i18n="false">Tag 2</label>
           	<description i18n="false">Description du tag 2</description>
           </tag>
       </category>
 </extension>

Skin tags provider

This is about the tags needed by the skin such as the tags relative to the navigation, to the css styles, ...

Those tags are defined in the skins/[skinName]/tags/tag.xml file.

To be used, this provider must be declared in plugin.xml. The plugin web do this, you do not have to declare it by yourself

 <feature name="tagprovider.skin">
    	 <extensions>
    	 	<extension point="org.ametys.web.tags.TagProviderExtensionPoint"
                       id="org.ametys.web.tags.SkinTagProvider"
                       class="org.ametys.web.tags.SkinTagProvider">
            	<label i18n="true">PLUGINS_WEB_TAGPROVIDER_SKIN_LABEL</label>
            	<description i18n="true">PLUGINS_WEB_TAGPROVIDER_SKIN_DESCRIPTION</description>
            	<!-- TODO icon -->
            </extension>
    	 </extensions>
 </feature>

JCR Tags provider

This is the provider which allow CMS contributors to create their own categories and tags. This provider can be used to make a thesaurus for example.

This provide is declared in plugin web:

 <feature name="tagprovider.repository">
    	 <extensions>
    	 	<extension point="org.ametys.web.tags.TagProviderExtensionPoint"
                       id="org.ametys.web.tags.jcr.JCRTagProvider"
                       class="org.ametys.web.tags.jcr.JCRTagProvider">
            	<label i18n="true">PLUGINS_WEB_TAGPROVIDER_JCR_LABEL</label>
            	<description i18n="true">PLUGINS_WEB_TAGPROVIDER_JCR_DESCRIPTION</description>
            </extension>
    	 </extensions>
 </feature>

The tags and categories of this tags are editable directly in CMS HMI :