Developer forum

Forum » Templates » Language specific image?

Language specific image?

Dmitrij Jazel
Reply
Hello DW guys,

I was wondering, if something like this is possible to achieve in DW,
Here is what I working on (see attachment)

I have an image here, that I want to change, depending on what language the webpage is viewed.
For example, if it is Danish, than The image would be the map of Denmark. And if user is browsing English site, than the image is replaced with the map of England.
I am thinking to make a paragraph in each language site, tha paragraph would eventually hold the picture I need to show. Than I would reference that paragraph like this:
<div class="ImageHolder">
<!-- if English version is selected - show paragraphID 1 -->
<!--@Global:Paragraph.Content(1)-->
<!-- if Danish version is selected - show paragraphID 2 -->
<!--@Global:Paragraph.Content(2)-->
</div>
Or something like that...
Any suggestions how to do it? :-)

Regards,
Dmitrij
kort.png

Replies

 
Nuno Aguiar
Reply
Hi Dmitrj,

You can achieve this by checking the Area Culture. Check the global tags to get them.

//Nuno

 
Dmitrij Jazel
Reply
Hi Nuno :)

hmm, ok I will try this one. But maybe could I ask you also to include a small example here?
Cause This resource here:
http://templates.dynamicweb-cms.com/TemplateTags/Dynamicweb-template-tags/General-tags/Global-template-tags/GlobalArea.ID.aspx
Is not really explaining how can you achieve this one, I know it is AreaID but how actually to use it?
Just to make sure we are thinking about the same thing...

Regards,
Dmitrij
 
Nuno Aguiar
Reply
This post has been marked as an answer
Hi Dmitrij,

Here's two examples

1. Using If Statements checking English or French cultures
<div class="ImageHolder">
<!--@If(Global:Area.LongLang='en-GB')-->
    <!--@Global:Paragraph.Content(1)-->
<!--@EndIf-->
<!--@If(Global:Area.LongLang='fr-FR')-->
    <!--@Global:Paragraph.Content(2)-->
<!--@EndIf-->
</div>
2. Using translate tags
<div class="ImageHolder">
    <!--@Global:Paragraph.Content(<!--@Translate(ParagraphID,"1")-->)-->
</div>

Nuno

Votes for this answer: 0
 
Dmitrij Jazel
Reply
Hej Nuno :)

That is just great!
Thanks alot for help :)

Regards,
Dmitrij

 

You must be logged in to post in the forum