Custom Templates Example

Overview

This package provides a custom set of directives to make it easy to customize different gallery templates.

These directives are: *galleryItemDef, *galleryImageDef, *galleryThumbDef and *galleryBoxDef

@if (media$ | async; as config) { @if (active) { {{ item?.alt }} } @if (type === 'youtube') { } @else if(type === 'vimeo'){ } @else if (type === 'video') { } } Please consider having a look at wiki docs as well Gallery Templates and Lightbox Templates
GalleryItemDef

*galleryItemDef overrides the gallery item template, useful if you want create your own gallery template for any type from scratch.

Example:

GalleryImageDef

*galleryImageDef applies only on image items - the image will still be displayed, but this adds an custom inner template, useful to add text overlay on top of the image.

Example:

GalleryThumbDef

*galleryThumbDef applies on all thumbnails types, image will still displayed, but adds an custom inner template.

Example:

The following adds a Youtube icon on Youtube thumbnails, a Vimeo icon on Vimeo thumbnails, and video icon on video thumbnails

Passing in data to a custom template

When using one of the previous templates above, additional context data can be used to render the data as needed.

Available data:

GalleryBoxDef

*galleryBoxDef Adds a single static template on top of the gallery items.

Example:

Available data:

  • let state = state Gallery state object.
  • let config = config Gallery config object.