Start page
Start page
Start page

Start page / Advanced topics / Media galleries / Output and navigation

Output and navigation

In order to output the media of a gallery in an order defined by the editor, a content projection must be created in the Site Store, i.e. a page reference based on a page from the Page Store with integrated data source. This projection contains all media, so that in general only one projection per project is required.

In the following, the different settings in the Site Store for the content projection of individual galleries and gallery overviews are explained:

Display of individual galleries

To display individual galleries, a content projection must be created with the media table.

First, on the "Data" tab of the page reference with the content projection, the data is sorted by the fs_id attribute (gallery ID), then it is sorted by the indexAttribute attribute, in which the order defined by the editor for the respective gallery is stored.

Navigation

The navigation mechanism for paging through the gallery is defined in the media table template, namely using the PageGroup function (in the HTML channel).

On paging it is necessary to ensure that navigation within a gallery is only possible via the media which actually belong to the respective gallery.

On calling the next page of the page group using the nextAvailable parameter, it is necessary to check whether the indexAttribute value of the current data record of the gallery table is smaller than the number of data sets in the gallery table. If it is smaller, the action pages to the next medium, otherwise, in the given example, it links to the gallery overview (with the page reference "REFERENCENAME_CONTENTPROJECTION").

On calling the previous page using the previousAvailable parameter, it is necessary to check whether the indexAttribute value of the current data record of the gallery table is greater than or equal to 1. If it is greater than or equal to 1, it is possible to page to the previous medium, otherwise, in the given example, the action links to the gallery overview (with the page reference "REFERENCENAME_CONTENTPROJECTION").

Example of checking the following page:

<CMS_CDATA_PARAM name="nextAvailable"><![CDATA[
$CMS_IF(#row.IDENTIFIER_GALLERYTABLE.FOREIGN_KEY_GALLERYTABLE_MEDIATABLE.size > (#row.SORTORDER_MEDIASELECTIONLIST + 1))$
<a href="$CMS_REF(#nav.ref)$">&gt;</a>
$CMS_ELSE
<a href="$CMS_REF(pageref:"REFERENCENAME_CONTENTPROJECTION")$">&gt;</a>
$CMS_END_IF$]]>
</CMS_CDATA_PARAM>

Navigation example:

<CMS_FUNCTION name="PageGroup" resultname="IDENTIFIER">
<CMS_CDATA_PARAM name="firstAvailable"><![CDATA[<a href="$CMS_REF(#nav.ref)$">|&lt;</a>&nbsp;]]></CMS_CDATA_PARAM>
<CMS_CDATA_PARAM name="firstNotAvailable"><![CDATA[|&lt;]]></CMS_CDATA_PARAM>
<CMS_CDATA_PARAM name="lastAvailable"><![CDATA[<a href="$CMS_REF(#nav.ref)$">&nbsp;&gt;|</a>]]></CMS_CDATA_PARAM>
<CMS_CDATA_PARAM name="lastNotAvailable"><![CDATA[&gt;|]]></CMS_CDATA_PARAM>

<CMS_CDATA_PARAM name="previousAvailable"><![CDATA[
$CMS_IF(#row.SORTORDER_MEDIASELECTIONLIST >= 1)$
<a href="$CMS_REF(#nav.ref)$">&lt;</a>
$CMS_ELSE
<a href="$CMS_REF(pageref:"REFERENCENAME_CONTENTPROJECTION")$">&lt;</a>
$CMS_END_IF$]]>
</CMS_CDATA_PARAM>
<CMS_CDATA_PARAM name="previousNotAvailable"><![CDATA[&lt;]]></CMS_CDATA_PARAM>

<CMS_CDATA_PARAM name="nextAvailable"><![CDATA[
$CMS_IF(#row.BEZEICHNER_GALERIETABELLE.FOREIGN_KEY_GALLERYTABLE_MEDIATABLE.size > (#row.SORTORDER_MEDIASELECTIONLIST + 1))$
<a href="$CMS_REF(#nav.ref)$">&gt;</a>
$CMS_ELSE
<a href="$CMS_REF(pageref:"REFERENCENAME_CONTENTPROJECTION")$">&gt;</a>
$CMS_END_IF$]]>
</CMS_CDATA_PARAM>
<CMS_CDATA_PARAM name="nextNotAvailable"><![CDATA[&gt;]]></CMS_CDATA_PARAM>
</CMS_FUNCTION>

Display of gallery overviews

If categories have been defined and assigned by the editor, galleries can also be output filtered by these categories.

A menu level with a content projection must be created for each category. Unlike the individual gallery, the gallery table must be used for this content projection.

A predefined query (cf. Creating a database schema) is then selected for the respective category on the "Data" tab of the page reference with the content projection.

Example of page structure with 3 categories

© 2005 - 2012 e-Spirit AG | All rights reserved. | Last change: 17.07.2009