Dynamic variable in Gallery-template?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
emgaron
Forum Members
Forum Members
Posts: 25
Joined: Tue Jul 10, 2012 6:52 am

Dynamic variable in Gallery-template?

Post by emgaron »

In my Gallery-galleries, I am using thee custom fields "description_en", "description_de" and "description_nl" to be able to have language-specific descriptions. Now I'm trying to deal with these in the Gallery-template "automatically" (i.e. dependent on a global $lang variable).

Based on what I could find e.g. here in the forum (viewtopic.php?t=72290), I would expect something like this to work: {$fields.description_{$lang}.value} - however, when I try to use a construct like that in my Gallery-template, I'm getting an "OOOPS" with the error 'Unexpected "{", expected one of: "}"'. I'm probably missing something obvious - anyone who can point out the error in my ways? ;D
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1797
Joined: Wed Feb 25, 2009 4:25 am

Re: Dynamic variable in Gallery-template?

Post by DIGI3 »

There might be a better way, but I'd try:

Code: Select all

{$tmp="description_{$lang}"}
{$fields.$tmp.value}
(not tested)
Not getting the answer you need? CMSMS support options
Post Reply

Return to “Modules/Add-Ons”