Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mikael Mørup 297 posts 326 karma points
    Jan 20, 2009 @ 10:04
    Mikael Mørup
    0

    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

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 20, 2009 @ 10:33
    Dirk De Grave
    0

    Hi,

    Have you seen this thread: http://forum.umbraco.org/yafpostst7484Random-nodes.aspx

    Regards,
    /Dirk

  • Mikael Mørup 297 posts 326 karma points
    Jan 20, 2009 @ 11:08
    Mikael Mørup
    0

    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

  • Mikael Mørup 297 posts 326 karma points
    Jan 20, 2009 @ 13:16
    Mikael Mørup
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft