Two variables in variable

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
Joseph777
Forum Members
Forum Members
Posts: 206
Joined: Wed Mar 16, 2011 9:13 am

Two variables in variable

Post by Joseph777 »

How can i use two variables in this case?
My code does not work.

{content block_type="dropdown" block="default_lang" assign="default_lang" label="Defaultný jazyk" items="English|German" values="en|de"}

{content block="banner_1_en" assign="banner_1_en" label="1. Banner" wysiwyg="false"}

{$banner_1_$default_lang}

thanks
uniqu3

Re: Two variables in variable

Post by uniqu3 »

You might want to change assign="banner_1_en" to assign="banner_1_"

{assign var='foo' value="`$banner_1_``$default_lang`"}
or
{assign var='foo' value=$banner_1_|cat:"$default_lang"}

then call {$foo}
Joseph777
Forum Members
Forum Members
Posts: 206
Joined: Wed Mar 16, 2011 9:13 am

Re: Two variables in variable

Post by Joseph777 »

thanks fo your reply

i do not use assign="banner_1_", because i have more content blocks (see below) and assign must be unique.

{content block="banner_1_en" assign="banner_1_" label="1. English banner" wysiwyg="false" smarty="true" block_tab="English"}

{content block="banner_1_de" assign="banner_1_" label="1. English banner" wysiwyg="false" smarty="true" block_tab="English"}
Post Reply

Return to “CMSMS Core”