Category Archives: xslt

XSLT display random row in SharePoint

Today I was updating a web site for a customer. They needed new web part in SharePoint do display random content. As i eventually figured out this was quite easy to do:

<xsl:variable name=”highlight” select=”ddwrt:Random(1,count($Rows))” />
<xsl:for-each select=”$Rows[position()=$highlight]”>

(I googled the code in: http://blog.allyis.com/blog/bid/29519/Randomly-Displayed-Content-in-SharePoint)