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
I want to determine whether the currentpage if of specific document type.
What I did is as below:
<xsl:when test="$currentPage/SC_Page"> <xsl:for-each select="$currentPage/*[@isDoc]"> <xsl:call-template name="renderChildContent"> </xsl:call-template> </xsl:for-each></xsl:when>
where SC_Page is document type with id= 1054 of the current page. This code doesn't work for me. I couldn't access the code within it.
Howeve I have found another workaround i.e.
<xsl:when test ="$currentPage/@nodeType = 1054"> <xsl:for-each select="$currentPage/parent::*[@isDoc]/*[@isDoc]"> <xsl:call-template name="renderChildContent"> </xsl:call-template> </xsl:for-each></xsl:when>
Can anyone please explain why the first code snippet doesnt work???
Hi,
You can use:
<xsl:when test="$currentPage/self::SC_Page">
or
<xsl:when test="local-name($currentPage) = 'SC_Page'">
More info here
Another approach is to use match templates, although it takes some time to get used to. Great blog post on it here.
Hope this helps,Tom
Hi Tom,
Thanks for your fast response.
I tried it and it worked for me.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
<xsl:when> to determine the doc type of currentpage
I want to determine whether the currentpage if of specific document type.
What I did is as below:
where SC_Page is document type with id= 1054 of the current page. This code doesn't work for me. I couldn't access the code within it.
Howeve I have found another workaround i.e.
Can anyone please explain why the first code snippet doesnt work???
Hi,
You can use:
or
More info here
Another approach is to use match templates, although it takes some time to get used to. Great blog post on it here.
Hope this helps,
Tom
Hi Tom,
Thanks for your fast response.
I tried it and it worked for me.
is working on a reply...