Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I am looking to call a template based upon whether or not the current page is descended from a page with a particular ID. eg:
if the current page or any of it's ancestors do not have an ID of 999 call templateend if
I know I need to use the ancestor-or-self axis but am confused as to how I combine a select with an if to get the desired results.
Any help would be much appreciated.
Thanks
Neil
RenderTemplate(Int32 PageId) might do it in xslt
This might work
<xsl:if test="$currentPage/ancestor-or-self::node/@id = '1060'"><xsl:value-of select="umbraco.library:RenderTemplate()" /></xsl:if>
or of course if your test is "does not"
<xsl:if test="$currentPage/ancestor-or-self::node/@id != '999'"></xsl:if>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
XSLT Ancestor question
Hi,
I am looking to call a template based upon whether or not the current page is descended from a page with a particular ID. eg:
if the current page or any of it's ancestors do not have an ID of 999
call template
end if
I know I need to use the ancestor-or-self axis but am confused as to how I combine a select with an if to get the desired results.
Any help would be much appreciated.
Thanks
Neil
RenderTemplate(Int32 PageId) might do it in xslt
This might work
or of course if your test is "does not"
is working on a reply...