<xdo-root>displays the URL path of your XDO document tree. By default, the root is
/, but it can be changed with the xdo-root configuration. For example, this web site has a document of /xdo/, so this tag:
<xdo-root>displays this: /xdo/.
<xdo-root>can be used in tag URLs to simplify the process of linking to other pages in the web site. For example, suppose as you develop your site you have link to your home page in
top.xdo, which is included in the top of every page. You could link like this:
<a href="/mysite-development/">Home</a>That will work when your site is in development, but if you copy the site to a production directory like
/mysite/the link won't work. You could change the link in
top.xdo, but it would be simpler to set the link correctly from the start using
<a href="<xdo-root>">Home</a>When you move or copy the site, the link will continue to work. You can also use
<xdo-root>to build paths from the root. For example, this example links to a directory within the root directory:
<a href="<xdo-root>/mysubdir/">My sub directory</a>Note: You wonder why you don't just use a relative path when linking to another home page. The answer is that links in included pages can be used in many pages throughout your site, all of which are in different locations in the document tree. Therefore it's best practice to provide a full URL path in included pages.