Copied to clipboard

Flag this post as spam?

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


  • Probocop 51 posts 71 karma points
    Jan 17, 2011 @ 11:36
    Probocop
    0

    Displaying random content from multiple document types anywhere on the site?

    Hi,

    On the site I am currently developing I would like to show two random nodes in a sidebar, which could come from a selection of document types.

    I was hoping to be able to just xsl:sort by random and limit to position() < 3, but no such luck!

    How would I go about achieving this?

    Thanks,
    Dave

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 17, 2011 @ 11:43
    Jan Skovgaard
    0

    Hi Probocop

    I think you can solve your problem by following the instructions in this wiki entry: http://our.umbraco.org/wiki/reference/xslt/snippets/getting-a-series-of-unique-random-numbers

    I'm not sure but something in my backhead is screaming that there is a "random" extension in the uComponents package...But I must admit that I'm not entirely sure. Suffering from bad memory here...:-)

    /Jan

  • Probocop 51 posts 71 karma points
    Jan 17, 2011 @ 14:49
    Probocop
    0

    Hi Jan,

    Thanks for your response, I did a quick Google and there is indeed a 'random' extension in uComponents! - http://ucomponents.codeplex.com/wikipage?title=Xml&version=4

    Thanks for the help,

    Dave

Please Sign in or register to post replies

Write your reply to:

Draft