<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dave Cavins &#187; xsl</title>
	<atom:link href="http://davecavins.com/tag/xsl/feed/" rel="self" type="application/rss+xml" />
	<link>http://davecavins.com</link>
	<description>web design, SharePoint customization &#38; random stuff</description>
	<lastBuildDate>Mon, 14 Jun 2010 18:48:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>CSS-Tricks AnythingSlider in SharePoint</title>
		<link>http://davecavins.com/2009/12/css-tricks-anythingslider-in-sharepoint/</link>
		<comments>http://davecavins.com/2009/12/css-tricks-anythingslider-in-sharepoint/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 20:10:42 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS-Tricks]]></category>
		<category><![CDATA[Data View Web Part]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[xsl]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=366</guid>
		<description><![CDATA[Chris Coyier from CSS-Tricks built this really cool jQuery plugin that creates a content slider that will support any regular HTML in the slides. This is cool because many sliders I have used had limitations on what could be on the slides and did not offer many of the featuers the AnythingSlider does. Setup To [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/04/anything-slider-in-sharepoint-update/' rel='bookmark' title='Permanent Link: Anything Slider in SharePoint &#8211; Update'>Anything Slider in SharePoint &#8211; Update</a></li>
<li><a href='http://davecavins.com/2010/01/displaying-a-rotating-header-image-with-caption/' rel='bookmark' title='Permanent Link: Displaying a rotating header image with caption'>Displaying a rotating header image with caption</a></li>
<li><a href='http://davecavins.com/2009/05/dynamic-drive-featured-content-slider-v24-in-sharepoint/' rel='bookmark' title='Permanent Link: Dynamic Drive&#8217;s Featured Content Slider in Sharepoint'>Dynamic Drive&#8217;s Featured Content Slider in Sharepoint</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Chris Coyier from <a rel="nofollow" href="http://css-tricks.com/">CSS-Tricks</a> built this <a rel="nofollow" href="http://css-tricks.com/anythingslider-jquery-plugin/">really cool jQuery plugin</a> that creates a content slider that will support any regular HTML in the slides. This is cool because many sliders I have used had limitations on what could be on the slides and did not offer many of the featuers the AnythingSlider does.</p>
<div id="attachment_369" class="wp-caption aligncenter" style="width: 560px"><img class="size-full wp-image-369" title="slider" src="http://davecavins.com/wp-content/uploads/2009/12/slider.gif" alt="AnythingSlider in SharePoint" width="550" height="297" /><p class="wp-caption-text">AnythingSlider in SharePoint</p></div>
<h3>Setup</h3>
<p>To get this working in SharePoint you will need to make sure you have a reference to jQuery in the page somewhere as well as a list for the slider to read from. For my example I am using an out of the box annoucements list.  You will also need the files for the plugin <a rel="nofollow" href="http://css-tricks.com/examples/AnythingSlider.zip" title="Anything Slider Download">download the anythingSlider plugin from css-tricks.com.</a></p>
<ul>
<li>In SharePoint Designer add a dataview webpart to the page with any field from your annoucements list.</li>
<li>Switch to code view and find the first &lt;xsl&gt; tag. It should be right after the closing &lt;DatasSources&gt; tag. </li>
<li>Right click on the tag and choose &#8220;Select Tag&#8221;. Press delete, don&#8217;t worry we will be adding in our own xsl.</li>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-368" title="xsl" src="http://davecavins.com/wp-content/uploads/2009/12/xsl.jpg" alt="Select the auto generated xsl" width="218" height="216" /></p>
<li>Paste the following xsl into the page where you deleted the code.</li>
<pre class="brush: xml;">
&lt;Xsl&gt;
&lt;xsl:stylesheet xmlns:x=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:d=&quot;http://schemas.microsoft.com/sharepoint/dsp&quot; version=&quot;1.0&quot; exclude-result-prefixes=&quot;xsl msxsl ddwrt&quot; xmlns:ddwrt=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/runtime&quot; xmlns:asp=&quot;http://schemas.microsoft.com/ASPNET/20&quot; xmlns:__designer=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/designer&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot; xmlns:SharePoint=&quot;Microsoft.SharePoint.WebControls&quot; xmlns:ddwrt2=&quot;urn:frontpage:internal&quot;&gt;
	&lt;xsl:output method=&quot;html&quot; indent=&quot;no&quot;/&gt;
	&lt;xsl:decimal-format NaN=&quot;&quot;/&gt;
	&lt;xsl:param name=&quot;dvt_apos&quot;&gt;&amp;apos;&lt;/xsl:param&gt;
	&lt;xsl:variable name=&quot;dvt_1_automode&quot;&gt;0&lt;/xsl:variable&gt;
	&lt;xsl:template match=&quot;/&quot; xmlns:x=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:d=&quot;http://schemas.microsoft.com/sharepoint/dsp&quot; xmlns:asp=&quot;http://schemas.microsoft.com/ASPNET/20&quot; xmlns:__designer=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/designer&quot; xmlns:SharePoint=&quot;Microsoft.SharePoint.WebControls&quot;&gt;
		&lt;xsl:call-template name=&quot;dvt_1&quot;/&gt;
	&lt;/xsl:template&gt;
	&lt;xsl:template name=&quot;dvt_1&quot;&gt;
		&lt;xsl:variable name=&quot;Rows&quot; select=&quot;/dsQueryResponse/Rows/Row&quot; /&gt;
		    &lt;link rel=&quot;stylesheet&quot; href=&quot;css/page.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
    &lt;link rel=&quot;stylesheet&quot; href=&quot;css/slider.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.easing.1.2.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;js/jquery.anythingslider.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt;
        function formatText(index, panel) {
		  return index + &amp;quot;&amp;quot;;
	    }
        $(function () {
            $(&amp;apos;.anythingSlider&amp;apos;).anythingSlider({
                easing: &amp;quot;easeInOutExpo&amp;quot;,
                autoPlay: true,
                delay: 3000,
                startStopped: false,
                animationTime: 600,
                hashTags: true,
                buildNavigation: true,
         	pauseOnHover: true,
     	startText: &amp;quot;Go&amp;quot;,
     	stopText: &amp;quot;Stop&amp;quot;,
	navigationFormatter: formatText
            });
            $(&amp;quot;#slide-jump&amp;quot;).click(function(){
                $(&amp;apos;.anythingSlider&amp;apos;).anythingSlider(6);
            });
        });
    &lt;/script&gt;
&lt;div class=&quot;anythingSlider&quot;&gt;
	&lt;div class=&quot;wrapper&quot;&gt;
		&lt;ul&gt;
		&lt;xsl:call-template name=&quot;dvt_1.body&quot;&gt;
			&lt;xsl:with-param name=&quot;Rows&quot; select=&quot;$Rows&quot; /&gt;
			&lt;/xsl:call-template&gt;
		&lt;/ul&gt;
		    &lt;/div&gt;
        &lt;/div&gt;
	&lt;/xsl:template&gt;
	&lt;xsl:template name=&quot;dvt_1.body&quot;&gt;
		&lt;xsl:param name=&quot;Rows&quot; /&gt;
		&lt;xsl:for-each select=&quot;$Rows&quot;&gt;
			&lt;xsl:call-template name=&quot;dvt_1.rowview&quot; /&gt;
		&lt;/xsl:for-each&gt;
	&lt;/xsl:template&gt;
	&lt;xsl:template name=&quot;dvt_1.rowview&quot;&gt;
		&lt;li&gt;
		&lt;div class=&quot;textSlide&quot;&gt;
&lt;!-- display the item title and a link to the item --&gt;
&lt;h3&gt;&lt;a href=&quot;/{@FileDirRef}/DispForm.aspx?ID={@ID}&quot; title=&quot;{@Title}&quot;&gt;&lt;xsl:value-of select=&quot;@Title&quot; /&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;!-- display the body of the item  --&gt;
	&lt;xsl:value-of select=&quot;@Body&quot; disable-output-escaping=&quot;yes&quot; /&gt;
	&lt;/div&gt;
	&lt;/li&gt;&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
&lt;/Xsl&gt;
</pre>
<li><strong>Important:</strong> Adjust the links on the code so that point to your local copies of the css easing and plugin files.</li>
</ul>
<h3>Notes</h3>
<p> I made a few small changes in the css file to make things work better with SharePoint.  In page.css file I deleted several of the classes so they would not interfere with SharePoint&#8217;s styles.  In the xsl I used a div with a class of  .textslide to wrap the content so I had to change that in page.css as well.  To keep long annoucements from breaking the design I set the overflow on the .textslide div to hidden. Below is the code I used in page.css.  </p>
<pre class="brush: css;">
/*hide content that is too long */
.textSlide { padding: 10px 30px; overflow:hidden; }
.textSlide h3  { font: 20px Georgia, Serif; margin-bottom:12px; }
.textSlide h4  { text-transform: uppercase; font: 15px Georgia, Serif; margin: 10px 0; }
.textSlide ul  { list-style: disc; margin: 0 0 0 25px; }
.textSlide ul li  { display: list-item; }
</pre>
<p> I did not make any changes to slider.css. It may be easier to just combine the tow files to keep things simple and reduce page load times.</p>
<h3>Conclusion</h3>
<p>The AnythingSlider plugin is lightweight, powerful and easy to customize.  Adding this type of functionality that is common on regular websites to a SharePoint site can help guide users to important information and of course make your site &#8216;cooler&#8217; than the average SharePoint site. </p>
<p>The code above just shows all the items in the list but once you have it working it is easy to add your own sort/filter parameters to the data view so only certain items are shown. </p>
<p>The slider could also be implemented to run off of the SharePoint list web service <a href="http://davecavins.com/2009/07/annoucement-slider-using-web-services/" target="_blank" title="Annoucements Slider using SP Web Services">the same way I did in this post</a>.  If you have any questions or comments feel free to post.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/04/anything-slider-in-sharepoint-update/' rel='bookmark' title='Permanent Link: Anything Slider in SharePoint &#8211; Update'>Anything Slider in SharePoint &#8211; Update</a></li>
<li><a href='http://davecavins.com/2010/01/displaying-a-rotating-header-image-with-caption/' rel='bookmark' title='Permanent Link: Displaying a rotating header image with caption'>Displaying a rotating header image with caption</a></li>
<li><a href='http://davecavins.com/2009/05/dynamic-drive-featured-content-slider-v24-in-sharepoint/' rel='bookmark' title='Permanent Link: Dynamic Drive&#8217;s Featured Content Slider in Sharepoint'>Dynamic Drive&#8217;s Featured Content Slider in Sharepoint</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/12/css-tricks-anythingslider-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Limitations of displaying attachments in DVWP</title>
		<link>http://davecavins.com/2009/09/limitations-of-displaying-attachments-in-dvwp/</link>
		<comments>http://davecavins.com/2009/09/limitations-of-displaying-attachments-in-dvwp/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 14:51:06 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[attachments]]></category>
		<category><![CDATA[Data View Web Part]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[xsl]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=213</guid>
		<description><![CDATA[So on a recent project I needed to show a link to the attachment for each item in a list. A quick Google search found How to show Attachments with DataFormWebPart from Dario Martirani Paolillo&#8217;s Web Log. I was excited because it seemed to work well and was very easy to implement.  As I was about [...]


Related posts:<ol><li><a href='http://davecavins.com/2009/12/displaying-document-titles-as-links/' rel='bookmark' title='Permanent Link: Displaying document titles as links.'>Displaying document titles as links.</a></li>
<li><a href='http://davecavins.com/2010/01/displaying-a-rotating-header-image-with-caption/' rel='bookmark' title='Permanent Link: Displaying a rotating header image with caption'>Displaying a rotating header image with caption</a></li>
<li><a href='http://davecavins.com/2009/12/updating-the-people-picker/' rel='bookmark' title='Permanent Link: Updating the People Picker'>Updating the People Picker</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://davecavins.com/wp-content/uploads/2009/09/Paper-Clip-128x128.png"><img class="alignright size-full wp-image-214" title="attachments" src="http://davecavins.com/wp-content/uploads/2009/09/Paper-Clip-128x128.png" alt="attachments" width="128" height="128" /></a>So on a recent project I needed to show a link to the attachment for each item in a list. A quick Google search found <a href="http://blogs.msdn.com/dmp/archive/2009/01/21/how-to-show-attachments-with-dataformwebpart.aspx" target="_blank">How to show Attachments with DataFormWebPart</a> from Dario Martirani Paolillo&#8217;s Web Log. I was excited because it seemed to work well and was very easy to implement. </p>
<p>As I was about to finish up the project I was given some new requirements which meant that there would be two Data View Web Parts on the page and both would need to show the attachments link.  This is when the issues started.  When you have two web parts on the page using the display attachments code the second one will just show &#8220;[value of field: Attachments]&#8221; instead of the actual link.  If anyone knows a good solution for this issue please post a comment.</p>
<p>I want to avoid using something like this <a href="http://www.endusersharepoint.com/2009/02/12/jquery-for-everyone-linking-the-attachment-icon/" target="_blank">jQuery solution by Paul Grenier</a> simply because of the performance issues it will create.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2009/12/displaying-document-titles-as-links/' rel='bookmark' title='Permanent Link: Displaying document titles as links.'>Displaying document titles as links.</a></li>
<li><a href='http://davecavins.com/2010/01/displaying-a-rotating-header-image-with-caption/' rel='bookmark' title='Permanent Link: Displaying a rotating header image with caption'>Displaying a rotating header image with caption</a></li>
<li><a href='http://davecavins.com/2009/12/updating-the-people-picker/' rel='bookmark' title='Permanent Link: Updating the People Picker'>Updating the People Picker</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/09/limitations-of-displaying-attachments-in-dvwp/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Dynamic Drive&#8217;s Featured Content Slider in Sharepoint</title>
		<link>http://davecavins.com/2009/05/dynamic-drive-featured-content-slider-v24-in-sharepoint/</link>
		<comments>http://davecavins.com/2009/05/dynamic-drive-featured-content-slider-v24-in-sharepoint/#comments</comments>
		<pubDate>Tue, 12 May 2009 18:39:56 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[content slider]]></category>
		<category><![CDATA[dynamic drive]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint Designer]]></category>
		<category><![CDATA[xsl]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=11</guid>
		<description><![CDATA[I have used Dynamic Drive&#8217;s Featured Content Slider on a couple of recent projects and wanted to see if I could get it working in SharePoint. There were several key requirements: User can easily add items Users  can choose a style for each item Expired Items must not show Each item will have a Title, Body [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/04/anything-slider-in-sharepoint-update/' rel='bookmark' title='Permanent Link: Anything Slider in SharePoint &#8211; Update'>Anything Slider in SharePoint &#8211; Update</a></li>
<li><a href='http://davecavins.com/2009/12/css-tricks-anythingslider-in-sharepoint/' rel='bookmark' title='Permanent Link: CSS-Tricks AnythingSlider in SharePoint'>CSS-Tricks AnythingSlider in SharePoint</a></li>
<li><a href='http://davecavins.com/2009/07/annoucement-slider-using-web-services/' rel='bookmark' title='Permanent Link: Annoucements Slider using SP Web Services'>Annoucements Slider using SP Web Services</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I have used <a href="http://www.dynamicdrive.com/dynamicindex17/featuredcontentslider.htm" target="_blank">Dynamic Drive&#8217;s Featured Content Slider</a> on a couple of recent projects and wanted to see if I could get it working in SharePoint. There were several key requirements:</p>
<ol>
<li>User can easily add items</li>
<li>Users  can choose a style for each item</li>
<li>Expired Items must not show</li>
<li>Each item will have a Title, Body and a customizable &#8220;read more&#8221; link.</li>
</ol>
<p>Here&#8217;s how I did it.</p>
<p><img class="alignnone size-full wp-image-155" title="slider" src="http://davecavins.com/wp-content/uploads/2009/05/slider.jpg" alt="slider" width="596" height="242" /> </p>
<p>First I created a custom list to store the slider items.  These are the columns I used:</p>
<p>Title &#8211; Single Line of text<br />
Body &#8211; Multiple Lines of text<br />
Link URL &#8211; HyperLink<br />
Expiration &#8211; Date and Time (expired items will not be shown)<br />
Image &#8211; Picture<br />
Style &#8211; Choice  (we will use this column to allow users to choose the style of each item)</p>
<p>On the page I used a DataView WebPart to display the Title, Body, Image and Link URL columns.   Using Sharepoint Designer I setup filtering on the expiration date.  To do this in design view right click on the data view webpart and bring up the &#8220;Common Data View Tasks &#8221; box and choose Filter.  In the window I set the conditional statement so that items would only be shown if the expiration date was greater than today.<span id="more-11"></span></p>
<p>You can find a basic tutorial on using the DVWP <a href="http://www.endusersharepoint.com/?p=1629" target="_blank">here</a></p>
<p>Once we have the data we want showing on the page we need to get it into the right format.  For the Content Slider to work properly the page needs to refernce an external JavaScript file and a CSS style sheet. Additionally the Slider itself has to follow this pattern:</p>
<pre class="brush: xml;">
&lt;div id=&quot;slider1&quot; class=&quot;sliderwrapper&quot;&gt;
&lt;div class=&quot;contentdiv&quot;&gt;Content 1 Here.
&lt;/div&gt;
&lt;div id=&quot;paginate-slider1&quot; class=&quot;pagination&quot;&gt;&lt;/div&gt;
</pre>
<p>Basically the whole content slider has do be wrapped in a div with an ID of &#8216;slider1&#8242;  each of the items must be wrapped in a div with the class &#8216;contentdiv&#8217;.  For more explanation on this <a href="http://www.dynamicdrive.com/dynamicindex17/featuredcontentslider.htm" target="_blank">visit Dynamic Drive</a></p>
<p>SharePoint uses xsl to style the data view so we have to go into the code view and add the nessecary Javascript, CSS and div elements to make everything work. Here is the xsl I used to get everything working in the page</p>
<pre class="brush: xml;">
&lt;Xsl&gt;
&lt;xsl:stylesheet xmlns:x=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:d=&quot;http://schemas.microsoft.com/sharepoint/dsp&quot; version=&quot;1.0&quot; exclude-result-prefixes=&quot;xsl msxsl ddwrt&quot; xmlns:ddwrt=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/runtime&quot; xmlns:asp=&quot;http://schemas.microsoft.com/ASPNET/20&quot; xmlns:__designer=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/designer&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot; xmlns:SharePoint=&quot;Microsoft.SharePoint.WebControls&quot; xmlns:ddwrt2=&quot;urn:frontpage:internal&quot;&gt;
	&lt;xsl:output method=&quot;html&quot; indent=&quot;no&quot;/&gt;
	&lt;xsl:decimal-format NaN=&quot;&quot;/&gt;
	&lt;xsl:param name=&quot;dvt_apos&quot;&gt;&amp;apos;&lt;/xsl:param&gt;
	&lt;xsl:param name=&quot;Today&quot;&gt;CurrentDate&lt;/xsl:param&gt;
	&lt;xsl:variable name=&quot;dvt_1_automode&quot;&gt;0&lt;/xsl:variable&gt;
	&lt;xsl:template match=&quot;/&quot; xmlns:x=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:d=&quot;http://schemas.microsoft.com/sharepoint/dsp&quot; xmlns:asp=&quot;http://schemas.microsoft.com/ASPNET/20&quot; xmlns:__designer=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/designer&quot; xmlns:SharePoint=&quot;Microsoft.SharePoint.WebControls&quot;&gt;
		&lt;xsl:call-template name=&quot;dvt_1&quot;/&gt;
	&lt;/xsl:template&gt;
	&lt;xsl:template name=&quot;dvt_1&quot;&gt;
		&lt;xsl:variable name=&quot;dvt_StyleName&quot;&gt;Table&lt;/xsl:variable&gt;
		&lt;xsl:variable name=&quot;Rows&quot; select=&quot;/dsQueryResponse/Rows/Row&quot; /&gt;
		&lt;div id=&quot;slider1&quot; class=&quot;sliderwrapper&quot;&gt;
			&lt;xsl:call-template name=&quot;dvt_1.body&quot;&gt;
				&lt;xsl:with-param name=&quot;Rows&quot; select=&quot;$Rows&quot; /&gt;
			&lt;/xsl:call-template&gt;
		&lt;/div&gt;
		&lt;div id=&quot;paginate-slider1&quot; class=&quot;pagination&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
featuredcontentslider.init({
	id: &quot;slider1&quot;,  //id of main slider DIV
	contentsource: [&quot;inline&quot;, &quot;&quot;],
	toc: &quot;#increment&quot;,  //Valid values: &quot;#increment&quot;, &quot;markup&quot;, [&quot;label1&quot;, &quot;label2&quot;, etc]
	nextprev: [&quot;Previous&quot;, &quot;Next&quot;],
	revealtype: &quot;click&quot;,
	enablefade: [true, 0.2],  //[true/false, fadedegree]
	autorotate: [true, 3000],  //[true/false, pausetime]
	onChange: function(previndex, curindex){  //event handler fired whenever script changes
		//previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
		//curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
	}
})
&lt;/script&gt; &lt;/xsl:template&gt;
	&lt;xsl:template name=&quot;dvt_1.body&quot;&gt;
		&lt;xsl:param name=&quot;Rows&quot; /&gt;
		&lt;xsl:for-each select=&quot;$Rows&quot;&gt;
			&lt;xsl:call-template name=&quot;dvt_1.rowview&quot; /&gt;
		&lt;/xsl:for-each&gt;
	&lt;/xsl:template&gt;
	&lt;xsl:template name=&quot;dvt_1.rowview&quot;&gt;
		&lt;div class=&quot;contentdiv&quot;&gt;
		&lt;div class=&quot;{@Style}&quot;&gt;
		&lt;img border=&quot;0&quot; align=&quot;left&quot; hspace=&quot;0&quot; vspace=&quot;0&quot; alt=&quot;{substring-after(@Image, ', ')}&quot; src=&quot;{substring-before(@Image, ', ')}&quot; /&gt;
	&lt;a href=&quot;{substring-before(@Link_x0020_URL, ', ')}&quot; title=&quot;{@Title}&quot;&gt;
	&lt;h1&gt;&lt;xsl:value-of select=&quot;@Title&quot; /&gt;&lt;/h1&gt;&lt;/a&gt;
	&lt;p&gt;&lt;xsl:value-of select=&quot;substring(@Body,1,330)&quot;/&gt;...&lt;/p&gt;
	&lt;a href=&quot;{substring-before(@Link_x0020_URL, ', ')}&quot; class=&quot;readMoreLink&quot; title=&quot;{substring-after(@Link_x0020_URL, ', ')}&quot;&gt;
	&lt;span class=&quot;readMoreIcon&quot;&gt;&lt;xsl:value-of select=&quot;substring-after(@Link_x0020_URL, ', ')&quot; /&gt;&lt;/span&gt;
	&lt;/a&gt;
	&lt;/div&gt;
	&lt;/div&gt;&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
&lt;/Xsl&gt;
</pre>
<p>For information on how to write xsl stylesheets read <a href="http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx">this post</a> on Heather Solomon&#8217;s site. Basically using tags like this:<br />
allows you to insert various peices of data from the list. In the xsl above I am wrapping each item with the nessacary div to make the slider work. Inside each div I am inserting the title inside an h1 tag, the first 330 characters of the body in an a p tag, and the Link URL formatted as a Hyperlink.</p>
<p>To make everything look good I had to customize the CSS that comes from Dynamic Drive. The code is below.</p>
<pre class="brush: css;">
.sliderwrapper{
position: relative; /*leave as is*/
overflow: hidden; /*leave as is*/
border: 0px;
width: 100%; /*width of featured content slider*/
height: 231px;
}
.sliderwrapper .contentdiv{
visibility:hidden; /*leave as is*/
position:absolute; /*leave as is*/
left:0;  /*leave as is*/
top:0;  /*leave as is*/
padding: 0px;
background:#fff;
width:100%;
/*width of content DIVs within slider. Total width should equal slider's inner width (390+5+5=400) */
height:100%;
filter:progid:DXImageTransform.Microsoft.alpha(opacity=100);
-moz-opacity:1;
opacity:1;
color:#fff;
font-size:x-small;
}
.contentdiv img{
height:205px;
width:270px;
margin:10px;
border:1px solid #ccc;
}
.contentdiv h1{
color:#eee;
font:normal normal large Georgia;
margin:0px;
padding:5px 0 0 0;
line-height:20px
}
.contentdiv a:hover, .contentdiv a{
text-decoration:none !important;
padding:0px;
}
.contentdiv p{
line-height:19px;
padding:0px 10px 0px 10px;
}
a.readMoreLink {
color:#555;
padding:4px;
background-color:#fff;
}
a.readMoreLink:hover {
color:#555;
text-decoration:none;
padding:4px;
background:#fff url('link_bg.gif') repeat-x bottom center;
}
.pagination{
width: 100%;
/*Width of pagination DIV. Total width should equal slider's outer width (400+10+10=420)*/
text-align: right;
padding: 3px 1px;
font-size:x-small;
background:#fff url('link_bg.gif') repeat-x bottom center;
border-top:1px solid #ccc;
}
.pagination a{
padding: 0 4px;
text-decoration: none;
color: #666;
background:#fff;
}
.pagination a.selected{
color: #fff;
background-color: #666;
}
.pagination a:hover{
color:#fff;
background:#666;
text-decoration:none;
}
</pre>
<p>In the XSL stylesheet each item is wrapped in a div, the class name for the div is pulled from the &#8216;Style&#8217; column in the list. The make the styles work I added the following CSS to my stylesheet</p>
<pre class="brush: css;">
.Red_Style{
height:230px;
background:#671818 url('red_bg.gif') repeat-x top center;
}
.Blue_Style{
height:230px;
background:#3A5E97 url('blue_bg.gif') repeat-x top center;
}
.Green_Style{
height:230px;
background:#4E8822 url('green_bg.gif') repeat-x top center;
}
</pre>
<p>All I am doing is changing the background image and color for each style. Because the div wraps each item it would be possible to also change font colors, font size, image position and more but I just wanted to keep it simple.</p>
<p>The only drawback with using the dataview webpart is that this webpart cannot be easily moved from one site to another.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/04/anything-slider-in-sharepoint-update/' rel='bookmark' title='Permanent Link: Anything Slider in SharePoint &#8211; Update'>Anything Slider in SharePoint &#8211; Update</a></li>
<li><a href='http://davecavins.com/2009/12/css-tricks-anythingslider-in-sharepoint/' rel='bookmark' title='Permanent Link: CSS-Tricks AnythingSlider in SharePoint'>CSS-Tricks AnythingSlider in SharePoint</a></li>
<li><a href='http://davecavins.com/2009/07/annoucement-slider-using-web-services/' rel='bookmark' title='Permanent Link: Annoucements Slider using SP Web Services'>Annoucements Slider using SP Web Services</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/05/dynamic-drive-featured-content-slider-v24-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
