Link to Slide Show from Pictures DVWP Rollup 

Tags: Pre SharePoint 2010, SharePoint Designer

In addition to the blog rollup’s (see previous post), I am rolling up my top-level picture folders in a picture library called Pictures.  We thought the best user experience would be viewing the slide shows of a particular library.  I was adding a label of “In the Photo Album menu, click Actions > View Slide Show”, but the menu is hard to find, and jeez, Andy, can’t you just make the link go straight to the slide show instead of linking to the thumbnails?  Well, the answer is “yes”.

There is a slideshow.aspx page in the Forms subfolder of picture libraries.  It takes a query-string parameter named RootFolder to know where to start.  Since all my “albums” are one level deep (no nesting of folders), the items returned by the data source are all we need.  @FileRef field contains the “URL Path” of the item.  So the link of our <a> tag generated by the DataForm WebPart’s XSL needs to look something line /Pictures/Forms/slideshow.aspx&RootFolder={@FileRef}.    After some playing around, this does the trick:

  <a target="_blank" title="View slide show in new window">

    <xsl:attribute name="href">

      <xsl:value-of select="concat('/Pictures/Forms/slidshow.aspx?ViewStyle=slideshow&amp;RootFolder=',@FileRef)" />


    <xsl:value-of select="@Title" />


I still like the idea of having the thumbnail, so I added

<a href="{@FileRef}"><img border="0" src="/_layouts/images/DETAIL.GIF" title="View Thumbnails"/></a>&#160;

before the slideshow link within the same column.  Note that &nbps; must be explicitly defined in XSL.  Using &#160; instead is easier.  Detail.gif is OOTB SharePoint graphic that seemed to capture the idea of a grid of thumbnails.

To round it all out, I show the created date sans time stamp of the album, right justified in the second column:

<xsl:value-of select="ddwrt:FormatDate(string(@Created), 1033, 1)"/>
Posted by AndyGett on 30-Sep-08
1 Comments  |  Trackback Url | Bookmark this post with:        


François commented on Thursday, 5-May-2011
Hi Andy, Do you know how to fix time between each pictures in slideshow through url parameters? Example: slidshow.aspx?ViewStyle=slideshow&Delay=3seconds Thanks for your help! François