Input Data is dynamic data provided according to the page and user environment. They are used to build the parts common to all pages, which do not contain the same data depending on the environment.
Sitemap This section contains all the data describing the site map, up to a depth of 3 pages.
These include page labels, the path to the current page (thanks to the sitemap:in-path attribute) and all the data needed to link to another page in the sitemap, up to 3 levels deep.
Oops! Copy to clipboard failed. Open the code and copy it manually.<inputData>
<sitemap sitemap:site="www" sitemap:lang="fr">
<page sitemap:id="page://..." sitemap:name="index" sitemap:title="Accueil" sitemap:long-title="Accueil" sitemap:path="index" sitemap:type="CONTAINER" sitemap:container="true" sitemap:in-path="true" sitemap:current="true" site="www" sitemap="fr"/>
<page sitemap:id="page://..." sitemap:name="rubrique-1" sitemap:title="Rubrique 1" sitemap:long-title="Rubrique 1" sitemap:path="rubrique-1" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr" PLUGIN_TAGS_SECTION="empty">
<page sitemap:id="page://..." sitemap:name="sous-rubrique-1" sitemap:title="Sous rubrique 1" sitemap:long-title="Sous rubrique 1" sitemap:path="rubrique-1/sous-rubrique-1" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr" PLUGIN_TAGS_SUBSECTION="empty">
<page sitemap:id="page://..." sitemap:name="sous-sous-rubrique-1" sitemap:title="Sous sous rubrique 1" sitemap:long-title="Sous sous rubrique 1" sitemap:path="rubrique-1/sous-rubrique-1/sous-sous-rubrique-1" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr"/>
<page sitemap:id="page://..." sitemap:name="sous-sous-rubrique-2" sitemap:title="Sous sous rubrique 2" sitemap:long-title="Sous sous rubrique 2" sitemap:path="rubrique-1/sous-rubrique-1/sous-sous-rubrique-2" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr"/>
</page>
<page sitemap:id="page://..." sitemap:name="sous-rubrique-2" sitemap:title="Sous rubrique 2" sitemap:long-title="Sous rubrique 2" sitemap:path="rubrique-1/sous-rubrique-2" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr" PLUGIN_TAGS_SUBSECTION="empty"/>
</page>
</sitemap>
</inputData> <inputData>
<sitemap sitemap:site="www" sitemap:lang="fr">
<page sitemap:id="page://..." sitemap:name="index" sitemap:title="Accueil" sitemap:long-title="Accueil" sitemap:path="index" sitemap:type="CONTAINER" sitemap:container="true" sitemap:in-path="true" sitemap:current="true" site="www" sitemap="fr"/>
<page sitemap:id="page://..." sitemap:name="rubrique-1" sitemap:title="Rubrique 1" sitemap:long-title="Rubrique 1" sitemap:path="rubrique-1" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr" PLUGIN_TAGS_SECTION="empty">
<page sitemap:id="page://..." sitemap:name="sous-rubrique-1" sitemap:title="Sous rubrique 1" sitemap:long-title="Sous rubrique 1" sitemap:path="rubrique-1/sous-rubrique-1" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr" PLUGIN_TAGS_SUBSECTION="empty">
<page sitemap:id="page://..." sitemap:name="sous-sous-rubrique-1" sitemap:title="Sous sous rubrique 1" sitemap:long-title="Sous sous rubrique 1" sitemap:path="rubrique-1/sous-rubrique-1/sous-sous-rubrique-1" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr"/>
<page sitemap:id="page://..." sitemap:name="sous-sous-rubrique-2" sitemap:title="Sous sous rubrique 2" sitemap:long-title="Sous sous rubrique 2" sitemap:path="rubrique-1/sous-rubrique-1/sous-sous-rubrique-2" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr"/>
</page>
<page sitemap:id="page://..." sitemap:name="sous-rubrique-2" sitemap:title="Sous rubrique 2" sitemap:long-title="Sous rubrique 2" sitemap:path="rubrique-1/sous-rubrique-2" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr" PLUGIN_TAGS_SUBSECTION="empty"/>
</page>
</sitemap>
</inputData> Voir le code
<inputData>
<sitemap sitemap:site="www" sitemap:lang="fr">
<page sitemap:id="page://..." sitemap:name="index" sitemap:title="Accueil" sitemap:long-title="Accueil" sitemap:path="index" sitemap:type="CONTAINER" sitemap:container="true" sitemap:in-path="true" sitemap:current="true" site="www" sitemap="fr"/>
<page sitemap:id="page://..." sitemap:name="rubrique-1" sitemap:title="Rubrique 1" sitemap:long-title="Rubrique 1" sitemap:path="rubrique-1" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr" PLUGIN_TAGS_SECTION="empty">
<page sitemap:id="page://..." sitemap:name="sous-rubrique-1" sitemap:title="Sous rubrique 1" sitemap:long-title="Sous rubrique 1" sitemap:path="rubrique-1/sous-rubrique-1" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr" PLUGIN_TAGS_SUBSECTION="empty">
<page sitemap:id="page://..." sitemap:name="sous-sous-rubrique-1" sitemap:title="Sous sous rubrique 1" sitemap:long-title="Sous sous rubrique 1" sitemap:path="rubrique-1/sous-rubrique-1/sous-sous-rubrique-1" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr"/>
<page sitemap:id="page://..." sitemap:name="sous-sous-rubrique-2" sitemap:title="Sous sous rubrique 2" sitemap:long-title="Sous sous rubrique 2" sitemap:path="rubrique-1/sous-rubrique-1/sous-sous-rubrique-2" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr"/>
</page>
<page sitemap:id="page://..." sitemap:name="sous-rubrique-2" sitemap:title="Sous rubrique 2" sitemap:long-title="Sous rubrique 2" sitemap:path="rubrique-1/sous-rubrique-2" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr" PLUGIN_TAGS_SUBSECTION="empty"/>
</page>
</sitemap>
</inputData> Sur chaque élément <page> on retrouve les attributs XML suivants :
sitemap:id Page identifier sitemap:name Page name sitemap:title Page title sitemap:long-title Long page title sitemap:path Url of the page in the sitemap sitemap:type
Page type:
CONTAINER (page with content zones and/or services) LINK (redirect page) NODE (empty page)
sitemap:in-path Present and equal to "true" is a parent page of the current page or the current page sitemap:current Present and equal to "true" if the page is the current page (currently displayed) sitemap:container Present and equal to "true" if the page is a CONTAINER page. sitemap:link Url of the redirection page.Present only if the page is of type LINK sitemap:link-type
Type of redirection:
WEB: redirect to an external web page PAGE: redirect to a CMS
Only present if the page is of LINK type
sitemap:restricted Present and equal to "true" if the page is a restricted-access page sitemap:invisible Present and equal to "true" if the page is invisible in navigation elements.(From version v3.8.1 only)
This data is used to build menus, breadcrumbs, etc.
XML
Oops! Copy to clipboard failed. Open the code and copy it manually.<inputData>
<sitemap xmlns:sitemap="http://www.ametys.org/inputdata/3.0" sitemap:site="www" sitemap:lang="fr">
<page sitemap:id="page://..." sitemap:name="index" sitemap:title="Accueil" sitemap:long-title="Accueil" sitemap:path="index" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr"/>
<page sitemap:id="page://..." sitemap:name="fonctionnalites-avancees" sitemap:title="Fonctionnalités clés" sitemap:long-title="Fonctionnalités clés" sitemap:path="fonctionnalites-avancees" sitemap:type="CONTAINER" sitemap:container="true" sitemap:in-path="true" sitemap:current="true" site="www" sitemap="fr"/>
...
</page>
...
</sitemap>
</inputData> <inputData>
<sitemap xmlns:sitemap="http://www.ametys.org/inputdata/3.0" sitemap:site="www" sitemap:lang="fr">
<page sitemap:id="page://..." sitemap:name="index" sitemap:title="Accueil" sitemap:long-title="Accueil" sitemap:path="index" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr"/>
<page sitemap:id="page://..." sitemap:name="fonctionnalites-avancees" sitemap:title="Fonctionnalités clés" sitemap:long-title="Fonctionnalités clés" sitemap:path="fonctionnalites-avancees" sitemap:type="CONTAINER" sitemap:container="true" sitemap:in-path="true" sitemap:current="true" site="www" sitemap="fr"/>
...
</page>
...
</sitemap>
</inputData>
<inputData>
<sitemap xmlns:sitemap="http://www.ametys.org/inputdata/3.0" sitemap:site="www" sitemap:lang="fr">
<page sitemap:id="page://..." sitemap:name="index" sitemap:title="Accueil" sitemap:long-title="Accueil" sitemap:path="index" sitemap:type="CONTAINER" sitemap:container="true" site="www" sitemap="fr"/>
<page sitemap:id="page://..." sitemap:name="fonctionnalites-avancees" sitemap:title="Fonctionnalités clés" sitemap:long-title="Fonctionnalités clés" sitemap:path="fonctionnalites-avancees" sitemap:type="CONTAINER" sitemap:container="true" sitemap:in-path="true" sitemap:current="true" site="www" sitemap="fr"/>
...
</page>
...
</sitemap>
</inputData> XSL
Oops! Copy to clipboard failed. Open the code and copy it manually.<xsl:template name="bread-crumb">
<ul>
<xsl:if test="/cms/inputData/sitemap/page[@sitemap:name = 'index']">
<li class="first">
<a href="{$site-uri-prefix}/{$lang}/index.html">
<xsl:value-of select="/cms/inputData/sitemap/page[@sitemap:name ='index']/@sitemap:title" />
</a>
</li>
</xsl:if>
<xsl:for-each select="/cms/inputData/sitemap//page[not(@sitemap:path = 'index') and @sitemap:in-path = 'true']">
<li>
<xsl:text> > </xsl:text>
<a href="{$site-uri-prefix}/{$lang}/{@sitemap:path}.html"><xsl:value-of select="@sitemap:title" /></a>
</li>
</xsl:for-each>
</ul>
</xsl:template> <xsl:template name="bread-crumb">
<ul>
<xsl:if test="/cms/inputData/sitemap/page[@sitemap:name = 'index']">
<li class="first">
<a href="{$site-uri-prefix}/{$lang}/index.html">
<xsl:value-of select="/cms/inputData/sitemap/page[@sitemap:name ='index']/@sitemap:title" />
</a>
</li>
</xsl:if>
<xsl:for-each select="/cms/inputData/sitemap//page[not(@sitemap:path = 'index') and @sitemap:in-path = 'true']">
<li>
<xsl:text> > </xsl:text>
<a href="{$site-uri-prefix}/{$lang}/{@sitemap:path}.html"><xsl:value-of select="@sitemap:title" /></a>
</li>
</xsl:for-each>
</ul>
</xsl:template> Voir le code
<xsl:template name="bread-crumb">
<ul>
<xsl:if test="/cms/inputData/sitemap/page[@sitemap:name = 'index']">
<li class="first">
<a href="{$site-uri-prefix}/{$lang}/index.html">
<xsl:value-of select="/cms/inputData/sitemap/page[@sitemap:name ='index']/@sitemap:title" />
</a>
</li>
</xsl:if>
<xsl:for-each select="/cms/inputData/sitemap//page[not(@sitemap:path = 'index') and @sitemap:in-path = 'true']">
<li>
<xsl:text> > </xsl:text>
<a href="{$site-uri-prefix}/{$lang}/{@sitemap:path}.html"><xsl:value-of select="@sitemap:title" /></a>
</li>
</xsl:for-each>
</ul>
</xsl:template> Configuration
As of version 4.2, it is possible to configure SitemapInputData by adding the configuration file skins/[SKIN]/conf/sitemap.xml to your graphic charter.
This file allows you to override the following 2 options:
initial-depth : maximum depth from site map root. 2 by defaultdescendant-depth : max depth below current page. 1 by default.For example:
Oops! Copy to clipboard failed. Open the code and copy it manually.<?xml version="1.0" encoding="UTF-8"?>
<sitemap>
<initial-depth>3</initial-depth>
<descendant-depth>3</descendant-depth>
</sitemap> <?xml version="1.0" encoding="UTF-8"?>
<sitemap>
<initial-depth>3</initial-depth>
<descendant-depth>3</descendant-depth>
</sitemap>
<?xml version="1.0" encoding="UTF-8"?>
<sitemap>
<initial-depth>3</initial-depth>
<descendant-depth>3</descendant-depth>
</sitemap> Filters: Model and PageModel Filters defined in the cms/skins/[skinName]/templates/[templateName]/filters/default.xml can also be used to retrieve dynamic data.
Here's an example:
Oops! Copy to clipboard failed. Open the code and copy it manually.<?xml version="1.0" encoding="UTF-8"?>
<filters>
<filter id="focus" target="content">
<content-types>
<type id="org.ametys.web.default.Content.article"/>
</content-types>
<tags>
<tag key="FOCUS"/>
</tags>
<view>abstract</view>
<context type="current-site"/>
<max-result>5</max-result>
</filter>
</filters> <?xml version="1.0" encoding="UTF-8"?>
<filters>
<filter id="focus" target="content">
<content-types>
<type id="org.ametys.web.default.Content.article"/>
</content-types>
<tags>
<tag key="FOCUS"/>
</tags>
<view>abstract</view>
<context type="current-site"/>
<max-result>5</max-result>
</filter>
</filters> Voir le code
<?xml version="1.0" encoding="UTF-8"?>
<filters>
<filter id="focus" target="content">
<content-types>
<type id="org.ametys.web.default.Content.article"/>
</content-types>
<tags>
<tag key="FOCUS"/>
</tags>
<view>abstract</view>
<context type="current-site"/>
<max-result>5</max-result>
</filter>
</filters> If the target attribute is equal to content , then the filter returns the corresponding content in the Model tag. If it is equal to page , then the filter returns the corresponding pages in the PageModel tag.
The filter id is used to create its root tag in the generated XML .
The definition of a filter in default.xml is similar to that in plugin.xml (see Defining a static filter ).
The inputdata org.ametys.web.tags.inputdata.FilteredContentsInputData reads this file to generate XML of the following form:
Oops! Copy to clipboard failed. Open the code and copy it manually.<inputData>
<Model>
<focus>
<content name="" id="defaultContent://">
<html>
<head><!-- Here head of the content --></head>
<body>
<!-- Here HTML view of the content -->
</body>
</html>
</content>
<content name="" id="defaultContent://">
<html>
<head><!-- Here head of the content --> </head>
<body>
<!-- Here HTML view of the content -->
</body>
</html>
</content>
</focus>
</Model>
</inputData> <inputData>
<Model>
<focus>
<content name="" id="defaultContent://">
<html>
<head><!-- Here head of the content --></head>
<body>
<!-- Here HTML view of the content -->
</body>
</html>
</content>
<content name="" id="defaultContent://">
<html>
<head><!-- Here head of the content --> </head>
<body>
<!-- Here HTML view of the content -->
</body>
</html>
</content>
</focus>
</Model>
</inputData> Voir le code
<inputData>
<Model>
<focus>
<content name="" id="defaultContent://">
<html>
<head><!-- Here head of the content --></head>
<body>
<!-- Here HTML view of the content -->
</body>
</html>
</content>
<content name="" id="defaultContent://">
<html>
<head><!-- Here head of the content --> </head>
<body>
<!-- Here HTML view of the content -->
</body>
</html>
</content>
</focus>
</Model>
</inputData> Example of use This is useful for displaying a list of links to pages labelled"Direct access ":
XML
Oops! Copy to clipboard failed. Open the code and copy it manually.<?xml version="1.0" encoding="UTF-8"?>
<filters>
<filter id="acces-directs" target="page">
<context type="current-site" lang="current" />
<tags>
<tag key="DIRECTACCESS" />
</tags>
<max-result>10</max-result>
</filter>
</filters> <?xml version="1.0" encoding="UTF-8"?>
<filters>
<filter id="acces-directs" target="page">
<context type="current-site" lang="current" />
<tags>
<tag key="DIRECTACCESS" />
</tags>
<max-result>10</max-result>
</filter>
</filters>
<?xml version="1.0" encoding="UTF-8"?>
<filters>
<filter id="acces-directs" target="page">
<context type="current-site" lang="current" />
<tags>
<tag key="DIRECTACCESS" />
</tags>
<max-result>10</max-result>
</filter>
</filters> XSL
Oops! Copy to clipboard failed. Open the code and copy it manually.<ul>
<xsl:for-each select="/cms/inputData/PageModel/acces-directs/page">
<li>
<a href="{$site-uri-prefix}/{$lang}/{@path}.html>
<xsl:value-of select="@title" />
</a>
</li>
</xsl:for-each>
</ul> <ul>
<xsl:for-each select="/cms/inputData/PageModel/acces-directs/page">
<li>
<a href="{$site-uri-prefix}/{$lang}/{@path}.html>
<xsl:value-of select="@title" />
</a>
</li>
</xsl:for-each>
</ul>
<ul>
<xsl:for-each select="/cms/inputData/PageModel/acces-directs/page">
<li>
<a href="{$site-uri-prefix}/{$lang}/{@path}.html>
<xsl:value-of select="@title" />
</a>
</li>
</xsl:for-each>
</ul> Customized input data Custom Input Data can be added. For example, Input Data can be used to provide information on user preferences.