Sitemap icons (v3.2.1 or later)


This feature is only available for versions 3.2.1 or later

Presentation

The icons and decorators have to give informations on the nature of the page in sitemap : main section, direct access, page of redirection, private, ...

The available icons and page decorators depend on your application. They are defined in WEB-INF/param/sitemap-icons.xml configuration file. Each skin can override the default configuration by having its own configuration file skins/[skinName]/conf/sitemap-icons.xml.

The file structure is the following :

<?xml version="1.0" encoding="UTF-8"?>
<sitemap>
	<icons>
		<!-- Here is the list of icons -->
	</icons>

	<decorators>
		<!-- Here is the list of decorators -->
	</decorators>
</sitemap>

Define the available icons and decorators for your pages

Declare a sitemap icon

You need to define :

  • the path to icons. The image dimensions must be 18px x 16 px.
  • optionals conditions on type of pages, tags, metadata or published state
<icon>
	<image plugin="pluginName">img/path/to/icon.png</image><!-- the icon path -->
	<conditions>
		<type>container</type> <!-- the type of page :  container, link or node-->
		<tags type="AND"> <!-- condition on tags : AND or OR. Default is AND -->
			<tag>TAG_KEY_1</tag> <!-- tag key -->
			<tag>TAG_KEY_2</tag>
		</tags>
		<metadata type="OR"> <!-- condition on metadata : AND or OR. Default is AND -->
			<metadata name="path/to/metadata1">value1</metadata> <!-- test if 'metadata1' is equals to 'value1' '-->
			<metadata name="path/to/metadata2"></metadata> <!--  use empty value to test if 'metadata2' exists -->
		</metadata>
		<live /> <!-- use tag live for pages online -->
        </conditions>
</icon>

In sitemap, icons are located to the left of page name. There is only one icon per page.
The first icon matching conditions is used (in the order of declaration in the file).

Sample 1 : a icon for a published main section

<icon>
	<image plugin="default-sitemap">img/icons/section_online.png</image>
	<conditions>
		<tags>
			<tag>MAIN_SECTION</tag>
		</tags>
		<live/>
        </conditions>
</icon>

Sample 2 : a icon for a published blank page

<icon>
	<image plugin="default-sitemap">img/icons/page_blank_online.png</image>
	<conditions>
		<type>node</type>
		<live/>
        </conditions>
</icon>

Declare a sitemap decorator

The declaration of a decorator is quite the same. Add a label used for the icon tooltip.

The image dimensions must be 14px x 14 px.

<decorator>
        <label i18n="true">plugin.pluginName:I18N_KEY</label> <!-- the icon tooltip -->
	<image plugin="pluginName">img/path/to/icon.png</image> <!-- the icon path -->
	<conditions>
		<type>container</type> <!-- the type of page :  container, link or node-->
		<tags type="AND"> <!-- condition on tags : AND or OR -->
			<tag>TAG_KEY_1</tag> <!-- tag key -->
			<tag>TAG_KEY_2</tag>
		</tags>
		<metadata type="OR"> <!-- condition on metadata : AND or OR -->
			<metadata name="path/to/metadata1">value1</metadata> <!-- test if 'metadata1' is equals to 'value1' '-->
			<metadata name="path/to/metadata2"></metadata> <!--  use empty value to test if 'metadata2' exists -->
		</metadata>
		<live /> <!-- use tag live for pages online -->
        </conditions>
</decorator>

In sitemap, decorators are located to the right of page name. A page can have several decorators.

Sample 1 : a decorator for a private page (limited access)

<decorator>
	<label i18n="true">plugin.default-sitemap:PLUGIN_DEFAULT_SITEMAP_DECORATOR_LIMITED_ACCESS</label>
	<image plugin="default-sitemap">img/icons/private.png</image>
	<conditions>
		<metadata type="OR">
			<metadata name="granted-users"></metadata>
			<metadata name="granted-groups"></metadata>
		</metadata>
        </conditions>
</decorator>

Sample 2 : a decorator for a page tagged as a direct access

<decorator>
	<label i18n="true">plugin.default-sitemap:PLUGIN_DEFAULT_SITEMAP_DECORATOR_DIRECT_ACCESS</label>
	<image plugin="default-sitemap">img/icons/direct_access.png</image>
	<conditions>
		<tags>
			<tag>DIRECT_ACCESS</tag>
		</tags>
        </conditions>
</decorator>

Example in the CMS

Back to top