I'm copying some of my old 4.0 xslt files into 4.5 and I have an xslt file that returns the last non-empty value. Basically it checks if the current page has an 'seoDescription' property value, and if not then returns the parent 'seoDescription' property value. But I can't work out how to get [position()=last()] to work in the 4.5 schema. Here is the code I'm trying to convert:
Hi Chriztian, that doesn't quite seem to work - it's returning the parent property. For example when using the following page structure and when 'about us' is the current page...
-Home --About us
...it is returning the 'home' seoDescription instead of the 'about us' seoDescription.
4.5 - Get position()=last() that is not empty
I'm copying some of my old 4.0 xslt files into 4.5 and I have an xslt file that returns the last non-empty value. Basically it checks if the current page has an 'seoDescription' property value, and if not then returns the parent 'seoDescription' property value. But I can't work out how to get [position()=last()] to work in the 4.5 schema. Here is the code I'm trying to convert:
Hi jonok,
Try something like this:
/Chriztian
Hi Chriztian, that doesn't quite seem to work - it's returning the parent property. For example when using the following page structure and when 'about us' is the current page...
-Home
--About us
...it is returning the 'home' seoDescription instead of the 'about us' seoDescription.
Whoops! Pitfall... - replace the [last()] predicate with a [1] and it should take the right one.
/Chriztian
Perfect - that did the trick. Thanks very much Chriztian.
is working on a reply...