Whilst reading the XSLT Basics Book, I tried to present on my homepage all the standard data available using the value-of command e.g. node ID, node name, level, writer etc.
They all worked fine except for the Node Type Alias which rendered blank. Here is the simple code I used in the template:
What version of umbraco are you using the first bit should work regardless of version the second bit will only work pre 4.5 or 4.5 with legacy schema turned on.
Node Type Alias not showing
Whilst reading the XSLT Basics Book, I tried to present on my homepage all the standard data available using the value-of command e.g. node ID, node name, level, writer etc.
They all worked fine except for the Node Type Alias which rendered blank. Here is the simple code I used in the template:
I then tried to present some non-standard data as outlined in the documentation and that didn't work either:
Is there something I have overlooked? Why can I not print the document's alias or the summary?
Thanks, Eddy
What version of umbraco are you using the first bit should work regardless of version the second bit will only work pre 4.5 or 4.5 with legacy schema turned on.
Regards
Ismail
Hi Ismail,
That was quick! I'm using v 4.5.1.
Eddy
Eddy,
I am assuming your are on latest schema so instead use this wiki entry
http://our.umbraco.org/wiki/reference/xslt/45-xml-schema/xslt-examples-updated-to-new-schema
regards
Isamil
Hi Eddy
The xml schema has changed from 4.0.x to 4.5.1, so there are a few things that need to be done differently than in the book you mention.
You can read a bit about the differences in the schema here:
http://our.umbraco.org/wiki/reference/xslt/45-xml-schema
The new equivalent of the samples you mention would be:
nodeTypeAlias: <xsl:value-of select="local-name($currentPage)" />
This is no longer an attribute, but the actual name of the element.
Non-Standard Data :<xsl:value-of select="$currentPage/summary"/>
Data fields are now saved in named elements instad of having aliases.
Hi Ismail, Hi Morten,
The new samples work just fine now and I'll add those links you have provided to my reading list.
Thanks, Eddy
is working on a reply...