On a page i have 4 teasers that link to other pages. I want each of these to link to a page selected randomly from a list of pages that all have a special property set (a checked checkbox).
So i have two issues here:
How do i generate a list of all the nodes in my site that has the checkbox checked in such a way that i can randomly select any of the nodes in the list?
And how do i select 4 (or just one) random nodes from this list ?
I tried searching the forum but i only found things that vaugely resembels what i want, or maybe it's just because the XSLT i over my head ?
Selecting random nodes from a list of nodes.
I have this task:
On a page i have 4 teasers that link to other pages. I want each of these to link to a page selected randomly from a list of pages that all have a special property set (a checked checkbox).
So i have two issues here:
How do i generate a list of all the nodes in my site that has the checkbox checked in such a way that i can randomly select any of the nodes in the list?
And how do i select 4 (or just one) random nodes from this list ?
I tried searching the forum but i only found things that vaugely resembels what i want, or maybe it's just because the XSLT i over my head ?
Thanks
Mikael
Hi,
Have you seen this thread: http://forum.umbraco.org/yafpostst7484Random-nodes.aspx
Regards,
/Dirk
Yes thank you, i saw that.
But i simply don't understand the code.
Is the code in the second post of that thread all that is needed ?
And what is this strange line:
msxsl:node-set($actualNodes)//node"/>
And finally where is the actual random selection taking place.
hmm maybe i should find a better book on XSLT :-)
Mikael
I did some more searching in the forum and i think i found enough pointers to get me in the right direction.
Just have to do some reading on "Exslt"
Mikael
is working on a reply...