If else?

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
BoHendriks

If else?

Post 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!
Pierre M.

Re: If else?

Post by Pierre M. »

Hello,

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

Pierre
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: If else?

Post by Ted »

Where is $lang coming from?  Does that even exist anywhere in that template?
BoHendriks

Re: If else?

Post 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
Pierre M.

Re: If else?

Post by Pierre M. »

Please ask this in the "MLE fork" forum.

Pierre M.
bunak
Forum Members
Forum Members
Posts: 75
Joined: Mon Sep 10, 2007 1:58 pm

Re: If else?

Post by bunak »

if variable $lang exists
then try "eq" instead of "=="
alby

Re: If else?

Post 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
Last edited by alby on Sat Jan 05, 2008 10:41 am, edited 1 time in total.
Locked

Return to “[locked] CMSMS MLE fork”