The legacy wiki pages are here for reference purposes only.
For up-to-date information make sure to check the documentation section.

The GetCurrentDomains function is used to return a domains object which contains the current domains and their associated languages.

Setting up a domain in your Umbraco installation

For the sample below to work you will need to have setup at least one domain, you do this by right clicking your top level content node and then "Manage Hostnames"

This function cannot be used directly as an XSLT extension

This cannot be called directly using the XSLT extension as it returns an object rather than a Xml Node set which would be better for use within XSLT ( maybe a future revision! )

Using this function in XSLT via an embedded script

You can however use embedded script to make use of this function.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#x00A0;">
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets vizioz">

<xsl:output method="xml" omit-xml-declaration="yes"/>

<xsl:param name="currentPage"/>

<xsl:template match="/">

<!-- Return a list of domains and convert them into a node set -->
<xsl:variable name="domains" select="Exslt.ExsltStrings:tokenize(vizioz:GetDomain($currentPage/@id),' ')"/>

<xsl:for-each select="$domains">
<xsl:value-of select="."/>


<msxml:script language="CSharp" implements-prefix="vizioz">
<msxml:assembly href="../bin/cms.dll" />
<msxml:assembly href="../bin/umbraco.dll" />
<msxml:using namespace="umbraco" />
<msxml:using namespace="umbraco.cms.businesslogic.web" />

public static string GetDomain(int pageId)
string domainList = "";
Domain[] domains = library.GetCurrentDomains(pageId);
if (domains != null &amp;&amp; domains.Length &gt;= 0)
foreach (Domain d in domains)
if (domainList.Length > 0)
{domainList += ' ';}
domainList += d.Name;
return domainList;
catch (Exception errDictionary)
return string.Empty;


This will return a list of the domain names.

Extract the language

You could of course extend this and add a function that returns the languages from the domain object, a similar example of which can be found on this forum post: is the community mothership for Umbraco, the open source cms. With a friendly forum for all your questions, a comprehensive documentation and a ton of packages from the community. This site is running Umbraco version 7.5.2