Start page
Start page

Start page / Advanced topics / Media galleries

Media galleries

Images from the media store can be output in a FirstSpirit gallery view. The following describes a recommended possible output method.

Two display options are possible:

Individual galleries:
By default, a gallery is composed of

  • an entry page: this page shows general information about the gallery such as the name and description as well as one or more teaser pictures, which are usually thumbnail versions of images in the gallery. The gallery can be used in the center of the main section of the page or it can be in teaser columns as an addition to other information on the page, for instance. The gallery name, description and teaser pictures are linked and refer to (no. 1 in the figure)
  • a gallery page: this page contains the actual gallery. Users can browse gallery images on this page (no. 2 in the figure)—usually at a higher resolution.

Gallery overviews:
These are several galleries that are present in a project and can be filtered by category for output (e.g. product categories) by defining queries.

Technical architecture / concept

Images that are to be used in the galleries must first be present in the media store (just like all other media).

To use media multiple times (in more than one gallery) with different attributes (image name, descriptive text, etc.), the database function is used for the model shown here: media are saved in one database table, while the gallery or galleries are saved in another. For this purpose, a medium in the media table is always only a reference to the particular object in the media store. Deleting a medium from the gallery table does not delete the associated medium from the media store.

  • Gallery table: The media is assigned to individual galleries and general information about the galleries is managed in this table. By default, the editorial maintenance of the gallery is performed in the data source based on this table.
  • Media table: Information on the media to be displayed in the gallery is managed in this table.

Important Alternatively, galleries (FS_LIST with MEDIAMODE tag) can be populated with images by using the Access API (MediaFormsProducer interface).

As per the model shown here, media (data records) of a gallery should be removed if the gallery itself is removed. An aggregation between the gallery and media tables is used for this purpose.

To maintain the gallery (e.g. select images that belong to a gallery), the FS_LIST input component in MEDIAMODE is required; an FS_REFERENCE input component for selecting the desired images from the media store is also required.

To output the images in the order specified by the editor, it may be necessary in some cases to save the order. A separate column must be available in the gallery table for this.

A category table may be created as an option. It can be used to categorize the galleries.

Also refer to the database schema.

Release

To release newly created or edited galleries as well as associated media and descriptive text from the media table, the related workflow needs to be expanded to include a relevant script for dependent release.

//!Beanshell
import de.espirit.firstspirit.access.MediaDependentContentUtil;

// Release Entities {@link de.espirit.or.schema.Entity} with referenced
// Media {@link de.espirit.firstspirit.access.store.mediastore.Media} recursive.

MediaDependentContentUtil.release(context, "Release: media dependent content.");
context.doTransition("finalise")

Example

Examples of media galleries are in the

sample projects.

The following descriptions of media galleries are based on the FS_LIST sample project.

© 2005 - 2015 e-Spirit AG | All rights reserved. | Last change: 2014-02-10