Creating a database schema
A database schema for galleries must be created first in the Template Store with the following tables:
Gallery table
The general gallery data (for the homepage) is managed in the gallery table. Columns for storing
- the gallery name
- of a descriptive text on the gallery
- teaser images
- the media for the gallery
are feasible.
Media table
Descriptive texts on the media (for the gallery page) are managed in the media table. Columns for storing
- a medium
- a descriptive text on this medium
- an attribute, which saves the order of the selected media,
are feasible.
In addition, an aggregating 1:N relation (source: gallery table, destination: media table) must be created between the gallery and the media table.
Categories table (optional)
The categories table is used to manage category names. This requires, e.g. a column for storing
- the name of the category
.
In addition, a 1:N relation to the gallery table must be established (source: Categories table, destination: Gallery table).
Database schema example
The finished database schema for the gallery could look like this:
Categorisation using queries
In order to be able to filter galleries by categories at a later date, a query must also be created for each category, which limits the results list by category name or the category IDs from the category table.
![]() |
For further information on creating database schemata and queries, see the relevant Basics chapter, contentselect function and the FirstSpirit Manual for Developers (Basics). |