For example i have multidomain site, and i need to draw navigation for each domain from domain folder. As far as i understanding it, i should search for a nodes in a certain folder with certain name.
For this purpose i want to write XLST macro what will find a child with certain name on certain level and enumerate all pages, what have this child as parent.
Content
- Website (UK)
- Home
- News
- About
- Website (RU)
- Website (FR)
You can do the following in your macro to get a reference to the top node of the site your currentPage is within:
<xsl:param name="currentPage" />
<xsl:variable name="siteRoot" select="$currentPage/ancestor-or-self::*[@level = 1]" />
<!-- Render navigation within current site -->
<xsl:for-each select="$siteRoot/*[@isDoc]">
... etc.
The siteRoot variable goes back up the tree until it reaches level 1, which is normally the root of a site in a multisite setup.
Enumerating pages from certain parent
For example i have multidomain site, and i need to draw navigation for each domain from domain folder. As far as i understanding it, i should search for a nodes in a certain folder with certain name.
For this purpose i want to write XLST macro what will find a child with certain name on certain level and enumerate all pages, what have this child as parent.
How can i do this?
Thank you.
Hi Alexadar,
If your setup is something like this:
You can do the following in your macro to get a reference to the top node of the site your currentPage is within:
The siteRoot variable goes back up the tree until it reaches level 1, which is normally the root of a site in a multisite setup.
/Chriztian
is working on a reply...