Start page
Start page

Start page / Advanced topics / Media galleries / Table templates

Chapter “Output and navigation” >>

<< Chapter “Database schema”

Creating the required table templates

The required table templates need to be created under the database schema with input components for the table columns created in the database schema.

Gallery table

This table (“Gallery”) is where the input components are defined for maintaining the gallery information, e.g.

  • FS_LIST: Selection of media from the media table (“tt_medialist” identifier in the example).
    • For this purpose, the MEDIAMODE tag must be entered. This tag is used to manage the object selection via the “Add” icon of the input component.
    • The unique name of the media table template must be entered for the table attribute.
    • The unique identifier of the media table FS_REFERENCE input component must be entered for the mediaEditor attribute (see below).
  • CMS_INPUT_TEXT and CMS_INPUT_TEXTAREA (optional): Entry of the names and descriptions related to the galleries (“tt_gallery_name” and “tt_gallery_description” identifiers)
  • FS_REFERENCE (optional): Selection of teaser pictures (“tt_teaser” identifier)
  • CMS_INPUT_COMBOBOX (optional): Creation of links to the category table (“tt_gallery_category” identifier); populating from the category table is possible using CMS_INCLUDE_OPTIONS.

Media table

This table (“Gallery_Media”) is where the input components are defined for maintaining the media for a gallery, e.g.

  • FS_REFERENCE: Selection of media from the media store (“tt_media” identifier in the example)
  • CMS_INPUT_TEXTAREA (optional): Entry of the descriptions related to the media (“tt_gallery_media_description” identifier in the example)

Category table (optional)

This table (“Gallery_Category”) is where the input components are defined for entering categories, e.g.

  • CMS_INPUT_TEXT: Entry of category names (“tt_gallery_media_description” identifier in the example)

Output

The output is handled using a content projection (refer to the section on Output and navigation for more information).

Form examples

Example: gallery table form

<CMS_MODULE>

<CMS_INPUT_TEXT name="tt_gallery_name" hFill="yes" singleLine="no" useLanguages="yes">
<LANGINFOS>
<LANGINFO lang="*" label="Gallery name" description="Set a name for the selected gallery"/>
<LANGINFO lang="DE" label="Galleriename" description="Bitte geben Sie einen Namen für die ausgewählte Galerie an"/>
</LANGINFOS>
</CMS_INPUT_TEXT>

<CMS_INPUT_COMBOBOX
name="tt_gallery_category"
editable="no"
hFill="yes"
singleLine="no"
sortOrder="ascending"
useLanguages="no">
<CMS_INCLUDE_OPTIONS type="database">
<LABELS>
<LABEL lang="*">#item.name</LABEL>
</LABELS>
<TABLE>gallery_categories</TABLE>
</CMS_INCLUDE_OPTIONS>
<LANGINFOS>
<LANGINFO lang="*" label="Category" description="Gallery category"/>
<LANGINFO lang="DE" label="Kategorie" description="Galeriekategorie"/>
</LANGINFOS>
</CMS_INPUT_COMBOBOX>

<CMS_INPUT_TEXTAREA name="tt_gallery_description" hFill="yes" useLanguages="yes">
<LANGINFOS>
<LANGINFO lang="*" label="Gallery description" description="Gallery description"/>
<LANGINFO lang="DE" label="Galeriebeschreibung" description="Galeriebeschreibung"/>
</LANGINFOS>
</CMS_INPUT_TEXTAREA>

<FS_REFERENCE name="tt_teaser" hFill="yes" imagePreview="yes" upload="yes" useLanguages="no">
<FILTER>
<HIDE type="all"/>
<ALLOW type="picture"/>
</FILTER>
<LANGINFOS>
<LANGINFO lang="*" label="Teaser picture" description="Please choose a medium"/>
<LANGINFO lang="DE" label="Teaser-Bild" description="Bitte wählen Sie ein Medium aus"/>
</LANGINFOS>
<PROJECTS>
<LOCAL name=".">
<SOURCES>
<FOLDER name="root" store="mediastore"/>
</SOURCES>
</LOCAL>
</PROJECTS>
</FS_REFERENCE>

<FS_LIST name="tt_medialist" hFill="yes" rows="7">
<DATASOURCE type="database" maxEntries="20" useLanguages="no">
<ACTIONS>
<ACTION name="ADD">
<PARAM name="add-index">FIRST</PARAM>
</ACTION>
<ACTION name="NEW">
<PARAM name="create-index">FIRST</PARAM>
</ACTION>
<ACTION name="REMOVE">
<PARAM name="show-confirm">YES</PARAM>
</ACTION>
<ACTION name="UP"/>
<ACTION name="DOWN"/>
<ACTION name="GOTO"/>
<ACTION name="EDIT"/>
</ACTIONS>
<COLUMNS>
<COLUMN show="no">#identifier</COLUMN>
<COLUMN show="yes" width="10">#released</COLUMN>
<COLUMN show="no">#fs_id</COLUMN>
<COLUMN show="yes" width="150">tt_media</COLUMN>
<COLUMN show="yes" width="420">tt_gallery_media_description</COLUMN>
</COLUMNS>
<LAYOUT>
<ADD component="stackedview" constraint="hide"/>
<ADD component="toolbar" constraint="top"/>
<ADD component="overview" constraint="left"/>
<ADD component="simpleview" constraint="right"/>
</LAYOUT>
<MEDIAMODE allowFolders="no" mediaEditor="tt_media"/>
<PERSISTENCEINDEX>order_index</PERSISTENCEINDEX>
<table>gallery_media</table>
</DATASOURCE>
<LANGINFOS>
<LANGINFO lang="*" label="Media"/>
<LANGINFO lang="DE" label="Medien"/>
</LANGINFOS>
</FS_LIST>

</CMS_MODULE>

Example: media table form

<CMS_MODULE>

<FS_REFERENCE name="tt_media" hFill="yes" imagePreview="yes" upload="yes" useLanguages="no">
<FILTER>
<HIDE type="file"/>
<ALLOW type="picture"/>
</FILTER>
<LANGINFOS>
<LANGINFO lang="*" label="Medium" description="Please choose a medium"/>
<LANGINFO lang="DE" label="Medium" description="Bitte wählen Sie ein Medium aus"/>
</LANGINFOS>
<PROJECTS>
<LOCAL name=".">
<SOURCES>
<FOLDER name="root" store="mediastore"/>
</SOURCES>
</LOCAL>
</PROJECTS>
</FS_REFERENCE>

<CMS_INPUT_TEXTAREA name="tt_gallery_media_description" hFill="yes" useLanguages="yes">
<LANGINFOS>
<LANGINFO lang="*" label="Media description" description="Media description"/>
<LANGINFO lang="DE" label="Medienbeschreibung" description="Medienbeschreibung"/>
</LANGINFOS>
</CMS_INPUT_TEXTAREA>

</CMS_MODULE>

Example: category table form

<CMS_MODULE>

<CMS_INPUT_TEXT name="tt_gallery_category" hFill="yes" singleLine="no" useLanguages="yes">
<LANGINFOS>
<LANGINFO lang="*" label="Gallery categorie" description="Insert a gallery category"/>
<LANGINFO lang="DE" label="Galeriekategorie" description="Einfügen einer Galeriekategorie"/>
</LANGINFOS>
</CMS_INPUT_TEXT>

</CMS_MODULE>

Chapter “Output and navigation” >>

<< Chapter “Database schema”

© 2005 - 2014 e-Spirit AG | All rights reserved. | Last change: 2013-07-01