Creating the necessary table templates
The required table templates must now be created below the database schema with the input components for the table columns created in the database schema. These are already sufficient for the media gallery function and can be output using content projections (refer to the chapter on Output and Navigation).
Gallery table
This table is used to define the input components for entering and maintaining information on the gallery, e.g.
- CMS_INPUT_CONTENTLIST: Selection of media from the media table; the unique name of the media table template must be given here for the table attribute.
- CMS_INPUT_TEXT and CMS_INPUT_TEXTAREA (optional): Input of names and descriptions of the galleries
- CMS_INPUT_PICTURE (optional): Selection of teaser images
- CMS_INPUT_COMBOBOX (optional): Establish connections with the categories table; it is possible to fill from the categories table using CMS_INCLUDE_OPTIONS.
If using the CMS_INPUT_CONTENTLIST input component, it is necessary to give the MEDIAMODE tag. This tag is used to control object selection via the "Add" icon of the input component. At the same time, the unique identifier of the CMS_INPUT_PICTURE input component of the media table must be given for the mediaEditor attribute. In addition, the indexAttribute attribute is used to store the order defined by the editor on selecting the media. |
Media table
This table is used to define the input components for entering and maintaining the media of a gallery, e.g.
- CMS_INPUT_PICTURE: Selection of media from the Media Store
- CMS_INPUT_TEXTAREA (optional): Input of descriptive texts on the media
Categories table (optional)
This table is used to define an input component for entering categories, e.g.
- CMS_INPUT_TEXT: Input of category names
For further information on the use of input components, see Input Components chapter. |
Form examples
Example: Gallery Table form
<CMS_MODULE>
<CMS_GROUP>
<CMS_INPUT_TEXT name="GALLERYNAME" allowEmpty="no" singleLine="yes" useLanguages="yes">
<LANGINFOS>
<LANGINFO lang="DE" label="Galerie-Name" description="Überschrift der Galerie"/>
<LANGINFO lang="*" label="Gallery Name" description="Set a name for the selected gallery"/>
</LANGINFOS>
</CMS_INPUT_TEXT>
<CMS_INPUT_COMBOBOX name="GALLERYCATEGORY" editable="no" useLanguages="yes">
<CMS_INCLUDE_OPTIONS type="database">
<LABELS>
<LABEL lang="DE">#item.name</LABEL>
<LABEL lang="*">#item.name</LABEL>
</LABELS>
<TABLE>CATEGORYTABLE</TABLE>
</CMS_INCLUDE_OPTIONS>
<LANGINFOS>
<LANGINFO lang="DE" label="Kategorie" description="Galerie-Kategorie"/>
<LANGINFO lang="*" label="Category" description="Gallery Category"/>
</LANGINFOS>
</CMS_INPUT_COMBOBOX>
</CMS_GROUP>
<CMS_INPUT_TEXTAREA name="GALLERYDESCRIPTION" allowEmpty="no" useLanguages="yes">
<LANGINFOS>
<LANGINFO lang="DE" label="Galeriebeschreibung" description="Galeriebeschreibung"/>
<LANGINFO lang="*" label="Gallery Description" description="Gallery Description"/>
</LANGINFOS>
</CMS_INPUT_TEXTAREA>
<CMS_INPUT_PICTURE name="TEASER" allowEmpty="no" imagePreview="yes" lean="mandatory" upload="yes" useLanguages="no">
<LANGINFOS>
<LANGINFO lang="DE" label="Teaserbild" description="Teaserbild"/>
<LANGINFO lang="*" label="Teaser" description="Teaser"/>
</LANGINFOS>
</CMS_INPUT_PICTURE>
</CMS_GROUP>
<CMS_INPUT_CONTENTLIST
name="MEDIASELECTIONLIST"
indexAttribute="SORTORDER_MEDIASELECTIONLIST"
rows="20"
table="MEDIATABLE"
useLanguages="no">
<LANGINFOS>
<LANGINFO lang="DE" label="Medien"/>
<LANGINFO lang="*" label="Media"/>
</LANGINFOS>
<MEDIAMODE allowFolders="no" mediaEditor="PICTURE_INPUTCOMPONENT_MEDIATABLE"/>
</CMS_INPUT_CONTENTLIST>
</CMS_MODULE>
Example: Media Table form
<CMS_MODULE>
<CMS_INPUT_PICTURE name="PICTURE_INPUTCOMPONENT_MEDIATABLE" allowEmpty="no" imagePreview="yes" lean="mandatory" upload="yes" useLanguages="no">
<LANGINFOS>
<LANGINFO lang="DE" label="Medium" description="Medium"/>
<LANGINFO lang="*" label="Media" description="Media"/>
</LANGINFOS>
</CMS_INPUT_PICTURE>
<CMS_INPUT_TEXTAREA name="MEDIADESCRIPTION" allowEmpty="no" useLanguages="yes">
<LANGINFOS>
<LANGINFO lang="DE" label="Medienbeschreibung" description="Medienbeschreibung"/>
<LANGINFO lang="*" label="Media Description" description="Media Description"/>
</LANGINFOS>
</CMS_INPUT_TEXTAREA>
</CMS_MODULE>
Example: Categories Table form
<CMS_MODULE>
<CMS_INPUT_TEXT name="CATEGORYTABLE" useLanguages="yes">
<LANGINFOS>
<LANGINFO lang="DE" label="Galerie-Kategorie" description="Einfügen einer Galerie-Kategorie"/>
<LANGINFO lang="*" label="Gallery category" description="Insert a gallery category"/>
</LANGINFOS>
</CMS_INPUT_TEXT>
</CMS_MODULE>