Print this Page not working when parent node is redirected
I have a Print this Page macro which has three options:
Print all pages in the content tree
Print the current page, it's parent and all it's siblings
Print the current page.
However if a parent node is redirected none of the child nodes will print.
What do I need to adjust in my XSLT to get this working on child nodes whose parent nodes have been redirected? Note: The parent node is being redirected to the first child node.
Current Page's parent, sibling with families Current page and all children Current page Only
--> <xsl:param name="currentPage"/>
<xsl:template match="/">
<!-- Parent and sibling families -->
<xsl:for-each select="$currentPage/parent/node [string(data [@alias='umbracoNaviHide']) != '1' and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true()) and @nodeTypeAlias != 'Site' and @nodeTypeAlias != 'Poll' and @nodeTypeAlias != 'PollAnswer' and @nodeTypeAlias != 'Polls' and @nodeTypeAlias != 'nitroGalleryPhoto' and @nodeTypeAlias != 'PrintPage' and @nodeTypeAlias != 'DateFolder' and @nodeTypeAlias != 'Latest News' and @nodeTypeAlias != 'LatestNewsPost' and @nodeTypeAlias != 'whatsNew' and @nodeTypeAlias != 'quickLinks' and @nodeTypeAlias != 'imageSearchResults' and @nodeTypeAlias != 'search' and @nodeTypeAlias != 'documentFinder' and @nodeTypeAlias != 'documentLightbox' and @nodeTypeAlias != 'documentSearchResults' and @nodeTypeAlias != 'siteIndex' and @nodeTypeAlias != 'sitemap' and @nodeTypeAlias != 'webmaster' and @nodeTypeAlias != 'contactForm' and @nodeTypeAlias != 'nitroGallery']"> <div id="print"> <p> <a> <xsl:attribute name="href">PrintPages.aspx?nodeid=<xsl:value-of select="@id"/></xsl:attribute> <xsl:value-of select="@nodeName"/> </a>(<xsl:value-of select="count(child::node) + 1" />) </p> </div> </xsl:for-each>
<xsl:call-template name="printPages"> <xsl:with-param name="nodeName" select="$currentPage/parent::node/@nodeName"/> <xsl:with-param name="nodeId" select="$currentPage/@id"/> <xsl:with-param name="type" select="3"/> <xsl:with-param name="pageCount" select="count($currentPage/parent::node/descendant-or-self::node/node [string(data [@alias='umbracoNaviHide']) != '1' and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true()) and @nodeTypeAlias != 'Site' and @nodeTypeAlias != 'Poll' and @nodeTypeAlias != 'PollAnswer' and @nodeTypeAlias != 'Polls' and @nodeTypeAlias != 'nitroGalleryPhoto' and @nodeTypeAlias != 'PrintPage' and @nodeTypeAlias != 'DateFolder' and @nodeTypeAlias != 'Latest News' and @nodeTypeAlias != 'LatestNewsPost' and @nodeTypeAlias != 'whatsNew' and @nodeTypeAlias != 'quickLinks' and @nodeTypeAlias != 'imageSearchResults' and @nodeTypeAlias != 'search' and @nodeTypeAlias != 'documentFinder' and @nodeTypeAlias != 'documentLightbox' and @nodeTypeAlias != 'documentSearchResults' and @nodeTypeAlias != 'siteIndex' and @nodeTypeAlias != 'sitemap' and @nodeTypeAlias != 'webmaster' and @nodeTypeAlias != 'contactForm' and @nodeTypeAlias != 'nitroGallery']) + 0"/> </xsl:call-template>
<!-- Current Page All Children --> <xsl:if test="count($currentPage/descendant::node [string(data [@alias='umbracoNaviHide']) != '1' and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true()) and @nodeTypeAlias != 'Site' and @nodeTypeAlias != 'Poll' and @nodeTypeAlias != 'PollAnswer' and @nodeTypeAlias != 'Polls' and @nodeTypeAlias != 'nitroGalleryPhoto' and @nodeTypeAlias != 'PrintPage' and @nodeTypeAlias != 'DateFolder' and @nodeTypeAlias != 'Latest News' and @nodeTypeAlias != 'LatestNewsPost' and @nodeTypeAlias != 'whatsNew' and @nodeTypeAlias != 'quickLinks' and @nodeTypeAlias != 'imageSearchResults' and @nodeTypeAlias != 'search' and @nodeTypeAlias != 'documentFinder' and @nodeTypeAlias != 'documentLightbox' and @nodeTypeAlias != 'documentSearchResults' and @nodeTypeAlias != 'siteIndex' and @nodeTypeAlias != 'sitemap' and @nodeTypeAlias != 'webmaster' and @nodeTypeAlias != 'contactForm' and @nodeTypeAlias != 'nitroGallery']) > 0"> <xsl:call-template name="printPages"> <xsl:with-param name="nodeName" select="$currentPage/@nodeName"/> <xsl:with-param name="nodeId" select="$currentPage/@id"/> <xsl:with-param name="type" select="2"/> <xsl:with-param name="pageCount" select="count($currentPage/descendant::node [string(data [@alias='umbracoNaviHide']) != '1' and (umbraco.library:IsProtected(@id, @path) = false() or umbraco.library:HasAccess(@id, @path) = true()) and @nodeTypeAlias != 'Site' and @nodeTypeAlias != 'Poll' and @nodeTypeAlias != 'PollAnswer' and @nodeTypeAlias != 'Polls' and @nodeTypeAlias != 'nitroGalleryPhoto' and @nodeTypeAlias != 'PrintPage' and @nodeTypeAlias != 'DateFolder' and @nodeTypeAlias != 'Latest News' and @nodeTypeAlias != 'LatestNewsPost' and @nodeTypeAlias != 'whatsNew' and @nodeTypeAlias != 'quickLinks' and @nodeTypeAlias != 'imageSearchResults' and @nodeTypeAlias != 'search' and @nodeTypeAlias != 'documentFinder' and @nodeTypeAlias != 'documentLightbox' and @nodeTypeAlias != 'documentSearchResults' and @nodeTypeAlias != 'siteIndex' and @nodeTypeAlias != 'sitemap' and @nodeTypeAlias != 'webmaster' and @nodeTypeAlias != 'contactForm' and @nodeTypeAlias != 'nitroGallery']) + 1"/> </xsl:call-template> </xsl:if> <!-- Current Page Only --> <xsl:call-template name="printPages"> <xsl:with-param name="nodeName" select="'Current page'"/> <xsl:with-param name="nodeId" select="$currentPage/@id"/> <xsl:with-param name="type" select="1"/> <xsl:with-param name="pageCount" select="1"/> </xsl:call-template>
Print this Page not working when parent node is redirected
I have a Print this Page macro which has three options:
However if a parent node is redirected none of the child nodes will print.
What do I need to adjust in my XSLT to get this working on child nodes whose parent nodes have been redirected?
Note: The parent node is being redirected to the first child node.
Here's my XSLT:
Cheers,
JV
is working on a reply...