It basically loops through all ancestor and self node and looks for a parameter PageTitle that != "" to set as the title for the current node. However when running it, it does not return any data.
I am using Umbraco 4.5.1. Not sure if I am using the old or new schema; I think a whole bunch of xslt with the old schema is cached which is why some of it still works and some requires the new schema...
Thanks; that's much cleaner. It validates fine but still dosn't output any data.
For our home page doc type, the Page Title attribute has an alias of "PageTitle" (first letter is capitalized). I inherited this site from another designer and it was running on a Very old version of Umbraco. since then I have upgraded it to 4.5.1. Is it possible that, for some reason, the data is not being rendered properly because umbraco prefers alias's with a lower case first letter?
XSLT not rendering any content
here is the xslt:
<title>
<xsl:for-each select="$currentPage/ancestor-or-self::*[@isDoc][not(string(./PageTitle)='')]">
<xsl:sort select="position()" data-type="number" order="descending"/>
<xsl:if test="position()=1">
<xsl:value-of select="./PageTitle" />
</xsl:if>
</xsl:for-each>
</title>
It basically loops through all ancestor and self node and looks for a parameter PageTitle that != "" to set as the title for the current node. However when running it, it does not return any data.
I am using Umbraco 4.5.1. Not sure if I am using the old or new schema; I think a whole bunch of xslt with the old schema is cached which is why some of it still works and some requires the new schema...
Any help would be appreciated :)
Thanks,
Max.
Hi Max,
Looks like you're aiming for the "recursive" functionality - you can get that in a single select:
/Chriztian
Thanks; that's much cleaner. It validates fine but still dosn't output any data.
For our home page doc type, the Page Title attribute has an alias of "PageTitle" (first letter is capitalized). I inherited this site from another designer and it was running on a Very old version of Umbraco. since then I have upgraded it to 4.5.1. Is it possible that, for some reason, the data is not being rendered properly because umbraco prefers alias's with a lower case first letter?
Hi Max,
No - that was my mistake (old habits die hard :-)
If it doesn't work with the capitalized version, try the old schema version here:
/Chriztian
Yep, that did it :)
Thanks very much.
is working on a reply...