Definition of charter tags (xml)


The tags.xml file in the cms/skins/[skinName]/conf folder is used to define charter tags.

For more information on how to use these labels, see the Chart labels page.

The labels defined in this file appear in the Graphic Charter category of the Labels panel of CMS.

The basic structure of the tags.xml file is :

tags.xml

<?xml version="1.0" encoding="UTF-8"?>  
<tags>  
<!-- Liste des étiquettes de charte -->  
</tags>  

Labels

Each label is defined by :

  • un identifiant unique (caractères majuscules sans espace),
  • an (internationalized) label,
  • an (internationalized) description,
  • une portée (attribut target) : "PAGE" pour une étiquette de page ou "CONTENT" pour une étiquette de contenu
  • une visibilité : l'attribut private permet de privatiser l'étiquette (valurs "true" ou "false"). Les étiquettes privées ne peuvent être affectées que par des "super" utilisateurs ayant le droit adéquat
  • une priorité (à partir d'Ametys 4.8) : facultative, elle permet d'ordonner les étiquettes entre elles. La valeur par défaut est 0. Plus l'entier utilisé est élevé, plus l'étiquette apparaîtra en haut de la liste. Les entiers négatifs sont autorisés pour faire baisser la priorité d'une étiquette par rapport à la valeur par défaut.

Each label can contain sub-labels for prioritization.

Example of a tags file.xml

<?xml version="1.0" encoding="UTF-8"?>  
<tags>  
    <tag id="SPECIAL_PAGES" target="PAGE">  
        <label i18n="true">SKIN_BO_TAG_SPECIALPAGES_LABEL</label>  
        <description i18n="true">SKIN_BO_TAG_SPECIALPAGES_DESCRIPTION</description>  
         
        <tag id="FOOTER_LINKS" target="PAGE">  
            <label i18n="true">SKIN_BO_TAG_SPECIALPAGES_TAG_FOOTERLINK_LABEL</label>  
            <description i18n="true">SKIN_BO_TAG_SPECIALPAGES_TAG_FOOTERLINK_DESCRIPTION</description>  
        </tag>  
        <tag id="INVISIBLE" target="PAGE" private="true">  
            <label i18n="true">SKIN_BO_TAG_SPECIALPAGES_TAG_HIDDEN_LABEL</label>  
            <description i18n="true">SKIN_BO_TAG_SPECIALPAGES_TAG_HIDDEN_DESCRIPTION</description>  
        </tag>                         
        <tag id="SEARCH" target="PAGE" private="true">  
            <label i18n="true">SKIN_BO_TAG_SPECIALPAGES_TAG_SEARCH_LABEL</label>  
            <description i18n="true">SKIN_BO_TAG_SPECIALPAGES_TAG_SEARCH_DESCRIPTION</description>
            <priority>1</priority>  
        </tag>  
        <tag id="NEWSLETTER_MAIN" target="PAGE" private="true">  
            <label i18n="true">SKIN_BO_TAG_SPECIALPAGES_TAG_NEWSLETTER_MAIN_LABEL</label>  
            <description i18n="true">SKIN_BO_TAG_SPECIALPAGES_TAG_NEWSLETTER_MAIN_DESCRIPTION</description>  
        </tag>  
        <tag id="DIRECTACCESS" target="PAGE" private="true">  
            <label i18n="true">SKIN_BO_TAG_SPECIALPAGES_TAG_DIRECTACCESS_LABEL</label>  
            <description i18n="true">SKIN_BO_TAG_SPECIALPAGES_TAG_DIRECTACCESS_DESCRIPTION</description>  
        </tag>
        <priority>-1</priority> 
    </tag>  
    <tag id="SECTION" target="PAGE">  
        <label i18n="true">SKIN_BO_TAGS_TAG_MAINSECTION_LABEL</label>  
        <description i18n="true">SKIN_BO_TAGS_TAG_MAINSECTION_DESCRIPTION</description>  
    </tag>  
    <tag id="SUBSECTION" target="PAGE">  
        <label i18n="true">SKIN_BO_TAGS_TAG_SUBSECTION_LABEL</label>  
        <description i18n="true">SKIN_BO_TAGS_TAG_SUBSECTION_DESCRIPTION</description>  
    </tag>     
</tags>  

L'exemple ci-dessus définit 8 étiquettes de charte graphique. Toutes les étiquettes définies sont des étiquettes de page.
L'étiquette "Pages spéciales" est une "super" étiquette possédant 5 sous-étiquettes (Page cachée, Page de recherche, ...). Elle a une priorité négative pour apparaître à la fin des étiquettes de charte graphique.
L'étiquette "Page de recherche" a une priorité de 1 pour apparaître avant les autres sous-étiquettes de "Pages spéciales".

This definition uses internationalization. For more information, see the Internationalization page (i18n).

Charter heritage

From Ametys 4.3.0

Missing file

As the generic inheritance rule indicates, if the file is absent, the file from the parent charter is used.

Heritage

If the file is present it will be mixed with the parent chart file according to the following rules:

  • Balise <tag> with an existing identifier in the parent charter :
    • The label can be removed using the remove="true" attribute.
    • You can change the value of the private attribute
    • On peut remplacer les balise <label> et <description>
    • On peut ajouter des sous-étiquettes <tag> à la liste existante des sous-étiquettes.
  • Balise <tag> avec un nouvel identifiant, l'étiquette est ajoutée.
<tags> 
    <tag id="SPECIAL_PAGES" target="PAGE"> <!-- référence une étiquette existante --> 
        <!-- label/description non retouché --> 

        <tag id="FOOTER_LINKS" target="PAGE" private="true"> <!-- référence une étiquette existante mais changement de la valeur de private --> 
            <label i18n="false">Nouveau label pour footer links</label> 
            <description i18n="false">Nouvelle description pour footer links</label> 
        </tag> 

        <tag id="SEARCH" target="PAGE"> <!-- référence une étiquette existante --> 
            <tag id="SUBSEARCH" target="PAGE"> <!-- nouvelle sous-étiquette --> 
                <label>label</label> 
                <description>description</description> 
            <tag> 
        </tag> 
    </tag> 
    <tag id="SUBSECTION" target="PAGE" remove="true"/> <!-- suppression d'une étiquette héritée --> 
    <tag id="MYTAG> <!-- nouvelle étiquette racine --> 
        <label>label</label> 
        <description>description</description> 
    </tag> 
</tags> 

Blocking inheritance

By default, inheritance applies, but if the file has the attribute inherit="false", then only the local file is used.

<?xml version="1.0" encoding="UTF-8"?> 
<tags inherit="false"> 
    ... 
</tags> 
Back to top