ASPX templates
Version 6.x > ASPX templates > Show content based on culture View modes: 
User avatar
Member
Member
paul.truman-sunmed.co - 12/18/2012 3:41:29 AM
   
Show content based on culture
Hey, i'm a little stuck on some mark-up and was hoping someone can help me (first time using an aspx template) - if I wanted to not show some of my code to a certain language culture in an IF statement, what is the mark up that I need to use to get the language value?

User avatar
Kentico Support
Kentico Support
kentico_radekm - 12/19/2012 2:47:15 AM
   
RE:Show content based on culture
Hello.

You can get current culture code in the code-behind of your ASPX page template like this:

string sCurrentCulture = CMS.CMSHelper.CMSContext.CurrentDocumentCulture.CultureCode;


And then, according to returned value, set visibility of particular web parts / controls used in your template.

Best Regards,
Radek Macalik