Recently I’d a requirement to create a slideshow in SharePoint 2007 and content query web part is great for these types of scenarios where a list has to be query and list items are to be rendered with some HTML. There are a lot of great jQuery plugins available for slideshow, we’ll be using jQuery.Popeye. You can use the following steps to use any other plugin if you like, okay so let’s get started.
- Download jQuery and jQuery.Popeye plugin
- Go to Style Library, open with explorer and paste jQuery.Popeye folder from the downloaded archive along with jquery-1.8.1.min.js
- Create a Picture Library and upload images that you’d like to be displayed in Slide Show.
- We’ve to create a new XSL template which will generated the necessary HTML for slide show so open the site in SharePoint Designer and then navigate to All Files, Style Library, XSL Style Sheets, make copy of ItemStyle.xsl and then edit ItemStyle.xsl
- Go to bottom of the file and paste the following XSL before </xsl:stylesheet>
<xsl:template name="PopeyeSlideShow" match="Row[@Style='PopeyeSlideShow']" mode="itemstyle">
<xsl:variable name="DisplayTitle">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@Title"/>
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable><xsl:variable name="SafeLinkUrl">
<xsl:call-template name="OuterTemplate.GetSafeLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable><xsl:variable name="Header">
<xsl:if test="count(preceding-sibling::*)=0">
<![CDATA[
<div id="ppy1">
<ul>
]]>
</xsl:if>
</xsl:variable><xsl:variable name="Footer">
<xsl:if test="count(following-sibling::*)=0">
<![CDATA[
</ul>
<div>
<div>
<!--<div>
<strong></strong>
</div>-->
</div>
<div>
<a title="Previous image">Previous Image</a>
<a title="Enlarge">Enlarge</a>
<a title="Close">Close</a>
<a title="Next image">Next Image</a>
</div>
</div>
</div>
]]>
</xsl:if>
</xsl:variable><xsl:value-of select="$Header" disable-output-escaping="yes" />
<li>
<a>
<xsl:attribute name="href">
<xsl:value-of select="$SafeLinkUrl"></xsl:value-of>
</xsl:attribute>
<img>
<xsl:attribute name="src">
<xsl:value-of select="$SafeLinkUrl"></xsl:value-of>
</xsl:attribute>
</img>
</a>
</li>
<xsl:value-of select="$Footer" disable-output-escaping="yes" />
</xsl:template> - Create a new page, drop content query web part, edit web part, collapse query section, select show items from following list and select the library you created in Step 4, also select picture library as List Type.
- Collapse presentation section and select PopeyeSlideShow as ItemStyle so that the HTML we wrote while creating XSL template in step 5 is applied while rendering images returned.
- Now all that’s missing is to include CSS for this plugin along with including references to JavaScripts and then finally calling the plugin so let’s add this now.
- Now again open SharePoint Designer, go to All Files, Style library and create a new js file, name it jquery.popeye.loader.js, edit it and paste the following
<link type="text/css" rel="stylesheet" href="/Style%20Library/jQuery.popeye/css/popeye/jquery.popeye.css" media="screen" >
<link type="text/css" rel="stylesheet" href="/Style%20Library/jQuery.popeye/css/popeye/jquery.popeye.style.css" media="screen" >
<script src="/Style%20Library/jquery-1.7.2.min.js"></script>
<script src="/Style%20Library/jQuery.popeye/lib/popeye/jquery.popeye-2.1.min.js"></script>
<script type="text/javascript">
<!--
$(function(){
$("#ppy1").popeye({
autoslide:true
});
});
//-->
</script>
- Now edit the page which we created in step 6 and drop content editor web part so we can include jquery.popeye.loader.js. Modify the shared web part and enter /Style%20Library/jquery.popeye.loader.js in the content link box, test the link and then click ok
Now you should have something like the following image.
Hope you find this post useful, thanks for reading.






September 28th, 2012 at 7:27 pm
really nice!
September 28th, 2012 at 8:19 pm
Thanks Laeeq
December 7th, 2012 at 8:19 pm
For most recent news you have to pay a quick visit web and on internet
I found this web site as a best site for newest updates.
January 9th, 2013 at 11:34 pm
I followed your instruction but it is not working….. The itemstyle is render but the css has not been applied. Did you miss a step ??
Thanks
February 3rd, 2013 at 12:36 pm
I personally wanted to share this specific posting, “10 easy steps to create an
elegant jQuery slide show in SharePoint 2007 using Content Query Web Part Khurram Punjwani’s technology blog” along with my own pals on facebook or twitter. I reallymerely planned to disperse ur superb writing! Many thanks, Maggie
May 5th, 2013 at 7:19 pm
These plants also have an ability which stimulates disinfection , helps
calm the stomach and reduce gas and swelling. Mega-T Green Tea contains natural ingredients that not only helps you
burn the fats but also help you with your constitution so burning more calories to give that extra energy you must keep up with your
hectic way of life. Since there is no single excess weight reduction supplement that can actually support
everybody shed undesirable weight with no any kinds of adverse effects.
May 7th, 2013 at 12:23 pm
lne interesy. Raz wmawiał samemu, że owo krętactwo.
Frodo http://www.kmdi.com.au syknął z bólu. Osiągnął zbyt dużo ziemi, chciał zapełnić jeszcze krótkie
zagłębienie, które zaistniało w czasie udeptywania. Jednakże ponaciągane mięśnie odmówiły
posłuszeństwa, trzonek skręcił się w dłoniach. Niziołek odrzucił łopatę, zaczął
rozcierać przedramię.
- Co właśnie stoisz! – warknął. – Co, zatkało? Mi.