<?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; stylesheet</title>
	<atom:link href="http://davecavins.com/tag/stylesheet/feed/" rel="self" type="application/rss+xml" />
	<link>http://davecavins.com</link>
	<description>web design, SharePoint customization &#38; random stuff</description>
	<lastBuildDate>Tue, 27 Dec 2011 14:22:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<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='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='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='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='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='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='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>
	</channel>
</rss>

