Reference Omeka S module

Template Variables

Placeholders of the form {{name}} (letters, digits, dots and underscores) in text content, image source, image fallback and the template's background image URL are replaced at render time. A placeholder whose variable is empty or unknown renders as an empty string. An image layer whose source becomes empty uses its fallback; if that is empty too the layer is skipped.

Site variables

Available for every resource type. Values come from the site identified by the site_id on the image URL.

Variable Value
site.title Site title. Without a site ID, the global installation title.
site.tagline Site summary.
site.logo_url URL of the logo asset from the site's settings, or empty.
site.url Public URL of the site.

On a site's own card (the Site resource type) there are also:

Variable Value
site.item_thumbnail_1 … site.item_thumbnail_4 Large thumbnails of the site's newest items that have an image, or empty.

Item

Variable Value
item.title Display title.
item.description First dcterms:description value.
item.creator First dcterms:creator value.
item.date First dcterms:date value.
item.type First dcterms:type value.
item.resource_class Label of the resource class, or empty.
item.kind What the item is: the resource class label, or else its dcterms:type. The presets' small label above the title uses it.
item.thumbnail_url Large thumbnail of the item's primary media, or empty.
item.media_2_url … item.media_4_url Large thumbnails of the item's other media that have one (pages of a letter, the back of a photo), in order after the primary media, or empty.

Item set

Variable Value
item_set.title Display title.
item_set.description First dcterms:description value.
item_set.item_count Number of items in the set.
item_set.thumbnail_url Large thumbnail of the first item in the set that has an image, or empty.
item_set.thumbnail_url_2 … item_set.thumbnail_url_4 The next items' images, or empty.

Media

Variable Value
media.title Display title.
media.type Friendly type derived from the MIME type: Image, PDF, Video, Audio, Text, HTML, or the capitalised MIME group (for example "Application").
media.thumbnail_url Large thumbnail of the media, or empty for a file without one (most audio, video and documents). Use this for pictures: GD can't read PDFs, audio, video or TIFF files.
media.original_url URL of the original file.
media.parent_item.title Display title of the item the media belongs to.

Site page

Variable Value
page.title Page title.
page.slug Page slug.
page.thumbnail_url The page's first image: a media or item attached to one of its blocks, or an image in an Asset block. Empty when it has none.

Search

Variable Value
search.query The search query string.
search.result_count How many items the query finds in the site.
search.result_thumbnail_1 … search.result_thumbnail_4 Large thumbnails of the first matching items that have an image, or empty.

Blog post (Blog module)

Variable Value
blog_post.title Post title.
blog_post.excerpt Post excerpt.
blog_post.author Author's user name.
blog_post.thumbnail_url The featured image asset's current URL; for a post without an asset, its image URL; or empty.

All blog variables are empty when the Blog module is not active.

Filters

Filters are appended after a pipe and can be chained: {{item.description | truncate(120) | upper}}.

Filter Effect
truncate(n) Cut to n characters and append an ellipsis when longer. truncate without an argument uses 150.
upper Convert to upper case.
lower Convert to lower case.
default("text") Use text when the value is empty. Single or double quotes are accepted.

Unknown filters are ignored. Whitespace around the variable name and the pipe is allowed.

Examples

{{site.title}} · {{item_set.item_count}} items
{{item.description | truncate(120)}}
{{media.type}} · {{media.parent_item.title}}
{{item.kind | upper}}
{{search.result_count}} results for “{{search.query}}”
{{item.creator | default("Unknown creator")}}
Log in for Support