On this page:


<txp:lang />

The lang tag is a single tag. Textpattern will replace this tag with the 2-letter code of the language which is set as the site’s language preference in the Languages panel, according to RFC 1766.


This tag has no attributes.


Example 1: Define a document’s language

<!DOCTYPE html>
<html lang="<txp:lang />" dir="<txp:text item="lang_dir" />">
    <meta charset="utf-8">
        <txp:page_title />

Why you might do this? When declaring a DTD, namespace and language that a site is served, the lang attribute is useful for ensuring translators, search engines and content parsers handle the document in the correct manner.

Other tags used: page_title, text.

See something wrong in this document? Outdated info, a broken link, faulty code example, or whatever? Please open an issue and we’ll investigate.