<?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; SharePoint Design</title>
	<atom:link href="http://davecavins.com/category/sharepoint-design/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>Switch Themes Without a Page Refresh: Part 2</title>
		<link>http://davecavins.com/2010/06/switch-styles-in-sharepoint-with-jquery/</link>
		<comments>http://davecavins.com/2010/06/switch-styles-in-sharepoint-with-jquery/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 14:50:09 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint Designer]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=506</guid>
		<description><![CDATA[ So in part one of this post we got all the CSS and other theme file we needed to stuck them in a document library. With JavaScript you can change the CSS file a page uses without requiring a page refresh.  I have used this technique many times on non-SharePoint sites but there are some [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/06/switch-themes-without-a-page-refresh-part-1/' rel='bookmark' title='Permanent Link: Switch Themes Without a Page Refresh: Part 1'>Switch Themes Without a Page Refresh: Part 1</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>
<li><a href='http://davecavins.com/2010/04/switch-list-displays-with-jquery-and-css/' rel='bookmark' title='Permanent Link: Switch List Displays with JQuery and CSS'>Switch List Displays with JQuery and CSS</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p> So in <a href="http://davecavins.com/2010/06/switch-themes-without-a-page-refresh-part-1/" target="_blank">part one of this post </a>we got all the CSS and other theme file we needed to stuck them in a document library.</p>
<p>With JavaScript you can change the CSS file a page uses without requiring a page refresh.  I have used this technique many times on non-SharePoint sites but there are some special challenges implementing this in SharePoint.  Most of the scripts I have used in the past use the <a href="http://www.alistapart.com/articles/alternate/" target="_blank">alternate style sheet method as describred by A List Apart here</a>. That method works fine but I had to find another way because I was already using that script to allow users to change the font size. After some research I found <a href="http://www.cssnewbie.com/example/stylesheet-switcher/" target="_blank">this script from CSS Newbie</a> that worked pretty well without using alternate style sheets.</p>
<h2>The problem</h2>
<p>While the script works just fine on regular HTML pages it cause problems in SharePoint here is why :</p>
<pre class="brush: jscript;"> $(&quot;link&quot;).attr(&quot;href&quot;,$(this).attr('rel')); </pre>
<p>This line of code basically finds all the linked CSS files in the page and changes thier value to point to the new style sheet you select.  This is fine on a site that just uses one CSS file but in SharePoint bad things happen.  In most cases we dont want to completely remove the reference to core.css. For most themes many elements don&#8217;t need to be changed so we only have to write the CSS to change them and let core.css do the rest.  If you remove core.css its like using a global reset (<a href="http://www.visual28.com/articles/css-reset" target="_blank">discussed in more detail here</a>) which means you will have to restyle everything.  So them point is we want to leave core.css in the page and just add our theme. </p>
<p>To do this I had to make some changes to the master page to create to interface users will use to swap themes. </p>
<p><span id="more-506"></span></p>
<h2>Edit the Masterpage</h2>
<p>Here is the code I added to the masterpage. This can be styled to look however you want and can be added anywhere in the page that makes sense.</p>
<pre class="brush: xml;">
&lt;ul&gt;
	&lt;li&gt;&lt;a rel=&quot;&quot; href=&quot;#&quot;&gt;Reset CSS&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a rel=&quot;/Site Styles/Verdant/theme.css&quot; href=&quot;#&quot;&gt;Verdant&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a rel=&quot;/Site Styles/Belltown/theme.css&quot; href=&quot;#&quot;&gt;Belltown&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a rel=&quot;/Site Styles/Petal/theme.css&quot; href=&quot;#&quot;&gt;Petal&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>In addition to this we also need to add a link to our css file to the master page. I put it at the end of the head section.  </p>
<pre class="brush: xml;"> &lt;link class=&quot;altStyle&quot; href=&quot;&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot;/&gt;</pre>
<p>I added a class to the link so that we can use jQuery to target only that css link and change it to match the theme the user selects. Initially I left the href value blank but if you want to apply some default styles you would just add the link to the css file there.</p>
<h2>Use jQuery to Swap the CSS</h2>
<p>So here is the code I used to swap the stylesheet. The main thing I changed is on lines 7 and 12.  I changed the selector so it will only target &lt;link&gt; tags with a class of &#8216;altStyle&#8217;.  This allows us to swap themes without breaking the link to core.css.</p>
<pre class="brush: jscript;"> &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;

&lt;script src=&quot;cookie.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt; 

&lt;script type=&quot;text/javascript&quot;&gt;// &lt;![CDATA[
 if($.cookie(&quot;css&quot;)) {
 $(&quot;link.altStyle&quot;).attr(&quot;href&quot;,$.cookie(&quot;css&quot;));
 }
$(document).ready(function() {
//alert( $.cookie(&quot;css&quot;) );
 $(&quot;#nav li a&quot;).click(function() {
 $(&quot;link.altStyle&quot;).attr(&quot;href&quot;,$(this).attr('rel'));
 $.cookie(&quot;css&quot;,$(this).attr('rel'), {expires: 365, path: '/'});
 return false;
 });
});
// ]]&gt;&lt;/script&gt;
</pre>
<h2>Resources</h2>
<ul>
<li>You will need jQuery either locally or linked from Google.  Just update the link on line 1 as needed.</li>
<li>In the code above you will notice a link to <strong>cookie.js</strong>, this is the jQjuery cookie plugin that you will need in order to save users&#8217; theme selections.  In the code above on line 13 you will see where I create a cookie named css.  For testing purposes you can uncomment line 10 to see what the cookie value is on page load.   You can download the plugin from here.  <a href="http://plugins.jquery.com/project/cookie" target="_blank">jQuery Cookie Plugin</a></li>
<li>You can see the original code I started from in <a href="http://www.cssnewbie.com/example/stylesheet-switcher/" target="_blank">this script from CSS Newbie</a></li>
</ul>
<h2>Conclusion</h2>
<p>While this is a very simple solution it is a quick way to add in some fuctionality that many users want without alot of custom code or requiring the user to navigate to multiple pages.  Users like to feel that they have some control over the site (even if its just changing the color).  Feel free to post any questions or comments.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/06/switch-themes-without-a-page-refresh-part-1/' rel='bookmark' title='Permanent Link: Switch Themes Without a Page Refresh: Part 1'>Switch Themes Without a Page Refresh: Part 1</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>
<li><a href='http://davecavins.com/2010/04/switch-list-displays-with-jquery-and-css/' rel='bookmark' title='Permanent Link: Switch List Displays with JQuery and CSS'>Switch List Displays with JQuery and CSS</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2010/06/switch-styles-in-sharepoint-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switch Themes Without a Page Refresh: Part 1</title>
		<link>http://davecavins.com/2010/06/switch-themes-without-a-page-refresh-part-1/</link>
		<comments>http://davecavins.com/2010/06/switch-themes-without-a-page-refresh-part-1/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 19:03:26 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[stylesheet]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=522</guid>
		<description><![CDATA[Many sites offer the ability for users to change the color and style of the site to fit their preference.  SharePoint has this feature to some extend through themes but changing themes is not a very simple process and requires browsing to several pages.  With JavaScript you can change the CSS file a page uses [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/06/switch-styles-in-sharepoint-with-jquery/' rel='bookmark' title='Permanent Link: Switch Themes Without a Page Refresh: Part 2'>Switch Themes Without a Page Refresh: Part 2</a></li>
<li><a href='http://davecavins.com/2009/02/adding-stuff-to-the-page-head-the-easy-way/' rel='bookmark' title='Permanent Link: Adding references to the page head: the easy way'>Adding references to the page head: the easy way</a></li>
<li><a href='http://davecavins.com/2009/07/styling-the-moss-horizontal-navigation-menu/' rel='bookmark' title='Permanent Link: Styling the MOSS horizontal navigation menu'>Styling the MOSS horizontal navigation menu</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Many sites offer the ability for users to change the color and style of the site to fit their preference.  SharePoint has this feature to some extend through themes but changing themes is not a very simple process and requires browsing to several pages. </p>
<p>With JavaScript you can change the CSS file a page uses without requiring a page refresh.  I have used this technique many times on non-SharePoint sites but there are some special challenges implementing this in SharePoint.  For this solution there were several requirements.</p>
<ul>
<li>Users need to be able to switch themes and have the setting saved</li>
<li>No page refresh</li>
<li>Should be able to use both out of the box themes and custom themes</li>
</ul>
<p>So first I needed to get the CSS files and images for the themes I wanted to use.  When you assign a theme to a site all the files for the theme are copied to a folder named <strong>_themes</strong> in the root of the site. </p>
<div id="attachment_524" class="wp-caption alignnone" style="width: 143px"><img class="size-full wp-image-524" title="themesfolder" src="http://davecavins.com/wp-content/uploads/2010/06/themesfolder.jpg" alt="" width="133" height="92" /><p class="wp-caption-text">_themes folder</p></div>
<p>So what I did was assign each theme I wanted to use to the site one at a time.  With SharePoint designer I copied the files folders for each theme into a document library called <strong>Site Styles</strong>.  Each folder contains all the resources needed or the theme to work. </p>
<p>Here is what I ended up with</p>
<div id="attachment_523" class="wp-caption alignnone" style="width: 164px"><img class="size-full wp-image-523" title="themes" src="http://davecavins.com/wp-content/uploads/2010/06/themes.jpg" alt="" width="154" height="90" /><p class="wp-caption-text">Site Styles Library</p></div>
<p>If I wanted to create a custom theme I could just add another folder with my custom CSS and images.</p>
<p>This same technique can be used when developing your own custom theme, just copy one that is similar to what you want and use the alternate CSS link on the master page settings page to add it to the site.  Inside of the folder for each theme is a file named theme.css. Link to that file and SharePoint will apply the theme to the site. </p>
<div id="attachment_525" class="wp-caption alignnone" style="width: 384px"><img class="size-full wp-image-525" title="cssurl" src="http://davecavins.com/wp-content/uploads/2010/06/cssurl.jpg" alt="" width="374" height="112" /><p class="wp-caption-text">Alternate CSS URL</p></div>
<p>Now everything we have done so far is pretty basic and easy to do but we will pull all this together with some simple edits to the master page to complete the solution. In part 2 I’ll explain how we use JavaScript to switch styles and set a cookie to remember the users theme choice.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/06/switch-styles-in-sharepoint-with-jquery/' rel='bookmark' title='Permanent Link: Switch Themes Without a Page Refresh: Part 2'>Switch Themes Without a Page Refresh: Part 2</a></li>
<li><a href='http://davecavins.com/2009/02/adding-stuff-to-the-page-head-the-easy-way/' rel='bookmark' title='Permanent Link: Adding references to the page head: the easy way'>Adding references to the page head: the easy way</a></li>
<li><a href='http://davecavins.com/2009/07/styling-the-moss-horizontal-navigation-menu/' rel='bookmark' title='Permanent Link: Styling the MOSS horizontal navigation menu'>Styling the MOSS horizontal navigation menu</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2010/06/switch-themes-without-a-page-refresh-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Anything Slider in SharePoint &#8211; Update</title>
		<link>http://davecavins.com/2010/04/anything-slider-in-sharepoint-update/</link>
		<comments>http://davecavins.com/2010/04/anything-slider-in-sharepoint-update/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 17:49:05 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[CSS-Tricks]]></category>
		<category><![CDATA[javasc]]></category>
		<category><![CDATA[SharePoint Designer]]></category>
		<category><![CDATA[slider]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=497</guid>
		<description><![CDATA[Several people have asked how to change the under of items displayed in the slider and how to change the sort order. Item Limit To change the number of items displayed use the code below. &#60;Xsl&#62; &#60;xsl:stylesheet xmlns:x=&#34;http://www.w3.org/2001/XMLSchema&#34; xmlns:d=&#34;http://schemas.microsoft.com/sharepoint/dsp&#34; version=&#34;1.0&#34; exclude-result-prefixes=&#34;xsl msxsl ddwrt&#34; xmlns:ddwrt=&#34;http://schemas.microsoft.com/WebParts/v2/DataView/runtime&#34; xmlns:asp=&#34;http://schemas.microsoft.com/ASPNET/20&#34; xmlns:__designer=&#34;http://schemas.microsoft.com/WebParts/v2/DataView/designer&#34; xmlns:xsl=&#34;http://www.w3.org/1999/XSL/Transform&#34; xmlns:msxsl=&#34;urn:schemas-microsoft-com:xslt&#34; xmlns:SharePoint=&#34;Microsoft.SharePoint.WebControls&#34; xmlns:ddwrt2=&#34;urn:frontpage:internal&#34;&#62; &#60;xsl:output method=&#34;html&#34; indent=&#34;no&#34;/&#62; &#60;xsl:decimal-format NaN=&#34;&#34;/&#62; [...]


Related posts:<ol><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/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>
<li><a href='http://davecavins.com/2010/04/switch-list-displays-with-jquery-and-css/' rel='bookmark' title='Permanent Link: Switch List Displays with JQuery and CSS'>Switch List Displays with JQuery and CSS</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Several people have asked how to change the under of items displayed in the slider and how to change the sort order.</p>
<h2>Item Limit</h2>
<p>To change the number of items displayed use the code below.</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: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;xsl:variable name=&quot;RowLimit&quot; select=&quot;3&quot; /&gt;
		&lt;xsl:variable name=&quot;dvt_RowCount&quot; select=&quot;count($Rows)&quot; /&gt;
		&lt;xsl:variable name=&quot;IsEmpty&quot; select=&quot;$dvt_RowCount = 0&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;&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:with-param name=&quot;FirstRow&quot; select=&quot;1&quot; /&gt;
				&lt;xsl:with-param name=&quot;LastRow&quot; select=&quot;$RowLimit&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:param name=&quot;FirstRow&quot; /&gt;
		&lt;xsl:param name=&quot;LastRow&quot; /&gt;
		&lt;xsl:for-each select=&quot;$Rows&quot;&gt;
			&lt;xsl:variable name=&quot;dvt_KeepItemsTogether&quot; select=&quot;false()&quot; /&gt;
			&lt;xsl:variable name=&quot;dvt_HideGroupDetail&quot; select=&quot;false()&quot; /&gt;
			&lt;xsl:if test=&quot;(position() &amp;gt;= $FirstRow and position() &amp;lt;= $LastRow) or $dvt_KeepItemsTogether&quot;&gt;
				&lt;xsl:if test=&quot;not($dvt_HideGroupDetail)&quot; ddwrt:cf_ignore=&quot;1&quot;&gt;
					&lt;xsl:call-template name=&quot;dvt_1.rowview&quot; /&gt;
				&lt;/xsl:if&gt;
			&lt;/xsl:if&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;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;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>
<p>On line 13 change the <strong>RowLimit</strong> to the number of items you would like to show. For example if you wanted to show 6 items you would change line 13 to this</p>
<pre class="brush: plain;">
&lt;xsl:variable name=&quot;RowLimit&quot; select=&quot;6&quot; /&gt;
</pre>
<h2>Sort Order</h2>
<p>Changing the sort order can be done through SharePoint Designer once you are using the updated code</p>
<ul>
<li>Click on the arrow to show the common data view tasks.</li>
<li>Click on &#8216;Sort and Group&#8217; the second option.</li>
<li>Make changes as needed.</li>
</ul>
<p>If dont want to do it that way there is another  option.</p>
<ul>
<li>Open the page in SharePoint Designer</li>
<li>In code view find this &#8216;SharePoint:SPDataSource&#8217; you will need to edit this tag.</li>
<li>Find the SelectCommand and add/edit the OrderBy attibute.</li>
<li>See the code below for an example. (Ordered by Created Date  in Ascending order). Its basically a CAML query.</li>
</ul>
<pre class="brush: plain;">
&lt;SharePoint:SPDataSource runat=&quot;server&quot; DataSourceMode=&quot;List&quot; SelectCommand=&quot;&amp;lt;View&amp;gt;&amp;lt;Query&amp;gt;&amp;lt;OrderBy&amp;gt;&amp;lt;FieldRef Name=&amp;quot;Created_x0020_Date&amp;quot; Ascending=&amp;quot;TRUE&amp;quot;/&amp;gt;&amp;lt;/OrderBy&amp;gt;&amp;lt;/Query&amp;gt;&amp;lt;/View&amp;gt;&quot;
</pre>
<p> If you are not sure how to get it all set up look to <a title="Anything Slider Post 1" href="http://davecavins.com/2009/12/css-tricks-anythingslider-in-sharepoint">my previous post on the Anything Slider</a>.  If you have questions please post a comment.</p>


<p>Related posts:<ol><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/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>
<li><a href='http://davecavins.com/2010/04/switch-list-displays-with-jquery-and-css/' rel='bookmark' title='Permanent Link: Switch List Displays with JQuery and CSS'>Switch List Displays with JQuery and CSS</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2010/04/anything-slider-in-sharepoint-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Comments to a List Part 2</title>
		<link>http://davecavins.com/2010/03/adding-comments-to-a-list-part-2/</link>
		<comments>http://davecavins.com/2010/03/adding-comments-to-a-list-part-2/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 19:28:05 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[comments]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=468</guid>
		<description><![CDATA[So here is what we have done so far from Part 1    Create a custom list to hold our comments Link the list with an Annoucements list using lookup columns Create a page to display a single annoucement and the realted comments from our comments list. This is what it looks like:       All we [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/03/adding-comments-to-a-list-part-1/' rel='bookmark' title='Permanent Link: Adding Comments to a List Part 1'>Adding Comments to a List Part 1</a></li>
<li><a href='http://davecavins.com/2009/10/styling-sharepoint-blog-comments/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments'>Styling SharePoint Blog Comments</a></li>
<li><a href='http://davecavins.com/2009/10/sharepoint-blog-comments-p2/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments: Part 2'>Styling SharePoint Blog Comments: Part 2</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>So here is what we have done so far <a href="http://davecavins.com/2010/03/adding-comments-to-a-list-part-1/">from Part 1</a>   </p>
<ul>
<li>Create a custom list to hold our comments</li>
<li>Link the list with an Annoucements list using lookup columns</li>
<li>Create a page to display a single annoucement and the realted comments from our comments list.</li>
</ul>
<p>This is what it looks like:   </p>
<div id="attachment_469" class="wp-caption aligncenter" style="width: 475px"><a href="http://davecavins.com/wp-content/uploads/2010/03/sofar.jpg"><img class="size-full wp-image-469" title="sofar" src="http://davecavins.com/wp-content/uploads/2010/03/sofar.jpg" alt="" width="465" height="221" /></a><p class="wp-caption-text">What we have so far.</p></div>
<p> </p>
<p> All we need to do now is setup a form on the page to allow users to create new comments on the item they are viewing.   </p>
<p><span id="more-468"></span> </p>
<h2>Adding the New Comment Form</h2>
<p> Open the page in SharePoint Designer and add a Custom List form to the page below the comments list.   </p>
<div id="attachment_470" class="wp-caption aligncenter" style="width: 354px"><img class="size-full wp-image-470" title="insert" src="http://davecavins.com/wp-content/uploads/2010/03/insert.jpg" alt="" width="344" height="191" /><p class="wp-caption-text">Insert a custom list form</p></div>
<p> </p>
<div id="attachment_471" class="wp-caption aligncenter" style="width: 296px"><img class="size-full wp-image-471" title="pop" src="http://davecavins.com/wp-content/uploads/2010/03/pop.jpg" alt="" width="286" height="278" /><p class="wp-caption-text">Choose the comments list and select the new item form option</p></div>
<p> </p>
<p> Your page should look something like this:<a href="http://davecavins.com/wp-content/uploads/2010/03/spd.jpg"><img class="aligncenter size-medium wp-image-472" title="spd" src="http://davecavins.com/wp-content/uploads/2010/03/spd-300x281.jpg" alt="" width="307" height="319" /></a>   </p>
<p>So now we have a form that we can use to add comments to our comments list but the problem is we need to make sure each comment is associated with the right Annoucement.   </p>
<h2>Associating the Comment</h2>
<p>To associate the comment with the right Annoucement we need to set the value of the post field to corespond with the annoucement we are viewing. To do this we will use a parameter.   </p>
<ul>
<li>In the <strong>Common Data View Tasks</strong> pane click on <strong>Parameters</strong></li>
<li>Create a new parameter (the name does not really matter).  Set the parameter to get its value from the <strong>query string variable</strong> item.</li>
</ul>
<p>So now we have the <strong>ID </strong>of the Annoucement and we just need to use that value to populate the <strong>Post</strong> column. To do this we will edit the comment form.   </p>
<p>Click on the small arrow beside the Post field on the comments form and choose <strong>Format Item As</strong> &gt; <strong>Text Box</strong>   </p>
<p style="text-align: center;"><img class="size-full wp-image-480  aligncenter" title="text" src="http://davecavins.com/wp-content/uploads/2010/03/text.jpg" alt="" width="245" height="224" /> </p>
<p><strong>Now we need to set the value of the text box to our variable. </strong>   </p>
<ul>
<li>In code view do a search for <strong>asp:TextBox</strong></li>
<li>The code will look something like this<strong> </strong></li>
</ul>
<p>&lt;asp:TextBox runat=&#8221;server&#8221; text=&#8221;<a href="mailto:{@post">{<strong>@post</strong></a>}&#8221; __designer:bind=&#8221;{ddwrt:DataBind(&#8216;i&#8217;,concat(&#8216;ff2&#8242;,$Pos),&#8217;Text&#8217;,'TextChanged&#8217;,'ID&#8217;,ddwrt:EscapeDelims(string(@ID)),&#8217;@post&#8217;)}&#8221; /&gt;   </p>
<ul>
<li>Change the text attribute from <strong><a href="mailto:{@post">{@post</a>} </strong>to<strong> {$<span style="color: #ff0000;">you-param-n</span><span style="color: #ff0000;">am</span><span style="color: #ff0000;">e</span>}</strong></li>
<li>Save the page and test it.  When you load the page the text box should populate with the ID of the Annoucment that is being displayed (the same value as in the qurey string variable).  Update the value of the query string variable just to make sure it is changing the text box value.</li>
<li>Once you have verified that the parameter is working properly you can hide the text box by adding the class <strong>ms-hidden</strong> to the <strong>&lt;td&gt;</strong> holding it and the <strong>&lt;td&gt;</strong> holding the label.</li>
<li>Test the form and verify it is working.</li>
</ul>
<h2>Redirect</h2>
<p>When you tested the form you probably noticed that instead of bringing you back the the annoucements page you were taken to the AllItems view of the comments list. This is normal but not what we want. To fix this we will have to make a few more small edits to the comments form.   </p>
<ul>
<li>In SharePoint Designer delete the OK and Cancel buttons on the comments form (dont worry we will replace them)</li>
<li>In code view paste this code where you want the save button to be.
<pre class="brush: plain;">
&lt;input type=&quot;button&quot; value=&quot;Submit&quot; class=&quot;submitComment&quot; name=&quot;btnSave&quot; onclick=&quot;javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={}')}&quot; /&gt;
</pre>
</li>
<li>Set the redirect parameter to the url of whatever page you want to send people to.</li>
<li>Test the form and make sure everything works</li>
</ul>
<h2>Conclusion</h2>
<p>Using this method you can add the ability to post comments to lists that are not blogs.  Once you have everything setup and working its pretty simple to make the form and the comments look better using CSS. If you have questions feel free to post a comment.  </p>
<p>As a result of some acusations of plagarism I am adding links to some other resources somewhat related to this topic. The point of this blog is not to duplicate or take credit for the effort of others. </p>
<ul>
<li><a href="http://www.sharepointhillbilly.com/archive/2009/12/08/creating-a-sharepoint-list-parentchild-relationship-ndash-video-remix.aspx" target="_blank">Parent Child Relationships</a></li>
<li><a href="http://blogs.msdn.com/jackiebo/archive/2007/02/23/lookup-count-related-the-magic-behind-sharepoint-s-comments-column.aspx" target="_blank">The Magic Behind SharePoint&#8217;s # Comments Column</a></li>
<li><a href="http://sharepoint.microsoft.com/blogs/GetThePoint/Lists/Posts/Post.aspx?ID=209" target="_blank">How to Create Article Comments</a></li>
</ul>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/03/adding-comments-to-a-list-part-1/' rel='bookmark' title='Permanent Link: Adding Comments to a List Part 1'>Adding Comments to a List Part 1</a></li>
<li><a href='http://davecavins.com/2009/10/styling-sharepoint-blog-comments/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments'>Styling SharePoint Blog Comments</a></li>
<li><a href='http://davecavins.com/2009/10/sharepoint-blog-comments-p2/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments: Part 2'>Styling SharePoint Blog Comments: Part 2</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2010/03/adding-comments-to-a-list-part-2/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Adding Comments to a List Part 1</title>
		<link>http://davecavins.com/2010/03/adding-comments-to-a-list-part-1/</link>
		<comments>http://davecavins.com/2010/03/adding-comments-to-a-list-part-1/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 22:05:43 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[comments]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=452</guid>
		<description><![CDATA[In SharePoint 2007 the only lists that offer a comments feature are the posts list in the Blog site template. Wouldn&#8217;t it be nice to allow people to post comments on other types of lists like announcements or documents? Well after lots of trial and error I figured out how to do it. What you [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/03/adding-comments-to-a-list-part-2/' rel='bookmark' title='Permanent Link: Adding Comments to a List Part 2'>Adding Comments to a List Part 2</a></li>
<li><a href='http://davecavins.com/2009/10/styling-sharepoint-blog-comments/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments'>Styling SharePoint Blog Comments</a></li>
<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>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="mceTemp mceIEcenter" style="text-align: left;">In SharePoint 2007 the only lists that offer a comments feature are the posts list in the Blog site template. Wouldn&#8217;t it be nice to allow people to post comments on other types of lists like announcements or documents? Well after lots of trial and error I figured out how to do it.</div>
<h2>What you will need</h2>
<ul>
<li>Two Lists</li>
<li>SharePoint Designer</li>
<li>Basic knowledge of HTML</li>
</ul>
<p>I&#8217;ll assume you already have a list setup on which you want to allow users to comment. For this example I will use a standard Annoucements list.</p>
<p>So the first thing we need to do is create a list to hold our comments.  I just used the following columns:</p>
<ul>
<li>Title</li>
<li>Body</li>
<li>Post  (lookup to main list&#8217;s <strong>&#8216;Title&#8217;</strong> column)</li>
</ul>
<p>In the main list you will need to add a column that points back to the comments list.</p>
<ol>
<li>Go to the list settings page and click <strong>&#8216;Create Column&#8217;</strong></li>
<li>Name the column &#8216;<strong>Comments</strong>&#8216; (the name does not really matter. Set the type to &#8216;<strong>Lookup</strong>&#8216;</li>
<li>The lookup should get information from the comments list you created.  The column should be set to the lookup column in the comments list.  See the screenshot below. <a href="http://davecavins.com/wp-content/uploads/2010/03/lookup.jpg"><img class="aligncenter size-full wp-image-454" src="http://davecavins.com/wp-content/uploads/2010/03/lookup.jpg" alt="" width="353" height="258" /></a>This column will show us the number of comments each item in our list has. <span id="more-452"></span></li>
</ol>
<p>Ok so now that we have the two lists pointing to each other we need to show the comments on a page with our list item.</p>
<ol>
<li>Add a couple of items to each list just for testing purposes.</li>
<li>Create a blank web part page.</li>
<li>Add a data view web part to the page to display the <strong>Annoucements</strong> list.</li>
<li>Create a parameter on the dataview named <strong>item</strong> and set it to get the variable from the query string.<br />
<strong>Note : Whatever link user click to get to this page will need to pass the item ID as a variable in the query string in order for this solution to work. In my example I am passing the ID in the &#8216;item&#8217; variable but you can use whatever you want.</strong></p>
<div id="attachment_458" class="wp-caption aligncenter" style="width: 417px"><img class="size-full wp-image-458" title="parameter" src="http://davecavins.com/wp-content/uploads/2010/03/parameter.jpg" alt="" width="407" height="162" /><p class="wp-caption-text">set up parameter</p></div></li>
<li>
<div class="mceTemp mceIEcenter" style="text-align: left;">
<p>Adjust the filter settings so that the list is filtered using the parameter that has been created. You can test to verify this is working by putting <strong>&#8220;?item=1</strong>&#8221; and the end of the url and the list item with an <strong>ID</strong> of 1 should be displayed.</p>
<p><div id="attachment_459" class="wp-caption aligncenter" style="width: 441px"><a href="http://davecavins.com/wp-content/uploads/2010/03/filter.jpg"><img class="size-full wp-image-459" title="filter" src="http://davecavins.com/wp-content/uploads/2010/03/filter.jpg" alt="" width="431" height="195" /></a><p class="wp-caption-text">Filter using the parameter</p></div>
</div>
</li>
<li> Add a web part to the page below the data view to display your <strong>comments list</strong>. Create a web part connection to filter the comments list based on the <strong>Title</strong> of the <strong>Annoucement</strong> list item.
<div id="attachment_460" class="wp-caption aligncenter" style="width: 450px"><img class="size-full wp-image-460" title="1" src="http://davecavins.com/wp-content/uploads/2010/03/1.jpg" alt="" width="440" height="347" /><p class="wp-caption-text">Get Sort Filter from </p></div>
<div id="attachment_460" class="wp-caption aligncenter" style="width: 450px"><img class="size-full wp-image-460" title="1" src="http://davecavins.com/wp-content/uploads/2010/03/2.jpg" alt="" width="440" height="347" /><p class="wp-caption-text">Click Next</p></div>
<p style="text-align: center;"><img class="size-full wp-image-460     aligncenter" title="3" src="http://davecavins.com/wp-content/uploads/2010/03/3.jpg" alt="" width="440" height="347" /></p>
<p style="text-align: left;">Test the page and you should see one annoucement and the related comment.  In my next post we will create a form so that users can create new comments.</p>
</li>
</ol>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/03/adding-comments-to-a-list-part-2/' rel='bookmark' title='Permanent Link: Adding Comments to a List Part 2'>Adding Comments to a List Part 2</a></li>
<li><a href='http://davecavins.com/2009/10/styling-sharepoint-blog-comments/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments'>Styling SharePoint Blog Comments</a></li>
<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>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2010/03/adding-comments-to-a-list-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Improving #SharePoint Forms &#8211; Hints</title>
		<link>http://davecavins.com/2010/02/improving-sharepoint-forms-hints/</link>
		<comments>http://davecavins.com/2010/02/improving-sharepoint-forms-hints/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 17:22:39 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[better forms]]></category>
		<category><![CDATA[hints]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=442</guid>
		<description><![CDATA[When users are asked to enter information in a form sometimes it helps to give them a hint regarding what types of information should be entered.  Out of the box you can enter a description of each field that will be displayed.  If you want something more dynamic here is how to do it.  Add [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/02/character-count-on-sharepoint-fields/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Character Count'>Improving #SharePoint Forms &#8211; Character Count</a></li>
<li><a href='http://davecavins.com/2010/01/hiding-the-status-icon/' rel='bookmark' title='Permanent Link: Hiding the user presence icon'>Hiding the user presence icon</a></li>
<li><a href='http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms – Watermarks'>Improving #SharePoint Forms – Watermarks</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When users are asked to enter information in a form sometimes it helps to give them a hint regarding what types of information should be entered.  Out of the box you can enter a description of each field that will be displayed.  If you want something more dynamic here is how to do it. </p>
<ul>
<li>Add jQuery to the page using the method described <a href="http://davecavins.com/2010/02/character-count-on-sharepoint-fields/">in this post</a></li>
<li>Download the <a href="http://nicolae.namolovan.googlepages.com/jquery.inputHintBox.html" target="_blank">jQuery Hint Box plugin</a> and link it to the page. </li>
<li>Call the script and set the options for the position and html content of the hint. Here is an example:</li>
</ul>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
$(&quot;input[title='Author']&quot;).inputHintBox({
	className:'simple_box',
	html:'Who is the author of this quote?',
	incrementLeft:-25,
	incrementTop:-15
	});
&lt;/script&gt;
</pre>
<p>The above script simply selects  the field using its  title attribute then sets the css class for the element, its contents and position.</p>
<p>Here is the CSS I used for my example.</p>
<pre class="brush: css;">
.simple_box{
	border:1px solid gray; background:url('/_layouts/images/toolgrad.gif');
	font-size:xx-small; color:#444; padding:7px;
}
</pre>
<p>Here it is in action.</p>
<div id="attachment_443" class="wp-caption aligncenter" style="width: 508px"><a href="http://davecavins.com/wp-content/uploads/2010/02/hint2.jpg"><img class="size-full wp-image-443" title="hint2" src="http://davecavins.com/wp-content/uploads/2010/02/hint2.jpg" alt="" width="498" height="179" /></a><p class="wp-caption-text">hints</p></div>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/02/character-count-on-sharepoint-fields/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Character Count'>Improving #SharePoint Forms &#8211; Character Count</a></li>
<li><a href='http://davecavins.com/2010/01/hiding-the-status-icon/' rel='bookmark' title='Permanent Link: Hiding the user presence icon'>Hiding the user presence icon</a></li>
<li><a href='http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms – Watermarks'>Improving #SharePoint Forms – Watermarks</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2010/02/improving-sharepoint-forms-hints/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Improving #SharePoint Forms</title>
		<link>http://davecavins.com/2010/01/improving-sharepoint-forms/</link>
		<comments>http://davecavins.com/2010/01/improving-sharepoint-forms/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 02:43:15 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[better forms]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=420</guid>
		<description><![CDATA[Over the next few weeks I will be writing a series of posts on how to improve the out of the box SharePoint forms by using simple CSS and jQuery solutions.  These solutions will help improve usability as well as enhance the look and feel.  Look for the first post later this week. As a [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/02/character-count-on-sharepoint-fields/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Character Count'>Improving #SharePoint Forms &#8211; Character Count</a></li>
<li><a href='http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms – Watermarks'>Improving #SharePoint Forms – Watermarks</a></li>
<li><a href='http://davecavins.com/2009/10/styling-sharepoint-blog-comments/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments'>Styling SharePoint Blog Comments</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Over the next few weeks I will be writing a series of posts on how to improve the out of the box SharePoint forms by using simple CSS and jQuery solutions.  These solutions will help improve usability as well as enhance the look and feel.  Look for the first post later this week.</p>
<p>As a point of reference this is what we will be starting with.</p>
<div id="attachment_422" class="wp-caption aligncenter" style="width: 593px"><a href="http://davecavins.com/wp-content/uploads/2010/01/form.jpg"><img class="size-full wp-image-422" title="form" src="http://davecavins.com/wp-content/uploads/2010/01/form.jpg" alt="" width="583" height="247" /></a><p class="wp-caption-text">Standard SharePoint Form</p></div>
<p>Stay tuned for more soon.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/02/character-count-on-sharepoint-fields/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Character Count'>Improving #SharePoint Forms &#8211; Character Count</a></li>
<li><a href='http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms – Watermarks'>Improving #SharePoint Forms – Watermarks</a></li>
<li><a href='http://davecavins.com/2009/10/styling-sharepoint-blog-comments/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments'>Styling SharePoint Blog Comments</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2010/01/improving-sharepoint-forms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying a rotating header image with caption</title>
		<link>http://davecavins.com/2010/01/displaying-a-rotating-header-image-with-caption/</link>
		<comments>http://davecavins.com/2010/01/displaying-a-rotating-header-image-with-caption/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 03:20:00 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[captify]]></category>
		<category><![CDATA[Data View Web Part]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=403</guid>
		<description><![CDATA[Nothing makes a site look good like nice images. Using a large header graphic on you Sharepoint site can help direct users to some important information or announcement. Many non-SharePoint images use this technique to add interest to their site and attract visitors. Doing something like this in SharePoint will make your site a lot [...]


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/04/switch-list-displays-with-jquery-and-css/' rel='bookmark' title='Permanent Link: Switch List Displays with JQuery and CSS'>Switch List Displays with JQuery and CSS</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>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Nothing makes a site look good like nice images.  Using a large header graphic on you Sharepoint site can help direct users to some important information or announcement. Many non-SharePoint images use this technique to add interest to their site and attract visitors.  Doing something like this in SharePoint will make your site a lot less &#8216;SharePointy&#8217; (my made up word for sites that look like SharePoint).  Here is how I did it.</p>
<div id="attachment_413" class="wp-caption aligncenter" style="width: 446px"><a href="http://davecavins.com/wp-content/uploads/2010/01/caption.gif"><img class="size-full wp-image-413" title="caption" src="http://davecavins.com/wp-content/uploads/2010/01/caption.gif" alt="" width="436" height="218" /></a><p class="wp-caption-text">Rotating images with captions</p></div>
<p><span id="more-403"></span></p>
<h1>Setup</h1>
<ol>
<li>Create an Image Library to hold your header images,  I named my list &#8216;Headers&#8217;. You can add additional fields to the list if you want but its not necessary for this to work.</li>
<li>Find the images you want to use and re-size them to all be the same dimensions, I used 600px x 200px.</li>
<li>Upload the images to the library and fill in the meta data for each one. Just make sure the &#8216;Title&#8217; field has something in it because that is what we will use for our captions.</li>
</ol>
<h1>The hard part</h1>
<p>Ok really its not hard at all.</p>
<ol>
<li> In SharePoint Designer and add a data view web part to the page.  It does not matter what fields you show in the DVWP the important part is that it is pulling its contents from the Image Library you created.</li>
<li>Switch to &#8216;split view&#8217; and find the  tag. It should be right after the  tag in the code. Right click on the  tag and choose &#8216;Select&#8217; tag. Press delete.
<div id="attachment_408" class="wp-caption aligncenter" style="width: 170px"><a href="http://davecavins.com/wp-content/uploads/2010/01/codeview.jpg"><img class="size-full wp-image-408" title="codeview" src="http://davecavins.com/wp-content/uploads/2010/01/codeview.jpg" alt="" width="160" height="31" /></a><p class="wp-caption-text">Split view</p></div>
<div id="attachment_412" class="wp-caption aligncenter" style="width: 103px"><a href="http://davecavins.com/wp-content/uploads/2010/01/xsl.jpg"><img class="size-full wp-image-412" title="xsl" src="http://davecavins.com/wp-content/uploads/2010/01/xsl.jpg" alt="" width="93" height="71" /></a><p class="wp-caption-text">XSL tag</p></div>
<p><div id="attachment_411" class="wp-caption aligncenter" style="width: 213px"><a href="http://davecavins.com/wp-content/uploads/2010/01/selecttag1.jpg"><img class="size-full wp-image-411" title="selecttag" src="http://davecavins.com/wp-content/uploads/2010/01/selecttag1.jpg" alt="" width="203" height="126" /></a><p class="wp-caption-text">Select Tag</p></div></li>
<li>Paste this code where the  tag used to be.</li>
<pre class="brush: plain;">
&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;'&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;xsl:variable name=&quot;dvt_RowCount&quot; select=&quot;count($Rows)&quot; /&gt;
		&lt;xsl:variable name=&quot;IsEmpty&quot; select=&quot;$dvt_RowCount = 0&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js&quot;&gt;&lt;/script&gt; &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;sample.css?t=1&quot; /&gt;
	&lt;script type=&quot;text/javascript&quot; src=&quot;captify.tiny.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt;
this.randomtip = function(){
	var pause = 9000; // define the pause for each tip (in milliseconds)
	var length = $(&amp;quot;#headers li&amp;quot;).length;
	var temp = -1;
	this.getRan = function(){
		var ran = Math.floor(Math.random()*length) + 1;
		return ran;
	};
	this.show = function(){
		var ran = getRan();
		while (ran == temp){
			ran = getRan();
		};
		temp = ran;
		$(&amp;quot;#headers li&amp;quot;).hide();
		$(&amp;quot;#headers li:nth-child(&amp;quot; + ran + &amp;quot;)&amp;quot;).fadeIn(&quot;slow&quot;);
	};
	show(); setInterval(show,pause);
};
&lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt;
	$(function(){
		$(&amp;apos;img.captify&amp;apos;).captify({});
	});
	$(document).ready(function(){
	randomtip();
});
	&lt;/script&gt; &lt;style type=&quot;text/css&quot;&gt;
#headers, #headers li{
	margin:0;
	padding:0;
	list-style:none;
	}
#headers li img{
	display:none; /* hide the items at first only */
	}
&lt;/style&gt;
&lt;ul id=&quot;headers&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;/ul&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;img border=&quot;0&quot; src=&quot;{@FileRef}&quot; alt=&quot;{@Title}&quot; class=&quot;captify&quot; title=&quot;{@Title}&quot;/&gt;&lt;/li&gt;
&lt;/xsl:template&gt;&lt;/xsl:stylesheet&gt;&lt;/XSL&gt;
</pre>
<h1>How it works</h1>
<p>This code displays the items from our list in an unordered list and then using the <a href="http://cssglobe.com/post/6023/simple-way-to-random-display-or-rotate-content-using">jQuery method explained here</a> it randomly chooses one to display. Initially they are all hidden by this css.</p>
<pre class="brush: css;">
&lt;style type=&quot;text/css&quot;&gt;
#headers, #headers li{
	margin:0;
	padding:0;
	list-style:none;
	}
#headers li img{display:none; /* hide the items at first only */}
&lt;/style&gt;
</pre>
<p>You can remove this from the xsl code and put it in your own external style sheet if you want. If you look at <a href="http://cssglobe.com/post/6023/simple-way-to-random-display-or-rotate-content-using">the article on CSS Glob</a>e where I got the code from there is also a way to make it show images randomly on page refresh.To diplay the captions I am using the <a rel="no-follow" href="http://ignati.com/captify-jquery-plugin-to-display-image-captions/">Captify jQuery plugin</a>. If you notice in the xsl I am adding a class of &#8216;captify&#8217; to each image, this is all the plugin needs to work. We just need to reference the plugin file and call the function like this:</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
	$(function(){$('img.captify').captify({});
	});  //show captions on the images
	$(document).ready(function(){randomtip();
});  //display the random images
	&lt;/script&gt;
</pre>
<h1>In closing</h1>
<p>I have seen other methods of showing random content in the Data View Web Part such as this one:</p>
<pre class="brush: plain;">
&lt;xsl:variable name=&quot;Rows&quot; select=&quot;/dsQueryResponse/Rows/Row[@ID=ddwrt:Random(1,count(//Rows/Row))]&quot;/&gt;
</pre>
<p>However when I experimented with it there were issues with it choosing id&#8217;s that were not in the list and therefore nothing would display. If any one knows of an alternative solution please let me know.Overall this can be a very powerful tool for sharing information with your users. With a few small edits to the code and the list you can easily make each slide link to a page or a list item on your site.</p>
<p>If you have trouble getting this working on your site make sure the references to jQuery and the Captify script are correct, if they are right and you still have issues feel free to post a comment and I&#8217;ll do what I can to help out.</p>
<h1>Resources</h1>
</ol>
<ul>
<li><a rel="no-follow" href="http://www.jquery.com">jQuery</a></li>
<li><a rel="no-follow" href="http://github.com/caius/jquery-captify">Captify Plugin Download</a></li>
<li> <a rel="no-follow" href="http://cssglobe.com/post/6023/simple-way-to-random-display-or-rotate-content-using">Simple Way to Random Display or Rotate Content Using JavaScript and CSS</a></li>
</ul>


<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/04/switch-list-displays-with-jquery-and-css/' rel='bookmark' title='Permanent Link: Switch List Displays with JQuery and CSS'>Switch List Displays with JQuery and CSS</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>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2010/01/displaying-a-rotating-header-image-with-caption/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<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>Image Slideshow with captions</title>
		<link>http://davecavins.com/2009/11/slideshow-with-captions/</link>
		<comments>http://davecavins.com/2009/11/slideshow-with-captions/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 17:12:01 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[slideshow]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[webparts]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=245</guid>
		<description><![CDATA[This is a very simple image slide show script that uses jQuery, SharePoint webservices and the default images library to show images with captions. All the content is pulled from default fields in the images library but feel free to add more fields and customize the code to fit your needs.  Setup To get this [...]


Related posts:<ol><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>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
<li><a href='http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/' rel='bookmark' title='Permanent Link: Adding Suggestions to the Sharepoint search box : Part 2'>Adding Suggestions to the Sharepoint search box : Part 2</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This is a very simple image slide show script that uses jQuery, SharePoint webservices and the default images library to show images with captions. All the content is pulled from default fields in the images library but feel free to add more fields and customize the code to fit your needs. </p>
<div id="attachment_331" class="wp-caption aligncenter" style="width: 464px"><img class="size-full wp-image-331" title="slideshow" src="http://davecavins.com/wp-content/uploads/2009/10/slideshow.jpg" alt="Slide show with captions" width="454" height="301" /><p class="wp-caption-text">Slide show with captions</p></div>
<p><span id="more-245"></span></p>
<h2>Setup</h2>
<p>To get this slideshow up and running there are a few things we have to do to prepare.</p>
<ol>
<li>Create a standard image library.  You can add additional fields if needed but the list needs to have all of the out of the box fields.</li>
<li><a href="http://jquery.com" target="_blank" rel="nofollow">Get jQuery</a>.  Either link to the <a href="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" target="_blank" rel="nofollow">latest version from Google</a> or download it and put it in a location on your server.</li>
<li><a href="http://www.serie3.info/s3slider/index.php" target="_blank">Download the s3 slider plugin</a> and put it somewhere on your server.</li>
</ol>
<h2>Querying the SharePoint List</h2>
<p>I am using the <a href="http://weblogs.asp.net/jan/archive/2009/05/06/querying-sharepoint-list-items-using-jquery.aspx" rel="nofollow" target="_blank">techniques described by Jan Tielnes</a> for querying SP lists with javascript.  Here is the code.</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot; src=&quot;Scripts/jquery-1[1].3.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot; src=&quot;Scripts/s3Slider.js
&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
    $(document).ready(function() {
        var soapEnv =
            &quot;&lt;soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'&gt; \
                &lt;soapenv:Body&gt; \
                     &lt;GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'&gt; \
                        &lt;listName&gt;Pictures&lt;/listName&gt; \
                         &lt;viewFields&gt; \
                            &lt;ViewFields&gt; \
                               &lt;FieldRef Name='Title' /&gt; \
                               &lt;FieldRef Name='FileDirRef' /&gt; \
                               &lt;FieldRef Name='NameOrTitle' /&gt; \
                               &lt;FieldRef Name='FileRef' /&gt; \
                               &lt;FieldRef Name='ID' /&gt; \
                               &lt;FieldRef Name='Description' /&gt; \
                               &lt;FieldRef Name='FileType' /&gt; \
                           &lt;/ViewFields&gt; \
                        &lt;/viewFields&gt; \
                    &lt;/GetListItems&gt; \
                &lt;/soapenv:Body&gt; \
            &lt;/soapenv:Envelope&gt;&quot;;
        $.ajax({
            url: &quot;_vti_bin/lists.asmx&quot;,
            type: &quot;POST&quot;,
            dataType: &quot;xml&quot;,
            data: soapEnv,
            complete: processResult,
            contentType: &quot;text/xml; charset=\&quot;utf-8\&quot;&quot;
        });
    });
    function processResult(xData, status) {
        $(xData.responseXML).find(&quot;z\\:row&quot;).each(function() {
            var urlValue = $(this).attr(&quot;ows_FileDirRef&quot;);
                                                var urlArray;
                                                var urlName;
                                                     if (urlValue == undefined)
                                {
                                urlName = &quot;- - -&quot;;
                }
                else {
                                urlArray = urlValue.split(&quot;;#&quot;);
                                urlName= urlArray[1];
                }
                                                var thumbUrl = $(this).attr(&quot;ows_NameOrTitle&quot;);
                                                var thumbArray;
                                                var thumb;          

                                                     if (thumbUrl == undefined)
                                {
                                thumb = &quot;- - -&quot;;
                }
                else {
                                thumbArray = thumbUrl.split(&quot;.&quot;);
                                thumb= thumbArray[0];
                }
            var liHtml = &quot;&lt;li class='s3sliderImage'&gt;&lt;img src='/&quot; + urlName + &quot;/_w/&quot; + thumb +&quot;_&quot; + $(this).attr(&quot;ows_FileType&quot;) + &quot;.jpg'/&gt;&lt;span&gt;&lt;a href='&quot; + urlName + thumb + &quot;.&quot; + $(this).attr(&quot;ows_FileType&quot;) + &quot;'&gt;View Larger&lt;/a&gt;&lt;h3&gt;&quot; + $(this).attr(&quot;ows_Title&quot;) + &quot;&lt;/h3&gt;&quot; + $(this).attr(&quot;ows_Description&quot;) + &quot;&lt;/span&gt;&lt;/li&gt;&quot;;
            $(&quot;#s3sliderContent&quot;).append(liHtml);
        });
        $('#s3slider').s3Slider({timeOut: 4000 });
}
&lt;/script&gt;
&lt;div id=&quot;s3slider&quot; &gt;
   &lt;ul id=&quot;s3sliderContent&quot; /&gt;
&lt;/div&gt;
</pre>
<h3>Configuring the query.</h3>
<p>In the code above I am querying a list named &#8216;Pictures&#8217; and returning the title, link to the file, file name, file type, description and the ID. To change the name of the list just update this tag with the appropriate list name.</p>
<pre class="brush: plain;">&lt;listName&gt;Name of the List you want to use&lt;/listName&gt;</pre>
<p><strong>Note:</strong> If you have renamed a default Image library the name may not have actually changed from SharePoint&#8217;s perspective so double check by browsing to the list and reading the URL string.</p>
<p>If you want to include data from other fields in the html output just add the field names to the &#8216;ViewFields&#8217; section of the soap envelope.</p>
<pre class="brush: plain;"> &lt;FieldRef Name='NameOfField' /&gt; \</pre>
<p>You will also need to add a reference to the field in the &#8216;liHtml&#8217; variable. When referencing fields in the variable remember to put &#8216;ows_&#8217; in front of the field name.</p>
<p>Remember the field name that is displayed through the SharePoint UI is not always the real field name.  In this post <a title="Find field names in SharePoint" rel="nofollow" href="http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx" target="_blank">Heather Solomon describes a good way to find the real field names</a>.</p>
<h2>The CSS</h2>
<p>I made a few changes to the CSS to set the size of the slideshow and the colors and fonts for the captions</p>
<pre class="brush: css;">
 #s3slider {width: 450px; height: 300px; position: relative; overflow: hidden; border:1px solid #666;}
#s3sliderContent {width: 450px; position: absolute; top: 0; margin-left: 0;}
.s3sliderImage {float: left; position: relative; display: none;}
.s3sliderImage span {
   position: absolute;
   left: 0;
   font: 10px/15px Arial, Helvetica, sans-serif;
   padding: 5px 13px;
   width: 449px;
   background-color: #fff;
   filter: alpha(opacity=70);
   -moz-opacity: 0.7;
   -khtml-opacity: 0.7;
   opacity: 0.7;
   color: #000;
   display: none;
   top: 0;
}
.s3sliderImage span h3{margin:1px;	padding:1px; font:normal italic 18px/14px Georgia, serif;}
.s3sliderImage span a{float:right;color:#fff;background:#333;padding:2px;text-decoration:none;margin-top:5px;}
.clear {clear: both;}
</pre>
<p><a href="http://davecavins.com/wp-content/uploads/2009/11/ImageSlideShowWithCaptions.dwp" target="_blank" rel="nofollow">Download all the the code in a .dwp here</a></p>


<p>Related posts:<ol><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>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
<li><a href='http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/' rel='bookmark' title='Permanent Link: Adding Suggestions to the Sharepoint search box : Part 2'>Adding Suggestions to the Sharepoint search box : Part 2</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/11/slideshow-with-captions/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Resizable textareas in SharePoint edit forms</title>
		<link>http://davecavins.com/2009/11/resizable-textarea-in-sharepoint/</link>
		<comments>http://davecavins.com/2009/11/resizable-textarea-in-sharepoint/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 15:01:21 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[textarea]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=290</guid>
		<description><![CDATA[So one of the things that I have had end users complain to me about is the size of the text boxes on the new and edit forms of lists like the contacts list and announcement list. On a recent non-SharePoint project I used a jQuery plugin to create a resizable text area so I [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/02/character-count-on-sharepoint-fields/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Character Count'>Improving #SharePoint Forms &#8211; Character Count</a></li>
<li><a href='http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms – Watermarks'>Improving #SharePoint Forms – Watermarks</a></li>
<li><a href='http://davecavins.com/2010/02/improving-sharepoint-forms-hints/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Hints'>Improving #SharePoint Forms &#8211; Hints</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>So one of the things that I have had end users complain to me about is the size of the text boxes on the new and edit forms of lists like the contacts list and announcement list. On a recent non-SharePoint project I used a jQuery plugin to create a resizable text area so I tried to implement it in SharePoint. Here is what happened.</p>
<p>I downloaded the <a title="Textarea Resize" rel="nofollow" href="http://viralpatel.net/blogs/2009/06/textarea-resize-javascript-jquery-plugin-resize-textarea-html.html">Textarea Resize JavaScript</a> jQuery plugin, saved in a SharePoint library along with the latest version of jQuery.</p>
<h3>Selecting the Element</h3>
<p>In order for the jQuery code to work it has to know which elements on the page you want to work with.</p>
<p>Here is the code SharePoint renders for a text box:</p>
<pre class="brush: xml;">
&lt;textarea name=&quot;ctl00$m$g_3fa2cde8_0ea8_4421_814f_6a6d292fbe54$ctl00
$ctl04$ctl0ctl00$TextField&quot;
rows=&quot;15&quot;
cols=&quot;20&quot; id=&quot;ctl00_m_g_3fa2cde8_0ea8_4421_ctl00_TextField&quot; title=&quot;Body&quot;
class=&quot;ms-long&quot; dir=&quot;none&quot;&gt;&lt;/textarea&gt;
</pre>
<p>There are two problems:</p>
<ol>
<li> ASP.NET creates very long and hard to use IDs</li>
<li>The class ms-long culd apply to other elements on the page that I dont want to use the effect on.</li>
</ol>
<p><span id="more-290"></span><br />
So all we have left to use is the title attribute. With jQuery we can select elements based on thier title. There are <a title="jQuery Selectors" rel="nofollow" href="http://docs.jquery.com/Selectors" target="_blank">more details on using jQuery selectors</a> on the jQuery website. To select our text box with the title &#8220;Simple Text&#8221; we use the following code:</p>
<pre class="brush: jscript;">
$('textarea[title=&quot;Simple Text&quot;]')
</pre>
<p>A quick way to check and be sure your selector is working is to call the addClass function in jQuery and change the background color or border color of the element.</p>
<p style="text-align: center;"><img class="size-full wp-image-293 aligncenter" title="grippie" src="http://davecavins.com/wp-content/uploads/2009/10/grippie.jpg" alt="grippie" width="412" height="157" /></p>
<h3>Trial and Error</h3>
<p>So after I verified the selector was working I applied the plugin but nothing happened. After some testing I realized the script would not work on the rich text box because SharePoint has a JavaScript that runs to initialize the WYSIWYG editor. I am still experimenting so if I get it working on the rich text field I will post and update. For now it only works with the plain text field.</p>
<p>Here is the code I used:</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot; src=&lt;a href=&quot;http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js&quot;&gt;http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js&lt;/a&gt;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;scripts/jquery.textarearesizer.compressed.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
	/* jQuery textarea resizer plugin usage */
	$(document).ready(function() {
	$('textarea[title=&quot;Title of your field&quot;]').TextAreaResizer();
			});
&lt;/script&gt;
&lt;style type=&quot;text/css&quot;&gt;
div.grippie {
	background:#EEEEEE url(grippie.png) no-repeat scroll center 2px;
	border-color:#DDDDDD;
	border-style:solid;
	border-width:0pt 1px 1px;
	cursor:s-resize;
	height:9px;
	overflow:hidden;
	}
.resizable-textarea textarea {
	display:block;
	margin-bottom:0pt;
	}
&lt;/style&gt;
</pre>
<p>I just put the code in a content editor webpart on the EditFomr.aspx and NewForm.aspx pages.  To add the CEWP to the page just add &#8220;&amp;ToolPaneView=2&#8243; to the end of the url to get the toolbar.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/02/character-count-on-sharepoint-fields/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Character Count'>Improving #SharePoint Forms &#8211; Character Count</a></li>
<li><a href='http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms – Watermarks'>Improving #SharePoint Forms – Watermarks</a></li>
<li><a href='http://davecavins.com/2010/02/improving-sharepoint-forms-hints/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Hints'>Improving #SharePoint Forms &#8211; Hints</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/11/resizable-textarea-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Adding Suggestions to the Sharepoint search box : Part 2</title>
		<link>http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/</link>
		<comments>http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 16:07:37 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[suggestions]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=233</guid>
		<description><![CDATA[In Part 1 of this post we used a simple javascript to display suggestions on a custom search box. After I wrote that post I was thinking it would make more sense to read the suggestions from a list instead of a JavaScript file. This post will explain how to setup the list and edit [...]


Related posts:<ol><li><a href='http://davecavins.com/2009/04/adding-suggestiong-to-the-sharepoint-search-box/' rel='bookmark' title='Permanent Link: Adding Suggestions to the Sharepoint search box'>Adding Suggestions to the Sharepoint search box</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
<li><a href='http://davecavins.com/2009/11/slideshow-with-captions/' rel='bookmark' title='Permanent Link: Image Slideshow with captions'>Image Slideshow with captions</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://davecavins.com/2009/04/adding-suggestiong-to-the-sharepoint-search-box/">In Part 1 of this post</a> we used a simple javascript to display suggestions on a custom search box. After I wrote that post I was thinking it would make more sense to read the suggestions from a list instead of a JavaScript file. This post will explain how to setup the list and edit the JavaScript to read the suggestions from a list. The idea is that an administrator could manage the list and help guide users toward specific information instead of getting numerous un-related results like in <a href="http://www.youtube.com/watch?v=i1AwFY6MuwE" target="_blank">those commercials for bing</a>.</p>
<p>Assuming you already have the search box setup as described in <a href="http://davecavins.com/2009/04/adding-suggestiong-to-the-sharepoint-search-box/">Part one of this post</a> all you will need to do is change the javascript and add some code to the page.</p>
<h2>Setup</h2>
<ul>
<li>Do everything from the first post</li>
<li>Add a link to jQuery somewhere on the page.</li>
<li>Create a custom list called &#8216;Suggestions&#8217;. It just needs to have the default title field. Create at least one item in the list and in the title enter several comma separated words.</li>
<li>Add the code below to the page.</li>
</ul>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript” src=“http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js”&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
function GetItemsFromSP() {
    var soapEnv =
 “&lt;soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'&gt; \
                &lt;soapenv:Body&gt; \
                     &lt;GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'&gt; \
                        &lt;listName&gt;Suggestions&lt;/listName&gt; \
                        &lt;viewFields&gt; \
                            &lt;ViewFields&gt; \
                               &lt;FieldRef Name='Title' /&gt; \
                           &lt;/ViewFields&gt; \
                        &lt;/viewFields&gt; \
                    &lt;/GetListItems&gt; \
                &lt;/soapenv:Body&gt; \
            &lt;/soapenv:Envelope&gt;”;
       $.ajax({
        url: “_vti_bin/lists.asmx”,
        type: “POST”,
        dataType: “xml”,
        data: soapEnv,
        complete: processResult,
        contentType: “text/xml; charset=\”utf-8\”“,
        async: false
    });
}
function processResult(xData, status) {
    $(xData.responseXML).find(“z\\:row”).each(function() {
        $(“#data”).append(“” + $(this).attr(“ows_Title”) + “,”);
    });
}
&lt;/script&gt;
&lt;script type=“text/javascript” src=“Resources/searchfield.js”&gt;&lt;/script&gt;
&lt;div style=“display:none; visibility:hidden” id=“data”&gt;&lt;/div&gt;
</pre>
<p>The code above get the items from the Suggestions list, seperates them with commas and puts them in a hidden div with an ID of data. Now we just need to edit the searchfield script to read in the information from our hidden div. To do this edit searchfield.js line 26 to call the GetItemsFromSP function and set the suggestionText variable to be equal to the contents of our hidden div. Here is the code.</p>
<pre class="brush: jscript;">
/**/*/*/*/**/
	GetItemsFromSP();
	var suggestionText =  $(“#data”).html();
</pre>
<p>Test the page and make sure it works by typing the first few letters of one of the words in you list item.</p>
<h2>Conclusion</h2>
<p>This is very similar to <a href="http://weblogs.asp.net/jan/archive/2009/07/02/sharepoint-search-as-you-type-with-jquery.aspx">Jan Tielens&#8217; SharePoint Search-as-You-Type with jQuery solution </a>but I wanted the search box to still be usable even if there are no suggestions. In Jan&#8217;s solution the &#8216;search box&#8217; does not actually do anything when the magnifying glass is clicked. There are likely better ways to do this and if you know of one please post a comment.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2009/04/adding-suggestiong-to-the-sharepoint-search-box/' rel='bookmark' title='Permanent Link: Adding Suggestions to the Sharepoint search box'>Adding Suggestions to the Sharepoint search box</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
<li><a href='http://davecavins.com/2009/11/slideshow-with-captions/' rel='bookmark' title='Permanent Link: Image Slideshow with captions'>Image Slideshow with captions</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Styling SharePoint Blog Comments: Part 2</title>
		<link>http://davecavins.com/2009/10/sharepoint-blog-comments-p2/</link>
		<comments>http://davecavins.com/2009/10/sharepoint-blog-comments-p2/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 14:00:45 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint Designer]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=269</guid>
		<description><![CDATA[As promised I went ahead and styled the comment form on a standard SharePoint blog.  I wanted to make it look better than this but there are some limitations because of the way the page is coded with so many nested tables.  I kept the styles pretty simple but this should be a good starting [...]


Related posts:<ol><li><a href='http://davecavins.com/2009/10/styling-sharepoint-blog-comments/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments'>Styling SharePoint Blog Comments</a></li>
<li><a href='http://davecavins.com/2009/07/styling-the-moss-horizontal-navigation-menu/' rel='bookmark' title='Permanent Link: Styling the MOSS horizontal navigation menu'>Styling the MOSS horizontal navigation menu</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://davecavins.com/2009/10/styling-sharepoint-blog-comments/">As promised</a> I went ahead and styled the comment form on a standard SharePoint blog.  I wanted to make it look better than this but there are some limitations because of the way the page is coded with so many nested tables. </p>
<div id="attachment_270" class="wp-caption aligncenter" style="width: 522px"><img class="size-full wp-image-270" title="blog" src="http://davecavins.com/wp-content/uploads/2009/10/blog.jpg" alt="Better looking comment form" width="512" height="470" /><p class="wp-caption-text">Better looking comment form</p></div>
<p>I kept the styles pretty simple but this should be a good starting point for someone wanting to do something more complex.<br />
<span id="more-269"></span><br />
This code includes the <a href="http://davecavins.com/2009/10/styling-sharepoint-blog-comments/">code from part 1</a> with some minor changes. The new styles for the comment form are commented.</p>
<pre class="brush: css;">
&lt;style type=&quot;text/css&quot;&gt;
.ms-commenttable td {border:0px;}
h4.ms-CommentTitle{border:0px; font:italic normal small Georgia;}
div.ms-CommentBody {
	background:url('../../images/comm_top.gif') top 0px no-repeat;
	margin-bottom:12px;
	padding:18px 0 0 0;
}
div.ms-CommentBody div {
	border:1px solid #ccc;
	border-top:0px;
	padding:15px;
	line-height:18px;
	}
.ms-CommentFooter {background:url('/_layouts/images/square.gif') 5px 50% no-repeat;
	padding:3px;
	margin:0px;
	border-top:1px dotted #ccc;
	border-bottom:1px dotted #ccc;
}
.ms-CommentFooter span {padding-left:18px;}
.ms-commentsWrapper {background:#fff; margin:5px; border:0px;}
.ms-blogedit a{	background:transparent; border:0px;}
.ms-blogedit a:hover{background:#ccc; border:0px;}
h3.ms-CommentHeader{padding-left:35px;
	background:url('/_layouts/images/menunewdiscussion.gif') top left no-repeat}
.ms-formtable {	border-top:1px dotted #ccc;	border-bottom:1px dotted #ccc;	padding:5px;}
/* cell holding the labels */
.ms-formlabel {	border:0px ;width:100px;}
/* label text */
.ms-formlabel h3.ms-standardheader{	padding-top:5px; font-weight:normal; text-align:right;}
/*wraps the form elements */
.ms-formbody {background:transparent;	border:0px;}
/* the title input field */
.ms-formbody span input{
background:#FEFFE2;
padding:2px 5px 1px 5px;
height:28px;
border:1px solid #ccc;
font:italic normal normal small/18px Arial;
margin:5px 0 5px 0;
}
/* text area for the comment body */
.ms-formbody span textarea{
font:italic normal normal small/18px Arial;
background:#FEFFE2;
padding:5px;
border:1px solid #ccc;
margin:0 0 5px 0;
}
/* submit button */
.ms-toolbar input.ms-ButtonHeightWidth2 {
	height:26px;
	border:2px solid #317A0C;
	background:#51AA25;
	color:#fff;
	font:italic normal x-small Georgia;
}
&lt;/style&gt;
</pre>
<p>Note: To be sure this code does not affect the styling of other forms on the page and other web parts it would be best to open the page in SharePoint Designer and wrap the web part in a div some the styles can be targeted to affect only items inside the div.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2009/10/styling-sharepoint-blog-comments/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments'>Styling SharePoint Blog Comments</a></li>
<li><a href='http://davecavins.com/2009/07/styling-the-moss-horizontal-navigation-menu/' rel='bookmark' title='Permanent Link: Styling the MOSS horizontal navigation menu'>Styling the MOSS horizontal navigation menu</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/10/sharepoint-blog-comments-p2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Styling SharePoint Blog Comments</title>
		<link>http://davecavins.com/2009/10/styling-sharepoint-blog-comments/</link>
		<comments>http://davecavins.com/2009/10/styling-sharepoint-blog-comments/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 20:36:19 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint Designer]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=257</guid>
		<description><![CDATA[Out of the box the comments on SharePoint blogs dont look that good.   Here is a way to fix that problem. Just add this CSS to the page and things should start looking alot better. &#38;amp;lt;style type=&#38;amp;quot;text/css&#38;amp;quot;&#38;amp;gt; /* wraps the title of each comment */ .ms-commenttable {border:0px;} /* the title of each comment */ h4.ms-CommentTitle{font-size:x-small;border:0px;} [...]


Related posts:<ol><li><a href='http://davecavins.com/2009/10/sharepoint-blog-comments-p2/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments: Part 2'>Styling SharePoint Blog Comments: Part 2</a></li>
<li><a href='http://davecavins.com/2009/07/styling-the-moss-horizontal-navigation-menu/' rel='bookmark' title='Permanent Link: Styling the MOSS horizontal navigation menu'>Styling the MOSS horizontal navigation menu</a></li>
<li><a href='http://davecavins.com/2010/03/adding-comments-to-a-list-part-1/' rel='bookmark' title='Permanent Link: Adding Comments to a List Part 1'>Adding Comments to a List Part 1</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Out of the box the comments on SharePoint blogs dont look that good. </p>
<div id="attachment_258" class="wp-caption aligncenter" style="width: 274px"><a href="http://davecavins.com/wp-content/uploads/2009/10/comments_old.jpg"><img class="size-full wp-image-258" title="comments_old" src="http://davecavins.com/wp-content/uploads/2009/10/comments_old.jpg" alt="Standard SharePoint blog comments" width="264" height="228" /></a><p class="wp-caption-text">Standard SharePoint blog comments</p></div>
<p> Here is a way to fix that problem. Just add this CSS to the page and things should start looking alot better.<span id="more-257"></span></p>
<pre class="brush: css;">
&amp;amp;lt;style type=&amp;amp;quot;text/css&amp;amp;quot;&amp;amp;gt;
/* wraps the title of each comment */
.ms-commenttable {border:0px;}
/* the title of each comment */
h4.ms-CommentTitle{font-size:x-small;border:0px;}
/* wraps the body of each comment */
div.ms-CommentBody {
	background:url('../../images/comm_top.gif') top 0px no-repeat;
	margin-bottom:12px;
	padding:18px 0 0 0;
}
/* wraps the text of each comment */
div.ms-CommentBody div {
	border:1px solid #ccc;
	border-top:0px;
	padding:15px;
	line-height:18px;
	}
/* wraps the meta info (author, date, etc.)	for each comment */
.ms-CommentFooter {
	background:url('/_layouts/images/square.gif') 5px 50% no-repeat;
	padding:3px;
	margin:0px;
	border-top:1px dotted #ccc;
	border-bottom:1px dotted #ccc;
}
.ms-CommentFooter span {padding-left:18px;}

/* wraps all comments */
.ms-commentsWrapper {
	background:#fff;
	margin:5px;
	border:0px;
}
/* header style for 'Comments' and 'Add a Comment' */
h3.ms-CommentHeader{
	padding-left:35px;
	background:url('/_layouts/images/menunewdiscussion.gif') top left no-repeat
}
&amp;amp;lt;/style&amp;amp;gt;
</pre>
<p>Without editing the code of the page there are some limitations on what can be done. I did not make too many drastic changes but this code should be a good starting point for making your ShaerPoint blogs look better.</p>
<div id="attachment_256" class="wp-caption aligncenter" style="width: 422px"><img class="size-full wp-image-256" title="comments" src="http://davecavins.com/wp-content/uploads/2009/10/comments.jpg" alt="comments" width="412" height="384" /><p class="wp-caption-text">Better looking comments</p></div>
<p><a href="http://davecavins.com/wp-content/uploads/2009/10/comm_top.gif">Here is the image I used in the CSS</a> (right click save as). The other two images are referenced from the 12 hive and should work automatically on any WSS or MOSS installation. </p>
<p>In a future post I will try to do something about the comment form.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2009/10/sharepoint-blog-comments-p2/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments: Part 2'>Styling SharePoint Blog Comments: Part 2</a></li>
<li><a href='http://davecavins.com/2009/07/styling-the-moss-horizontal-navigation-menu/' rel='bookmark' title='Permanent Link: Styling the MOSS horizontal navigation menu'>Styling the MOSS horizontal navigation menu</a></li>
<li><a href='http://davecavins.com/2010/03/adding-comments-to-a-list-part-1/' rel='bookmark' title='Permanent Link: Adding Comments to a List Part 1'>Adding Comments to a List Part 1</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/10/styling-sharepoint-blog-comments/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Better page titles in SharePoint</title>
		<link>http://davecavins.com/2009/09/better-sharepoint-page-titles/</link>
		<comments>http://davecavins.com/2009/09/better-sharepoint-page-titles/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 17:36:00 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[page title]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=219</guid>
		<description><![CDATA[When working with multiple browser windows open its hard to tell one from the other because most SharePoint pages don&#8217;t offer a useful title. So in most cases you will see something like this (I am using the dreaded IE 6 unfortunately). As you can see most SharePoint pages only show the title of the [...]


Related posts:<ol><li><a href='http://davecavins.com/2009/02/adding-stuff-to-the-page-head-the-easy-way/' rel='bookmark' title='Permanent Link: Adding references to the page head: the easy way'>Adding references to the page head: the easy way</a></li>
<li><a href='http://davecavins.com/2010/06/switch-themes-without-a-page-refresh-part-1/' rel='bookmark' title='Permanent Link: Switch Themes Without a Page Refresh: Part 1'>Switch Themes Without a Page Refresh: Part 1</a></li>
<li><a href='http://davecavins.com/2010/06/switch-styles-in-sharepoint-with-jquery/' rel='bookmark' title='Permanent Link: Switch Themes Without a Page Refresh: Part 2'>Switch Themes Without a Page Refresh: Part 2</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When working with multiple browser windows open its hard to tell one from the other because most SharePoint pages don&#8217;t offer a useful title. So in most cases you will see something like this (I am using the dreaded IE 6 unfortunately). As you can see most SharePoint pages only show the title of the page. On the home page of some sites the site name is shown as well.</p>
<div id="attachment_226" class="wp-caption aligncenter" style="width: 353px"><a href="http://davecavins.com/wp-content/uploads/2009/09/pagetitles.jpg"><img class="size-full wp-image-226" title="pagetitles" src="http://davecavins.com/wp-content/uploads/2009/09/pagetitles.jpg" alt="Useless Page Title" width="343" height="235" /></a><p class="wp-caption-text">Useless Page Titles</p></div>
<p>Ideally the page title should not only tell you the title of the page you are looking at but also what site you are on. Chris Coyier of <a href="http://css-tricks.com/whats-the-best-way-to-handle-page-titles/">CSS-Tricks talks more about different options in this post</a>. After some experimenting I was able to get this working in SharePoint.<br />
<span id="more-219"></span><br />
Find the following tag in your page layout.</p>
<pre class="brush: csharp;">
&lt;asp:Content ContentPlaceholderID=&quot;PlaceHolderPageTitle&quot; runat=&quot;server&quot;&gt;
</pre>
<p>Out of the box this tag and its contents just show the title of the current page. Put the code below inside the asp:Content tags.</p>
<pre class="brush: csharp;">
&lt;SharePointWebControls:ProjectProperty runat=&quot;server&quot;  id=&quot;ProjectProperty1&quot; Property=&quot;Title&quot; /&gt; : &lt;SharePointWebControls:FieldValue id=&quot;HomePageTitleInTitleArea&quot; FieldName=&quot;Title&quot; runat=&quot;server&quot;/&gt;
</pre>
<p>Now your page title should be something like this<br />
Site Name : Page Title<br />
Which is far more useful when you have multiple windows open.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2009/02/adding-stuff-to-the-page-head-the-easy-way/' rel='bookmark' title='Permanent Link: Adding references to the page head: the easy way'>Adding references to the page head: the easy way</a></li>
<li><a href='http://davecavins.com/2010/06/switch-themes-without-a-page-refresh-part-1/' rel='bookmark' title='Permanent Link: Switch Themes Without a Page Refresh: Part 1'>Switch Themes Without a Page Refresh: Part 1</a></li>
<li><a href='http://davecavins.com/2010/06/switch-styles-in-sharepoint-with-jquery/' rel='bookmark' title='Permanent Link: Switch Themes Without a Page Refresh: Part 2'>Switch Themes Without a Page Refresh: Part 2</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/09/better-sharepoint-page-titles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
