I have a property on my document type called "ShowLinkToSubpages", which I use to decide whether or not to show tertiary links in the sidebar of each page. It just of course iterates through the child nodes of the CURRENT page and displays those links. What I'd like to do ON THE THIRD-TIER (child) PAGES, though, is to ALSO display these links, that is, links to the SIBLINGS. I'd like to check if the current page's Parent page has ShowLinkToSubpages set to true, then call a Macro whose XSLT will write the Sibling links.
So I would like help with Two things: the XSLT to check the Parent node's property value, and the XSLT to list the Siblings of the current page.
That code is giving me an error: Error reading XSLT file: \xslt\SidebarContent.xsl. And I added the leading ".
Anyways, I need to be able to access the parent of This page Specifically, not everything on a certain Level. If I am ON a certian level, I need to display Children, and if I am another, different certain level, I ned to display Siblings. Understand?
The Xpath will only match nodes with that property so it wont display children of other nodes. However, if you could do a <textarea><xsl:copy-of select="$currentPage" /></textarea> and copy the XML here it would be easier to help.
Listing the siblings of $currentPage is done by taking the children of $currentPage's parent. Messing around with preceding-sibling:: and following-sibling:: isn't really feasible here; so:
check if parent page has certain property
Hi,
I have a property on my document type called "ShowLinkToSubpages", which I use to decide whether or not to show tertiary links in the sidebar of each page. It just of course iterates through the child nodes of the CURRENT page and displays those links. What I'd like to do ON THE THIRD-TIER (child) PAGES, though, is to ALSO display these links, that is, links to the SIBLINGS. I'd like to check if the current page's Parent page has ShowLinkToSubpages set to true, then call a Macro whose XSLT will write the Sibling links.
So I would like help with Two things: the XSLT to check the Parent node's property value, and the XSLT to list the Siblings of the current page.
Thanks in advance,
Garrett
You can do this quite entirely from XSLT if i understand you correct. I assume level 2 is 2nd tier:
Ops, some bad grammar there ... and the select missed a " in front.
Thanks for your reply--
That code is giving me an error: Error reading XSLT file: \xslt\SidebarContent.xsl. And I added the leading ".
Anyways, I need to be able to access the parent of This page Specifically, not everything on a certain Level. If I am ON a certian level, I need to display Children, and if I am another, different certain level, I ned to display Siblings. Understand?
Thanks again,
Garrett
The Xpath will only match nodes with that property so it wont display children of other nodes. However, if you could do a <textarea><xsl:copy-of select="$currentPage" /></textarea> and copy the XML here it would be easier to help.
Hi Garrett,
Checking for a property on the parent page is done using the parent:: axis:
- or using the shorthand "..":
Listing the siblings of $currentPage is done by taking the children of $currentPage's parent. Messing around with preceding-sibling:: and following-sibling:: isn't really feasible here; so:
- or, if you're like me, using templates instead of for-each:
/Chriztian
- just realised you might actually need only the siblings, not including $currentPage:
/Chriztian
Rock n roll, Chriztian! This code is exactly what I needed, works very well. I appreciate your time :)
//Garrett
is working on a reply...