Page 1 of 1

If else?

Posted: Tue Dec 18, 2007 10:05 am
by BoHendriks
Somebody can help me with this?

I want to use something like this... (i like to read out language)

If language = NL then give this hyperlink
else = i want to show a english hyperlink

I have made this.. but.. it dont work


{if $lang == "nl_NL"}

{cms_selflink page='78' text='Terug naar het overzicht'}

{else}

{cms_selflink page='78' text='Back to overview'}

{/if}


Somebody can help me?
cheers!

Re: If else?

Posted: Tue Dec 18, 2007 5:30 pm
by Pierre M.
Hello,

I don't know Smarty, but can you dump $lang to see what is actually in it ?

Pierre

Re: If else?

Posted: Wed Dec 19, 2007 1:36 pm
by Ted
Where is $lang coming from?  Does that even exist anywhere in that template?

Re: If else?

Posted: Thu Dec 20, 2007 9:41 am
by BoHendriks
I want to readout the language from the multilingual CMS.. I dont know if $lang exists, isn't there a variable that hold this information? ;D

Re: If else?

Posted: Thu Dec 20, 2007 10:07 am
by Pierre M.
Please ask this in the "MLE fork" forum.

Pierre M.

Re: If else?

Posted: Fri Jan 04, 2008 11:29 am
by bunak
if variable $lang exists
then try "eq" instead of "=="

Re: If else?

Posted: Fri Jan 04, 2008 12:46 pm
by alby
BoHendriks wrote: If language = NL then give this hyperlink
else = i want to show a english hyperlink

I have made this.. but.. it dont work


{if $lang == "nl_NL"}

{cms_selflink page='78' text='Terug naar het overzicht'}

{else}

{cms_selflink page='78' text='Back to overview'}

{/if}
I am sorry but I had escaped this topic.

Try with {$lang|print_r} for debug your variables.
$lang is a smarty variable and contain current locale lang

What is your version of MLE?
Have you apply modify to MLE?
Tag {lang} for langs switch works?

Alby