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 :

  • a unique identifier,
  • an (internationalized) label,
  • an (internationalized) description,
  • a scope (target attribute): "PAGE" for a page label or "CONTENT" for a content label
  • visibility: the private attribute makes the label private. Private labels can only be assigned by "super" users with the appropriate rights.

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>  
        </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>  
    </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>  

The example above defines 8 layout labels. All defined labels are page labels.
The "Special pages" label is a "super" label with 5 sub-labels (Hidden page, Search page, ...).

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