How to define language attribute in <html> tag in kentico 9.

Karambir Sharma asked on September 7, 2017 12:50

How to define language attribute in

Correct Answer

Brenden Kehren answered on September 7, 2017 13:15

You can add this in your main master page layout.

<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>
1 votesVote for this answer Unmark Correct answer

Recent Answers


Chetan Sharma answered on September 7, 2017 13:18 (last edited on September 7, 2017 13:18)

Brenden's answer is spot on. I will also add this line because sometime some of the tools give this error unless this tag is defined too.

page.XmlNamespace += " xml:lang=\"" + lang + "\"";

2 votesVote for this answer Mark as a Correct answer

Karambir Sharma answered on September 7, 2017 13:37

Thanks Brenden and chetan for the answer.

0 votesVote for this answer Mark as a Correct answer

Danielle Lukas answered on September 13, 2017 08:43

The class trait gives a method for arranging comparable components for introduction purposes. For instance, a HTML report may utilize the assignment class="notation" to show that all components with this class esteem are subordinate to the primary content of the archive. Custom Essay Writing Service. Such components may be assembled and exhibited as commentaries on a page as opposed to showing up in where they happen in the HTML source.

0 votesVote for this answer Mark as a Correct answer

Owen Garner answered on November 30, 2017 07:34

Continuously utilize a dialect quality on the HTML tag to proclaim the default dialect of the content in the page. At the point when the page contains content in another dialect, add a dialect credit to a component encompassing that substance Best Essay Writing.

0 votesVote for this answer Mark as a Correct answer

Lloyd Wright answered on January 2, 2018 16:17

Positive Psychology coaching is what primary aged needed right now. They should have knowledge about positive psychology because it can help an individual’s self-esteem to boost, they will know how to defend their sides and they will not cause cases of bullying with college paper review which is an act that is happening in every school right now.Thank you for sharing your effective plan and invitation.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.