Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Add language to URL automaticly View modes: 
User avatar
Member
Member
eagleag - 1/31/2011 1:41:41 AM
   
Add language to URL automaticly
Hi,
I'm building a multi culture site and would like the urls for the different culture to automatically have a ".com/en/home.aspx" , ".com/fr/home.aspx".

how can I achieve this?



User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 1/31/2011 7:45:02 AM
   
RE:Add language to URL automaticly
Hello,

You can have a different URL for the same document in different culture versions of your web site. If you navigate to CMS Desk / Content / Select your home page / Properties / URLs section you can notice that you can have different Document URL path-s for different culture versions for your documents.

Example:

cs-CZ culture:

Document URL path: /cz/Home

en-US culture:

Document URL path: /en/Home

The second approach would be to create one folder under root of your web site and place all of your documents under such folder. You just need to create one folder with name en for example for the English culture and cz for the Czech culture. Then you need to set Document URL path for this folder to /en in English culture and /cz in Czech culture. Then you need to check (set it to true) the Use name path for URL path property in the CMS Site manager / Settings / choose your web site / URLs and SEO section.

Now, every newly created document (let’s say test) under the cz or en folder will have the following urls:

/en/test.aspx
/cz/test.aspx

Best regards,
Boris Pocatko

User avatar
Member
Member
aneeshsiva-gmail - 5/10/2011 1:20:57 AM
   
RE:Add language to URL automaticly
How to get the associated culture versions of a particular document

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 5/10/2011 8:47:46 AM
   
RE:Add language to URL automaticly
Hello,

You can use the SelectSingleNode method, which returns the correct language version of the document according to the second parameter.

CMS.TreeEngine.TreeProvider.SelectSingleNode(int nodeId, string cultureCode)

For more information on the mentioned method please check the API documentation.

Best regards,
Boris Pocatko