Developer forum

Forum » CMS - Standard features » GetLoop(
Kevin O''''Driscoll
Reply

Hi I noticed there is this new loop in a DW Master template in v 8.7.2.8

GetLoop("WebsiteLanguages")

Im using it for the user to select a language and go to the homepage for the language version, as I guess it is intended.

This is not a website property Item type and seems to be built in to the DW .dll. We would like to be able to customize this to be able to localise the content dependent on which language version the user is currently on. So if Im a Dane on the danish language site I see engelsk, svensk etc.

Is this some kind of template extension? how would I go about this? Or a standard module/custom module?

Also for countries Select your countries with localised content. This data is already available in EcomCountyText table.

For Select your Language I dont see localised languages in the database, so I guess I will have to use Translations.xml to localise unless there exists in the database somewhere? This is not a happy solution because editor will need to remember to add if a new Language is added.

So I would like to end up with:

GetLoop("GlobalLanguages") - Localised

GetLoop("GlobalCountries") - Localised

I think there is a distinction between a Site in different Languages and sites for different countries (that just happen to be in a relevent language)

Any Pointers?

 

Capture.PNG

Replies

 
Nicolai Pedersen
Reply

Hi Kevin

It is a list of the language version of a given website - the names are the names you give your websites in the backend. If you add a @Translate(GetValue("Name")), you can translate them using the translation system. Just remember that a person on the Danish website that wants to change to another language probably does not understand Danish, so translating to Danish might be wrong...? Also inside the WebsiteLanguages loop you have a Culture tag that can be used to create a CultureInfo object and then you can take the language name from that object. Doing this, you don't have to use Translate.

I do not understand you GlobalLanguages and GlobalCountries question.

BR Nicolai

 

You must be logged in to post in the forum