martedì 31 ottobre 2017

Inserire l'attributo lang nel tag HTML

E' sufficiente inserire nella master page il seguente codice:

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
    if (CurrentDocument != null)
    {          
        CMS.UIControls.ContentPage page= this.Page as CMS.UIControls.ContentPage;
        if (page != null)
        {
            string lang= CMS.Localization.LocalizationContext.CurrentCulture.CultureCode;
            page.XmlNamespace += " lang=\"" + lang + "\"";
        }
    }
}
</script>


Fonte: https://devnet.kentico.com/questions/kentico-9-how-to-define-language-in-html