Developer forum

Forum » Templates » Menu depending on language

Menu depending on language

Jesper Sørensen
Reply
Hi

I'm having problems with the following code. What I want to do is output a menu depending on what language/website you are on.

But nothing gets outputted even though the LongLang is ex. da-DK.

If I output all three menus without the if-statements all three menues gets outputted.

What is wrong?

!--@If(Global:Area.LongLang = 'da-DK')--
  <div id="PortalNavigationContainer">
    <ul class="dwnavigation" id="PortalNavigationDK" settings="areaid:1;startlevel:1;endlevel:2;expandmode:All;template:PortalNav.xslt"></ul>
  </div>
<!--EndIf-->

!--@If(Global:Area.LongLang = 'de-DE')-->
  <div id="PortalNavigationContainer" style="display: none">
    <ul class="dwnavigation" id="PortalNavigationDE" settings="areaid:121;startlevel:1;endlevel:2;expandmode:All;template:PortalNav.xslt"></ul>
  </div>
<!--@EndIf-->

!--@If(Global:Area.LongLang = 'en-GB')-->
  <div id="PortalNavigationContainer" style="display: none">
    <ul class="dwnavigation" id="PortalNavigationUK" settings="areaid:120;startlevel:1;endlevel:2;expandmode:All;template:PortalNav.xslt"></ul>
  </div>
<!--@EndIf-->


Replies

 
Jesper Sørensen
Reply
The forum has some problems with the tags, so some of the < and > gets cut off.
 
I. Sergey
Reply
 Hi Jesper,

First don't use the apostrophes here
@If(Global:Area.LongLang = 'en-GB')

It's better to write it like the following:
@If(Global:Area.LongLang==en-GB)

And second I think such type of the conditions don't work correctly. It might be a bug.
 
Nicolai Høeg Pedersen
Reply
Hi Jesper

What version of DW are you running on? First versions with if did not support the global tags.

 
David Matheson
Reply

Hi Jesper,

I'm using the alternate tag @If(Global:Area.Culture.CountryCode=DK) and this works fine (customer is currently on 19.2.1.3)

 

You must be logged in to post in the forum