Skip to content

Instantly share code, notes, and snippets.

@greggnakamura
Last active March 4, 2020 21:51
Show Gist options
  • Select an option

  • Save greggnakamura/275399f109a2841a72ccd04fc0f0f74b to your computer and use it in GitHub Desktop.

Select an option

Save greggnakamura/275399f109a2841a72ccd04fc0f0f74b to your computer and use it in GitHub Desktop.
Accessibility: Kentico <html> lang attribute
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment