Knowledgebase: Design Templates
Gallery Builder Templates (Smarty)
Posted by Mark [Elevated X Support], Last modified by John [Elevated X Support] on 27 September 2018 10:23 PM

Gallery Builder Templates (Smarty)   (For PHP based FHG template guide please visit this link.)

Please follow the example files located in your smarty/smarty0 folder.

Using the included default templates as a guide you will need to edit the HTML of your own template files to include the code from the photos and/or videos smarty files. You’ll need to save your template using the extension .tpl

The images folder must be named the same as the template so photos.tpl has a folder named photos. A template named blue_15pics.tpl would have a folder named /blue_15pics

Join Link Code Tags:

This tag will append the join URL you enter in the admin panel for this template. If you prefer not to have the system populate these tags you can hard code your join links into the templates.

<a href="{$root.template.JoinURL}"></a>

For each spot in the template you want a photo thumbnail to appear, use the following tag set.

{include file="photo_item.tpl" index="1"}

The index="1" refers to the location of the photo in the template. When you edit a template in the cms admin panel, Location 1 corresponds to this location. Each spot must be defined with a number that corresponds to its Location in the template as defined in admin. For example if you have a gallery with 10 photos, you would have 10 instances of the tag set above,  ranging from [1] to [10].

{include file="photo_item.tpl" index="1"}

{include file="photo_item.tpl" index="2"}

{include file="photo_item.tpl" index="3"}

{include file="photo_item.tpl" index="4"}

{include file="photo_item.tpl" index="5"}

The same is done for movies, however, the template being loaded is movie_item.tpl as in the following example:

{include file="movie_item.tpl" index="1"}

{include file="movie_item.tpl" index="2"}

{include file="movie_item.tpl" index="3"}

Common tags that can be used to show content in a template:

Appear Date : {$root.contentgroup[0].AppearDate}
Expiration Date : {$root.contentgroup[0].ExpireDate}
Title : {$root.contentgroup[0].Title}
Description : {$root.contentgroup[0].Description}
Folder name in CMS : {$root.contentgroup[0].Directory}
Gallery Folder : {$root.folder}
Join URL : {$root.template.JoinURL}

Extra Fields:
(Where FieldName is the extrafield you have set up for that set)

Models associated with update:
{foreach from=$root.contentgroup[0].PreviewXML.sets.set item="item" name="loopCN"}
{if !$smarty.foreach.loopCN.last },&nbsp;{/if}

Advanced templating (for Smarty Experts)
When generating a smarty gallery, the system creates a file called index_debug.html within the destination folder of the gallery. Viewing this file will give you a complete dump of the information available to the user. Please use this file or a reference if looking to do anything more advanced.

(2 vote(s))
Not helpful

Comments (0)