From version 2.13 onwards, it is possible to define link themes specific to the graphic charter.
The themes are defined in the skins/[NOM_SKIN]/conf/link-directory.xml in the <definitions> as in the example below:
Oops!
Copy to clipboard failed. Open the code and copy it manually.
<link-themes>
<!-- Define the themes for this skin -->
<definitions>
<theme id="FOOTER">
<label i18n="true">SKIN_FOOTER_LINK_LABEL</label>
<description i18n="true">SKIN_FOOTER_LINK_DESC</description>
</theme>
</definitions>
</link-themes>
<link-themes>
<!-- Define the themes for this skin -->
<definitions>
<theme id="FOOTER">
<label i18n="true">SKIN_FOOTER_LINK_LABEL</label>
<description i18n="true">SKIN_FOOTER_LINK_DESC</description>
</theme>
</definitions>
</link-themes>
<link-themes>
<!-- Define the themes for this skin -->
<definitions>
<theme id="FOOTER">
<label i18n="true">SKIN_FOOTER_LINK_LABEL</label>
<description i18n="true">SKIN_FOOTER_LINK_DESC</description>
</theme>
</definitions>
</link-themes>
InputData
The plugin link directory provides input data, enabling links for one or more themes to be inserted on all or part of the site's pages.
Activation for versions 2.13 and higher
Inputdata is activated in the graphic design, in the skins/[NOM_SKIN]/conf/link-directory.xml in the <inputdata> as in the example below:
Oops!
Copy to clipboard failed. Open the code and copy it manually.
<link-themes>
<!-- Configure the template's link directory inputdata here -->
<inputdata>
<themes templates="index" configurable="true" displayUserLinks="true">
<theme id="TOOLS" lang="en"/>
<theme id="OUTILS" lang="fr"/>
</themes>
<themes templates="page,section" configurable="false">
<theme id="FOOTER"/>
</themes>
</inputdata>
<!-- Define the themes for this skin -->
<definitions>
<theme id="FOOTER">
<label i18n="false">SKIN_FOOTER_LINK_LABEL</label>
<description i18n="true">SKIN_FOOTER_LINK_DESC</description>
</theme>
</definitions>
</link-themes>
<link-themes>
<!-- Configure the template's link directory inputdata here -->
<inputdata>
<themes templates="index" configurable="true" displayUserLinks="true">
<theme id="TOOLS" lang="en"/>
<theme id="OUTILS" lang="fr"/>
</themes>
<themes templates="page,section" configurable="false">
<theme id="FOOTER"/>
</themes>
</inputdata>
<!-- Define the themes for this skin -->
<definitions>
<theme id="FOOTER">
<label i18n="false">SKIN_FOOTER_LINK_LABEL</label>
<description i18n="true">SKIN_FOOTER_LINK_DESC</description>
</theme>
</definitions>
</link-themes>
<link-themes>
<!-- Configure the template's link directory inputdata here -->
<inputdata>
<themes templates="index" configurable="true" displayUserLinks="true">
<theme id="TOOLS" lang="en"/>
<theme id="OUTILS" lang="fr"/>
</themes>
<themes templates="page,section" configurable="false">
<theme id="FOOTER"/>
</themes>
</inputdata>
<!-- Define the themes for this skin -->
<definitions>
<theme id="FOOTER">
<label i18n="false">SKIN_FOOTER_LINK_LABEL</label>
<description i18n="true">SKIN_FOOTER_LINK_DESC</description>
</theme>
</definitions>
</link-themes>
The templates attribute contains the template(s) affected by this input data, separated by commas (* means all themes).
The configurable attribute determines whether link customization by a logged-in user is allowed (true or false).
The displayUserLinks attribute determines whether custom links can be added
The inputDataId attribute determines the identifier of the InputData to differentiate between links originating from multiple InputData responding to a single template. By default, the identifier is the empty string. Only available in version 2.12 and later.
Beacons <theme> allows you to choose which theme links will be displayed.
The id attribute corresponds to the theme identifier
The lang attribute determines the language of links selected for the given theme (optional).
The example above activates input data:
for the "index" template, input data will contain "OUTILS" links for FR links and "TOOLS" links for EN links
for "page" and "section" templates, the input data will contain links with the "FOOTER" theme. This theme is provided by the graphic charter.
Versions below 2.13
For versions below 2.13, to activate this input data and define its content, you must create a file in your graphic charter XML skins/[NOM_SKIN]/conf/link-themes.xml, which contains the link themes to be displayed for each template:
Oops!
Copy to clipboard failed. Open the code and copy it manually.
The templates attribute contains the template(s) affected by this input data, separated by commas (* means all themes).
The configurable attribute determines whether link customization by a logged-in user is allowed (true or false).
The displayUserLinks attribute determines whether custom links can be added
The inputDataId attribute determines the identifier of the InputData to differentiate between links originating from multiple InputData responding to a single template. By default, the identifier is the empty string. Only available in version 2.12 and later.
Beacons <theme> allows you to choose which links (of which theme) will be displayed.
The id attribute corresponds to the identifier given to the theme in the CMS
The lang attribute determines the language of selected links
Data XML
The input data format is as follows:
Oops!
Copy to clipboard failed. Open the code and copy it manually.
The plugin link directory provides XSLT helpers that can be used in the graphic charter. All you need to do is import the file pages/services/directory/utils/inputdata_utils.xsl of plugin is to call the templates at the desired location:
Template name
Function
Parameters
display-configure-links-btn-inputdata
Inserts a "Customize" link to configure the order in which links are displayed. The link is present only if links are configurable. Provides a javascript dialog box in which the user can select the links he wishes to see first.
maxCheckedLinks: Maximum number of links selectable by user
links-thumbnails-input-data
Displays input data links as thumbnails
moreThreshold: Maximum number of visible links by default
height: maximum thumbnail width
width: maximum thumbnail width
Oops!
Copy to clipboard failed. Open the code and copy it manually.
Copy to clipboard failed. Open the code and copy it manually.
<xsl:template name="configure-links-btn">
<xsl:param name="buttonId"/>
<xsl:choose>
<xsl:when test="$rendering-context = 'front' and ametys:user()">
document.writeln("<a id=\"configure-links-hyperlink-<xsl:value-of select="$buttonId"/>-disabled\" class=\"configure-links-service-button\" title=\"<i18n:text i18n:key="SKIN_LINKDIRECTORY_CONFIGURE_THUMBNAILS_TITLE_BO" i18n:catalogue="skin.{$skin}"/>\" i18n:attr=\"title\">");
document.writeln("<img alt=\"<i18n:text i18n:key="PLUGINS_LINKDIRECTORY_CONFIGURE_THUMBNAILS" i18n:catalogue="plugin.link-directory"/>\" src=\"<xsl:value-of select="ametys:skinImageURL('img/config;png', 20, 20)\"/>");
document.writeln("</a>");
</xsl:when>
<xsl:otherwise>
<!-- NO FO user connected: the button is not displayed -->
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="configure-links-btn">
<xsl:param name="buttonId"/>
<xsl:choose>
<xsl:when test="$rendering-context = 'front' and ametys:user()">
document.writeln("<a id=\"configure-links-hyperlink-<xsl:value-of select="$buttonId"/>-disabled\" class=\"configure-links-service-button\" title=\"<i18n:text i18n:key="SKIN_LINKDIRECTORY_CONFIGURE_THUMBNAILS_TITLE_BO" i18n:catalogue="skin.{$skin}"/>\" i18n:attr=\"title\">");
document.writeln("<img alt=\"<i18n:text i18n:key="PLUGINS_LINKDIRECTORY_CONFIGURE_THUMBNAILS" i18n:catalogue="plugin.link-directory"/>\" src=\"<xsl:value-of select="ametys:skinImageURL('img/config;png', 20, 20)\"/>");
document.writeln("</a>");
</xsl:when>
<xsl:otherwise>
<!-- NO FO user connected: the button is not displayed -->
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="configure-links-btn">
<xsl:param name="buttonId"/>
<xsl:choose>
<xsl:when test="$rendering-context = 'front' and ametys:user()">
document.writeln("<a id=\"configure-links-hyperlink-<xsl:value-of select="$buttonId"/>-disabled\" class=\"configure-links-service-button\" title=\"<i18n:text i18n:key="SKIN_LINKDIRECTORY_CONFIGURE_THUMBNAILS_TITLE_BO" i18n:catalogue="skin.{$skin}"/>\" i18n:attr=\"title\">");
document.writeln("<img alt=\"<i18n:text i18n:key="PLUGINS_LINKDIRECTORY_CONFIGURE_THUMBNAILS" i18n:catalogue="plugin.link-directory"/>\" src=\"<xsl:value-of select="ametys:skinImageURL('img/config;png', 20, 20)\"/>");
document.writeln("</a>");
</xsl:when>
<xsl:otherwise>
<!-- NO FO user connected: the button is not displayed -->
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Display dynamic information on thumbnails
If your links/applications contain dynamic information that can be displayed as a tooltip, import the file pages/services/directory/utils/thumbnail_utils into your graphic charter.xsl
Puis faites appel au template XSL "link-dynamic-info-js" dans la section <head>. Par exemple :
Oops!
Copy to clipboard failed. Open the code and copy it manually.