Okay, so you are running with the legacy XML schema I can see. If you want to check for the document type you must use the @nodeTypeAlias instead of the @nodeName, so this must be changed:
<!-- Here i want to check wether page document type is "PublicationsPage" --> <xsl:iftest="@nodeName= 'Publications'"> <ahref="{umbraco.library:NiceUrl(@id)}"> <xsl:value-ofselect="@nodeName"/> </a> </xsl:if> <xsl:iftest="@nodeName= 'Publications'"> <ahref="{umbraco.library:NiceUrl(@id)}"> <xsl:value-ofselect="@nodeName"/>>> </a> <ul> <xsl:call-templatename="drawNodes3"> <xsl:with-paramname="parent"select="."/> </xsl:call-template> </ul> </xsl:if>
to this:
<!-- Here i want to check wether page document type is "PublicationsPage" --> <xsl:iftest="@nodeTypeAlias= 'PublicationsPage'"> <ahref="{umbraco.library:NiceUrl(@id)}"> <xsl:value-ofselect="@nodeName"/> </a> </xsl:if> <xsl:iftest="@nodeTypeAlias!= 'PublicationsPage'"> <ahref="{umbraco.library:NiceUrl(@id)}"> <xsl:value-ofselect="@nodeName"/>>> </a> <ul> <xsl:call-templatename="drawNodes3"> <xsl:with-paramname="parent"select="."/> </xsl:call-template> </ul> </xsl:if>
how get the document type
hello,
I want to know the document type of the node using xslt ....
how to do it ?
You can do like this:
This will return the name of the current page, which is named after the document type alias.
/Kim A
Hi,
It is not working.
It is not returning anything.
Can u say any other method.
Try this
<xsl:value-of select="local-name($currentPage)"/>
Rich
Hi,
I just have the @nodeName ....from that i want to find the document type ...how to do that ?
The code 'local-name($currentPage)' returns the alias of the DocType, what is it you're looking for?
What version of Umbraco are you using?
Rich
Sorry, are you saying that you are not trying to find the DocType of the currentPage?
If so, maybe post your XSLT, how are you getting the nodeName?
Rich
This is my xslt....
This is my xslt....
Okay, so you are running with the legacy XML schema I can see. If you want to check for the document type you must use the @nodeTypeAlias instead of the @nodeName, so this must be changed:
to this:
/Kim A
Hi vaibhav,
That looks like the old XML Schema, so you will have use @nodeTypeAlias for that:
You can read more about the differences here: http://our.umbraco.org/wiki/reference/xslt/45-xml-schema ;
/Chriztian
Hi,
this is not working....
even if i do like this ....
it returns nothing....is there any problem with my code?
Hey,
Are you saying
returns something, but
Doesn't return anything?
Rich
Yes ...
returns node name but...
returns nothing....
what could be the problem ?
What version of Umbraco are you running?
With the new xml schema, you can do it like this:
Hi,
I dont want to know the document type of the curret page .....
please refer the code which i have posted above.....
i m using Umbraco 4.6.1
Oh, if you're in a for-each loop, you can use
Same principal..
/Peter
Thanx Peter & all who tried to help me ....
is working on a reply...