Get nodes with certain parent node ultimate picker value
Hi,
I'm using ultimate picker to categorise 'project' nodes. 'Projects' have child nodes of varying types, one of which is 'video'. I'd like to get the latest video posted in a certain category. Any help/links muchly appreciated.
A
- B
- - C
- - C
- B
- - C
- B
- - C
- - C
'A' is the parent node of all projects. 'B's are the projects (with ultimate picker 'category' values). 'C's are the videos. I need latest C where B ultimate picker has category X. Hope that makes sense!
Ah, got it after some head scratching. XSLT isn't my strong point to let me know if I'm doing something that's bad practise. Hope this helps someone else:
Just two things: You almost never need to explicitly cast anything in XSLT - so you can get rid of the string() function around $currentPage/@id inside the concat() function - that happens automatically, and not having to wrap that around helps the readability;
You say you want the latest FeaturedVideo, so I'd suggest you sort using either @createDate or @updateDate - they are XMLDates which are just text, but in a sortable format. You should not rely on the highest @id to be the latest node.
Get nodes with certain parent node ultimate picker value
Hi,
I'm using ultimate picker to categorise 'project' nodes. 'Projects' have child nodes of varying types, one of which is 'video'. I'd like to get the latest video posted in a certain category. Any help/links muchly appreciated.
A
- B
- - C
- - C
- B
- - C
- B
- - C
- - C
'A' is the parent node of all projects. 'B's are the projects (with ultimate picker 'category' values). 'C's are the videos. I need latest C where B ultimate picker has category X. Hope that makes sense!
Thanks,
Paul
Ah, got it after some head scratching. XSLT isn't my strong point to let me know if I'm doing something that's bad practise. Hope this helps someone else:
Hi Paul,
Just two things: You almost never need to explicitly cast anything in XSLT - so you can get rid of the string() function around $currentPage/@id inside the concat() function - that happens automatically, and not having to wrap that around helps the readability;
You say you want the latest FeaturedVideo, so I'd suggest you sort using either @createDate or @updateDate - they are XMLDates which are just text, but in a sortable format. You should not rely on the highest @id to be the latest node.
/Chriztian
is working on a reply...