My page template has a language detection and selector. The following code works perfectly when I place it in the content
Code: Select all
{if $global_page_alias == 'home'} Nederlands {elseif $global_page_alias == 'accueil'} Frans {else} Engels {/if}I want language-dependent fields in the gallery for the titles and descriptions of images. In the following Gallery template I try to give the title per language.
Code: Select all
{foreach from=$images item=image}
{if $image->isdir}
<a class="item" href="{$image->file}" title="{$image->titlename}"><img class="img-responsive" src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->titlename}" />
{foreach from=$fields item=field}
<h3>{if $global_page_alias == 'home'} {$image->fields.categorie_titel_nl.value}
{elseif $global_page_alias == 'accueil'} {$image->fields.categorie_titel_fr.value}
{else} {$image->fields.categorie_titel_en.value} {/if}</h3>
{/foreach}
</a>
{else}
<a class="group" href="{$image->file|escape:'url'|replace:'%2F':'/'}" title="{$image->comment}" rel="prettyPhoto[{$galleryid}]"><img class="img-responsive" src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->titlename}" /></a>
{/if}
{/foreach}Does anyone have a solution to this problem?


