<?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>SkyBlueCanvas&#187; Skins and Templates Archives  &#8211; SkyBlueCanvas</title>
	<atom:link href="http://blog.skybluecanvas.com/topics/skybluecanvas-lightweight-cms/skins-skybluecanvas-lightweight-cms/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.skybluecanvas.com</link>
	<description>The Lightweight Blog</description>
	<lastBuildDate>Tue, 20 Jul 2010 15:47:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Orange SkyBlueCanvas-compatible Premium Template</title>
		<link>http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/skins-skybluecanvas-lightweight-cms/orange-skybluecanvascompatible-premium-template/</link>
		<comments>http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/skins-skybluecanvas-lightweight-cms/orange-skybluecanvascompatible-premium-template/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 23:14:50 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Skins and Templates]]></category>
<category>themes</category>
		<guid isPermaLink="false">http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/skins-skybluecanvas-lightweight-cms/orange-skybluecanvascompatible-premium-template/</guid>
		<description><![CDATA[I am very happy to announce that the first ever commercially available Premium Template, designed by Qiming Weng, has been released on <a href="http://themeforest.net/item/orange-full-html/41913?ref=skybluecanvas">ThemeForest.net</a>.]]></description>
			<content:encoded><![CDATA[<p>I am very happy to announce that the first ever commercially available Premium Template, designed by Qiming Weng, has been released on <a href="http://themeforest.net/item/orange-full-html/41913?ref=skybluecanvas" rel="nofollow" >ThemeForest.net</a>.</p>
<p><a href="http://themeforest.net/item/orange-full-html/41913?ref=skybluecanvas" rel="nofollow" ><img src="http://skybluecanvas.com/media/pages/orange_sm.png" alt="Orange premium theme for SkyBlueCanvas" /></a></p>
<p>This template includes all the Fragments and Managers required to function and includes Articles, News, Twitter Feed and Galley. The template costs just $14 and your purchase will help support the SkyBlueCanvas project.</p>
<p>In the coming weeks I will be working to convert several more of Qiming&#8217;s themes to work natively with SkyBlueCanvas.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/skins-skybluecanvas-lightweight-cms/orange-skybluecanvascompatible-premium-template/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Converting Themes for SkyBlueCanvas</title>
		<link>http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/converting-themes-skybluecanvas/</link>
		<comments>http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/converting-themes-skybluecanvas/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 20:14:19 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Skins and Templates]]></category>
		<category><![CDATA[SkyBlueCanvas CMS]]></category>
		<category><![CDATA[fragment]]></category>
		<category><![CDATA[fragments]]></category>
		<category><![CDATA[skin]]></category>
		<category><![CDATA[skins]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[tutorials]]></category>
<category>conversion</category><category>fragments</category><category>html</category><category>skins</category><category>templates</category><category>themes</category>
		<guid isPermaLink="false">http://blog.skybluecanvas.com/?p=55</guid>
		<description><![CDATA[One of the most common questions we are asked is how to convert existing or stock HTML templates to work with 
SkyBlueCanvas. In this article I will guide you, step-by-step, through the process of adapting 
any existing skin to work with SkyBlueCanvas. This process, once you understand the fundamentals, 
usually takes about an hour - sometimes even less. In fact, the skin we will use in this tutorial 
took only 30 minutes.]]></description>
			<content:encoded><![CDATA[<p>One of the most common questions we are asked is how to convert existing or stock HTML templates to work with SkyBlueCanvas. In this article I will guide you, step-by-step, through the process of adapting any existing skin to work with SkyBlueCanvas. This process, once you understand the fundamentals, usually takes about an hour &#8211; sometimes even less. In fact, the skin we will use in this tutorial took only 30 minutes.</p>
<p>For this demonstration I will be using the Eco Theme from ThemeForest.net. Since this is a copyrighted theme, I won&#8217;t be able to give you the code for download, but you can purchase the template for only $12 from <a href="http://themeforest.net/item/eco-theme/22099?ref=skybluecanvas"rel="nofollow" >ThemeForest.net</a>. I selected this theme because it&#8217;s beautiful, and it has all of the elements we need to learn how to adapt just about any skin for SkyBlueCanvas.</p>
<p><img style="padding: 1px; border: 1px solid #CCC; margin-bottom: 8px;" src="http://blog.skybluecanvas.com/images/eco.jpg" alt="Eco theme screen shot" width="200" height="150" /></p>
<p>The Eco Theme from <a href="http://themeforest.net/item/eco-theme/22099?ref=skybluecanvas"rel="nofollow" >ThemeForest.net</a></p>
<h2>The Basics</h2>
<p>Since all of the HTML, CSS and JavaScript code has already been written by the theme author, our task will involve:</p>
<ul>
<li>Replacing content blocks with SkyBlueCanvas fragments</li>
<li>Replacing hard-coded page links with SkyBlueCanvas links</li>
<li>Updating CSS and JavaScript links for SkyBlueCanvas</li>
</ul>
<div class="msg-info">
<h2>Tip</h2>
<p>If you have not read our articles on <a href="http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/skybluecanvas-v11-rc1-skins-explained/">SkyBlueCanvas Skins</a> and <a href="http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/skybluecanvas-fragments-explained/">SkyBlueCanvas Fragments</a>, you may want to do so to get a full understanding of how SkyBlueCanvas creates a page.</p>
</div>
<p>Before we start, we need to create our skin directory structure. Create a new directory named eco with the following sub-folders:</p>
<p><img class="diagram" src="http://blog.skybluecanvas.com/images/diagram.skin.structure.jpg" alt="SkyBlueCanvas Skin directory structure" width="464" height="199" /></p>
<p>Next, copy the <span class="file-name">index.html</span> file from the Eco Theme to your new eco directory and rename it to <span class="file-name">skin.default.html</span>. Now copy the new eco directory to <span class="file-path">/skyblue/data/skins/</span>. Be sure to change the file permissions as needed for your hosting environment.</p>
<p>First, we need to add our links to the CSS and JavaScript files. Let&#8217;s take a look at the HTML HEAD element:</p>
<pre class="html">&lt;head&gt;
&lt;meta http-equiv="Content-Type"
  content="text/html; charset=UTF-8" /&gt;
&lt;title&gt;The Eco Company Site Template&lt;/title&gt;
&lt;link rel="stylesheet"
  href="css/style.css"
  type="text/css"
  media="screen" /&gt;
&lt;script src="js/jquery-1.2.6.js"
  type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="js/jquery.scrollTo-1.3.3.js"
  type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="js/jquery.localscroll-1.2.5.js"
  type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="js/jquery.serialScroll-1.2.1.js"
  type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="js/coda-slider.js"
type="text/javascript"&gt;&lt;/script&gt;
&lt;/head&gt;
</pre>
<p>You will notice that the paths for the CSS and JavaScript files all point to the relative paths within the skin directory. These won&#8217;t work from the front-end of your site but they are easily updated. I will just show you how to update one JavaScript and one CSS link. The others will be done the same way.</p>
<p>You will need one simple bit of PHP code to get the path to the currently active skin in SkyBlueCanvas:</p>
<pre class="php">&lt;?php echo $this-&gt;get_path(); ?&gt;
</pre>
<p>So we just need to add this code before the existing paths in the Eco Theme code:</p>
<pre class="html">&lt;head&gt;
&lt;link rel="stylesheet"
  href="&lt;?php echo $this-&gt;get_path(); ?&gt;css/style.css"
  type="text/css" media="screen" /&gt;
&lt;script src="&lt;?php echo $this-&gt;get_path(); ?&gt;js/jquery-1.2.6.js"
  type="text/javascript"&gt;&lt;/script&gt;
&lt;/head&gt;
</pre>
<p>Next, let&#8217;s tackle the header. This will be very easy. I will give you the code, then explain it.</p>
<pre class="html">&lt;div id="logo"&gt;
  &lt;h1&gt;&lt;a href="[[site.url]]"&gt;
    &lt;img src="images/logo.gif" alt="[[site.name]] logo" /&gt;
  &lt;/a&gt;&lt;/h1&gt;
&lt;/div&gt;
</pre>
<p>That&#8217;s it. All we have done is replaced the hard-coded URL of the home page and the site name with two SiteVars. Now, when our page is rendered, SkyBlueCanvas will replace these with the values you set in the SkyBlueCanvas admin.</p>
<div class="msg-info">
<h2>Tip</h2>
<p>You can find a full list of SiteVars in our article about the<br />
<a href="http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/skybluecanvas-sitevars-plugin/">SkyBlueCanvas SiteVars Plugin</a>.</p>
</div>
<p>Now we will do the same for the Contacts region of the header:</p>
<pre class="html">&lt;div id="contacts"&gt;
  &lt;!-- Contact informations here --&gt;
  &lt;p&gt;
    Call us at [[site.contact_phone]] &lt;br /&gt;
    &lt;a href="mailto:[[site.contact_email]]"&gt;
      [[site.contact_email]]
    &lt;/a&gt;
  &lt;/p&gt;
  &lt;!-- End of Contact informations --&gt;
&lt;/div&gt;
</pre>
<p>Next, let&#8217;s replace the hard-coded dynamic content blocks. Converting content blocks involves two SkyBlueCanvas concepts: Fragments and SiteVars (which we already mentioned). Fragments are scriptlets that render a particular kind of content &#8211; like a Links List &#8211; created by SkyBlueCanvas. SiteVars are tokens that refer to settings or values that you set in the SkyBlueCanvas admin. They allow you to change values related to your site, without having to change your HTML every time you update your site settings.</p>
<p>In the Eco Theme <span class="file-name">index.html</span> file, we find the following code for the header and navigation:</p>
<pre class="html">&lt;div id="header"&gt;
  &lt;div id="logo"&gt;
    &lt;h1&gt;&lt;a href="index.html"&gt;
      &lt;img src="images/logo.gif"
        alt="The Eco Company Site Template logo" /&gt;
      &lt;/a&gt;&lt;/h1&gt;
  &lt;/div&gt;
  &lt;div id="contacts"&gt;
    &lt;!-- Contact informations here --&gt;
    &lt;p&gt;
      Call us on 001123456 &lt;br /&gt;
      &lt;a href="mailto:info@ecocompany-theme.com"&gt;
        info@ecocompany-theme.com
      &lt;/a&gt;
    &lt;/p&gt;
    &lt;!-- End of Contact informations --&gt;
  &lt;/div&gt;
  &lt;div class="clear"&gt;&lt;/div&gt;
  &lt;ul id="mainmenu"&gt;
   &lt;!-- Put your menu links here --&gt;
   &lt;li&gt;&lt;a href="index.html"&gt;Home&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href="about-us.html"&gt;About Us&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href="#"&gt;Services&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href="#"&gt;Partners&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href="contact.html"&gt;Contact&lt;/a&gt;&lt;/li&gt;
   &lt;!-- End of menu links --&gt;
  &lt;/ul&gt;
&lt;/div&gt;
</pre>
<p>You can update the contact info using SiteVars like I explained earlier. We will replace the navigation with a fragment to be dynamically updated as we add and delete pages from our site. But you don&#8217;t need to write a fragment. You can simply download this fragment set: <a href="http://www.skybluecanvas.com/exts/55" rel="nofollow" >Fragments</a> and copy the entire directory to <span class="file-path">/skyblue/data/skins/eco/</span>.</p>
<p>After you have downloaded the fragment, we need to make one small change to the menu fragment. So open <span class="file-path">/fragments/menu/view.php</span> and Find the line that reads &lt;ul&gt; and change it to:</p>
<pre class="html">&lt;ul id="mainmenu"&gt;
</pre>
<p>We have simply added an ID to the UL element to match the Eco Theme style rules. I could have done this for you, but I wanted you to learn how to modify a fragment to match the template you are converting.</p>
<p>Now we can finish the header by adding the code to load the fragment when the page is created. We do that like this:</p>
<pre class="html">&lt;div id="header"&gt;
  &lt;div id="logo"&gt;
    &lt;h1&gt;&lt;a href="[[site.url]]"&gt;
      &lt;img src="images/logo.gif" alt="[[site.name]] logo" /&gt;
    &lt;/a&gt;&lt;/h1&gt;
  &lt;/div&gt;
  &lt;div id="contacts"&gt;
      &lt;!-- Contact informations here --&gt;
    &lt;p&gt;
      Call us at [[site.contact_phone]] &lt;br /&gt;
      &lt;a href="mailto:[[site.contact_email]]"&gt;
        [[site.contact_email]]
      &lt;/a&gt;
    &lt;/p&gt;
    &lt;!-- End of Contact informations --&gt;
  &lt;/div&gt;
  &lt;div class="clear"&gt;&lt;/div&gt;
  &lt;!--#plugin:fragment(menu,view)--&gt;
&lt;/div&gt;
</pre>
<p>Now our header is finished. If you are starting to suspect that this is pretty easy &#8211; you are right &#8211; it is.</p>
<p>I want to focus on helping you learn the concepts not convert a specific theme so we are going to skip the Scrolling Banner section for now. I have included the fragment required for that section in the file you just downloaded.</p>
<h2>The Main Content</h2>
<p>The main content, or body of a standard text page is created and edited in the <acronym title="What You See is What You Get">WYSIWYG</acronym> text editor in the Page Manager. We only need to tell SkyBlueCanvas where to place the content. This is accomplished using the Page Fragment that is included in the fragments download from earlier in this article.</p>
<p>The Page Fragment is just like any other fragment and is loaded the same way. So find the region of the Eco theme that the designer has designated as the maincontent area.</p>
<pre class="html">&lt;div id="main"&gt;
  &lt;div id="sidebar"&gt;
    &lt;!-- We will come back to the side bar shortly --&gt;
  &lt;/div&gt;

  &lt;div id="text"&gt;
    &lt;!-- Put your text here --&gt;

    &lt;!-- End of Text --&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>The designer, Darinka, has conveniently labeled the content area with a comment indicating that to &#8220;Put your text here&#8221;, so that is what we will do. So delete the sample content she has placed between the comments, with our Page Fragment call like this:</p>
<pre class="html">&lt;div id="main"&gt;
  &lt;div id="sidebar"&gt;
    &lt;!-- We will come back to this --&gt;
  &lt;/div&gt;

  &lt;div id="text"&gt;
    &lt;!-- Put your text here --&gt;
    &lt;!--#plugin:fragment(page,view)--&gt;
    &lt;!-- End of Text --&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>Now, when SkyBlueCanvas builds the page, it will replace the fragment call with the text we created for this page in the Page Manager.</p>
<h2>The Side Bar</h2>
<p>The side bar provides us with a good opportunity to talk a little about the usefulness of fragments and how to plan your pages when building or converting a skin for SkyBlueCanvas. We want updating our site to be as little work as possible. This means avoiding repeating or duplicating tasks and code. In fact, there is a concept in programming called <acronym title="Don't Repeat Yourself">DRY</acronym>.</p>
<p>Fragments allow us to write a single piece of code for regions of a page that will be the same for every page and every type of page. Typically our header, footer and often the side bar will be the same for every page, so we don&#8217;t want to duplicate the same code for every layout type we have. We can simply create a fragment and load the fragment in each layout style.</p>
<p>There is also even better news &#8211; fragments can be nested, so your fragments can also load fragments. For instance, if our side bar will include a Links List, we can have a side bar fragment which includes a fragment call to load the Links fragment. And this is exactly what we are going to create now.</p>
<p>I purposefully did not include the Sidebar Fragment in the download I gave you. I want you to experience writing a fragment of your own &#8211; and this is a very simple one.</p>
<p>Inside the <span class="file-path">/skyblue/data/skins/eco/fragments/</span> folder, create a new folder named <span class="file-name">sidebar</span>. Inside of this folder we need to create a sinlge PHP file named <span class="file-name">view.php</span>. View is the name of the default HTML output agent in a fragment. You can have an unlimited number of agents and you can name them anything you like, but we will use view for this example.</p>
<p>We want to inlude our Links List in the side bar, so our Sidebar Fragment View File needs to inlude the call to the Links Fragment. You are probably catching on by now and already know that we do this with the following code:</p>
<pre class="html">&lt;!--#plugin:fragment(links,view)--&gt;
</pre>
<p>Now you simply save the file. But wait, we have not actually called the Sidebar Fragment from within our page yet. We need to go back a bit and re-visit the code we modified to load the page text, and &#8211; as you probably guessed &#8211; add a fragment call to our Sidebar Fragment like this:</p>
<pre class="html">&lt;div id="main"&gt;
  &lt;div id="sidebar"&gt;
    &lt;!--#plugin:fragment(sidebar,view)--&gt;
  &lt;/div&gt;

  &lt;div id="text"&gt;
    &lt;!-- Put your text here --&gt;
    &lt;!--#plugin:fragment(page,view)--&gt;
    &lt;!-- End of Text --&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>If you recall, I said that <span class="file-name">view.php</span> is the default view of a fragment. So in our code above, the second parameter &#8216;view&#8217;, is not really necessary. We can load the default fragment view by simply calling:</p>
<pre class="html">&lt;!--#plugin:fragment(sidebar)--&gt;
</pre>
<p>The rest of this page, and the other page layouts can be converted in the same way that we have converted the elements above. I will leave the remaining elements and pages to you. You now have all of the tools you need to convert just about any HTML theme to work with SkyBlueCanvas.</p>
<p>Since I know this is your first theme conversion, I&#8217;m sure you will have questions. Please feel free to post questions in the <a href="http:forum.skybluecanvas.com" rel="nofollow" >SkyBlueCanvas Forum</a>. I try to respond within 24 hours and usually much sooner than that.</p>
<h2>A Few Caveats</h2>
<p>In this article we covered converting a basic text page template for SkyBlueCanvas. What we did not cover, however, is how to create a layout for a contact form, photo gallery or other content page that includes non-text content in the body of the page.</p>
<p>This is actually quite easy to do, and there are two ways to do it. Whether your non-text page is a contact form, photo gallery or perhaps a Flash animation, they are all fragments and therefor loaded in the same way as every other fragment.</p>
<p>You have a choice with these fragments. You can create a new page layout that is specific to the content &#8211; <span class="file-name">skin.contact.html</span> &#8211; for instance, or you can just load the fragment in a standard text page, thus using only a single layout file.</p>
<h3>Required Skin Structure</h3>
<p>As you may be aware, in v1.1 we changed the way SkyBlueCanvas skins and content publishing works. The new format gives the site designer much greater flexibility and makes content publishing simpler for the site owner. We did not want to break compatibility with the old skin format so SkyBlueCanvas can still deal with both. In order to determine which skin format is being used, SkyBlueCanvas looks for the HTML closing tag &lt;/html&gt; in the skin for whichever page is being rendered. If the closing tag is not present, SkyBlueCanvas assumes the skin is a legacy skin.</p>
<p>What this means to you when building a skin is that if you are building a skin following the new format (which you most likely will be), you must include the &lt;/html&gt; tag in the skin.{skin_name}.html file (as opposed to in a fragment).</p>
<h3>Standard Page Approach</h3>
<p>If you want to use a single page layout for all of your pages, you can create non-text or text and fragment pages, by using the in-text fragment call to load your fragment. It is very simple to do. Create a new page, for instance Contact, then in the text editor in the Page Manager,include the following token:</p>
<pre class="html">{plugin:fragment(contacts,view)}
</pre>
<h3>Content-specific Layout Approach</h3>
<p>If you prefer to use a content-specific layout (or page type), you can simply duplicate your standard page, but rather than include the page fragment call in the main content area:</p>
<pre class="html">&lt;!--#plugin:fragment(page,view)--&gt;
</pre>
<p>Replace it with the call to the fragment for that page:</p>
<pre class="html">&lt;!--#plugin:fragment(contacts,view)--&gt;
</pre>
<p>And that&#8217;s it. You now know how to convert just about any HTML theme, with an unlimited number of layouts, to work with SkyBlueCanvas.</p>
<h2>A Final Note</h2>
<p>In <span class="admin-path">Admin &gt; Pages &gt; Editor</span>, you will find a Page Type selector on the Meta Data tab. The options in this selector correspond to your HTML layout files. So if you have two layouts, <span class="file-name">skin.default.html</span> and <span class="file-name">skin.contact.html</span>, the Page Type selector will have the options default and contact. You will need to be sure to select the Page Type you wish SkyBlueCanvas to use to build each page.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/converting-themes-skybluecanvas/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SkyBlueCanvas v1.1 RC1 Skins Explained</title>
		<link>http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/skybluecanvas-v11-rc1-skins-explained/</link>
		<comments>http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/skybluecanvas-v11-rc1-skins-explained/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 06:18:54 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Skins and Templates]]></category>
		<category><![CDATA[SkyBlueCanvas CMS]]></category>
		<category><![CDATA[rc1]]></category>
		<category><![CDATA[skins]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[themes]]></category>
<category>fragments</category><category>skins</category><category>tutorials</category>
		<guid isPermaLink="false">http://blog.skybluecanvas.com/?p=50</guid>
		<description><![CDATA[If you have used an earlier release of SkyBlueCanvas and are now upgrading to v1.1 RC1, you have probably noticed that the skins are a bit different. Normally, I would not want to make a change with as much impact on existing users as this one, but the change was really necessary.

This article will explain the underlying concepts of the new skin format and the API hooks at your disposal. For users of older versions of SkyBlueCanvas, your existing skins will still work. There are some minor caveats to this that I will explain later on. ]]></description>
			<content:encoded><![CDATA[<h2>SkyBlueCanvas v1.1 RC1 Skins Explained</h2>
<p>If you have used an earlier release of SkyBlueCanvas and are now upgrading to v1.1 RC1, you have probably noticed that the skins are a bit different. Normally, I would not want to make a change with as much impact on existing users as this one, but the change was really necessary.</p>
<p>This article will explain the underlying concepts of the new skin format and the API hooks at your disposal. For users of older versions of SkyBlueCanvas, your existing skins will still work. There are some minor caveats to this that I will explain later on.</p>
<h3>Push vs. Pull Content Publishing</h3>
<p>The old skin format used a &#8220;Push&#8221; method of publishing. What this means is that you specify what content items are published in what region of a page from within the Admin Control panel. This technique has many benefits, but, unfortunately, it also has many limitations.</p>
<p>The main problem with a push technique is that too much knowledge of the presentation of the data is attached to the data itself. This is generally frowned upon in software development because it does not allow the content to be easily published in other formats such as RSS, Mobile devices, etc.</p>
<p>The new skin format uses a &#8220;Pull&#8221; method of content publishing. This is widely accepted as the &#8220;correct&#8221; way to publish content from any type of content creation/management system. As with the push method, this technique has both advantages and disadvantages. However, the advantages of a pull method far outweigh the disadvantages.</p>
<h4>The Disadvantages</h4>
<p>The primary disadvantage of the pull method is that setting up skins is a bit more work and requires a higher level of technical skills. In SkyBlueCanvas, we have tried to minimize the extra labor as much as possible.</p>
<p>The other main disadvantage is that a new template is required for each &#8220;type&#8221; of content. For instance, a Photo Gallery page will require it&#8217;s own template. We are working on a solution to do away with this requirement but for now, this requirement will have to stand.</p>
<h4>The Advantages</h4>
<p>The biggest advantage, and in my opinion, the one that outweighs every other consideration, is the unlimited flexibility that the pull method affords the designer and developer. There are literally no limitations on what you can do.</p>
<p>Using the pull method of publishing, all knowledge of presentation is removed from the data itself. This means that you can create multiple (even unlimited) views of the same data. It also means that the format of the data can be anything you want or need it to be. The same data can be delivered as XML, RSS, HTML or any other format.</p>
<h3>Fragments</h3>
<p>The key to the new skin format is what we call fragments. An easy way to think about fragments is as a piece of a page. The fragment code creates the HTML for a particular data type. For instance, if you have a collection of Links you want to display on your site, the Links Fragment will take care of generating the HTML. One neat thing about fragments, though, is that a single fragment can have numerous different HTML formats.</p>
<p>You can find a full tutorial on Fragments in the post about <a href="http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/skybluecanvas-fragments-explained/">Fragments</a></p>
<h3>Basic Skin Structure</h3>
<p>The basic structure of a SkyBlueCanvas skin is the same as any other HTML page. It is also almost identical to the old SkyBlueCanvas skin structure expect that it includes the full HTML document including the Doc Type declaration and HEAD and BODY elements.</p>
<pre class="html">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" {doc:lang}&gt;
    &lt;head profile="http://gmpg.org/xfn/11"&gt;
        &lt;title&gt;Page Title&lt;/title&gt;
        &lt;meta http-equiv="content-type"
            content="text/html; charset=UTF-8" /&gt;
    &lt;/head&gt;
    &lt;body id="home"&gt;
        &lt;div id="doc"&gt;
            &lt;div id="header"&gt;

            &lt;/div&gt;
            &lt;div id="navigation"&gt;

            &lt;/div&gt;
            &lt;div id="body"&gt;
                &lt;div id="content"&gt;

                &lt;/div&gt;
                &lt;div id="sidebar"&gt;

                &lt;/div&gt;
                &lt;div class="clear"&gt;&lt;/div&gt;
                &lt;div id="footer"&gt;

                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;</pre>
<p>The code above simply defines the structure of your HTML skin. It does not include any content or resource links (JavaScript or CSS) or meta data. We&#8217;re going to add these &#8211; in dynamic fashion &#8211; now.</p>
<p>First, we will want to add our meta data. The meta data for pages is managed both page-by-page in the Page Manager and through Admin &gt; Collections &gt; Meta Data. This means you can add, edit and delete meta data items and they are updated on your site automatically. To load the meta data, you need only a single function call, inserted in the HEAD element of the page like this:</p>
<pre class="html">&lt;head profile="http://gmpg.org/xfn/11"&gt;
    &lt;title&gt;Page Title&lt;/title&gt;
    &lt;meta http-equiv="content-type"
        content="text/html; charset=UTF-8" /&gt;
    &lt;?php echo $this-&gt;get_meta_data(); ?&gt;
&lt;/head&gt;</pre>
<p>That&#8217;s all there is to it. And most features of the SkyBlueCanvas skin will be equally as simple. So let&#8217;s move on to loading JavaScript and CSS links. These will also be inserted in the HEAD element.</p>
<pre class="html">&lt;head profile="http://gmpg.org/xfn/11"&gt;
    &lt;title&gt;Page Title&lt;/title&gt;
    &lt;meta http-equiv="content-type"
        content="text/html; charset=UTF-8" /&gt;
    &lt;?php echo $this-&gt;get_meta_data(); ?&gt;
    &lt;link rel="stylesheet"
        type="text/css"
        href="&lt;?php echo $this-&gt;get_path(); ?&gt;css/mystyles.css"
        /&gt;
    &lt;script type="text/javascript"
        src="&lt;?php echo $this-&gt;get_path(); ?&gt;js/myscripts.js"&gt;
    &lt;/script&gt;
&lt;/head&gt;</pre>
<p>The &lt;?php echo $this-&gt;get_path(); ?&gt; function automatically fills in the path to the current skin so if you want to create a new skin based on the current structure, all you need to do is copy the HTML file to the new skin folder and you won&#8217;t even need to update the paths.</p>
<p>Ok, so now for the really hard part. Just kidding. This part is a bit different but just as simple. Now we want to load the page content. This example will be for a basic text page created in Admin &gt; Pages. I will use the full HTML document for this example so you can see a fully-functional page:</p>
<pre class="html">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" {doc:lang}&gt;
    &lt;head profile="http://gmpg.org/xfn/11"&gt;
        &lt;title&gt;Page Title&lt;/title&gt;
        &lt;meta http-equiv="content-type"
            content="text/html; charset=UTF-8" /&gt;
    &lt;/head&gt;
    &lt;body id="home"&gt;
        &lt;div id="doc"&gt;
            &lt;div id="header"&gt;

            &lt;/div&gt;
            &lt;div id="navigation"&gt;

            &lt;/div&gt;
            &lt;div id="body"&gt;
                &lt;div id="content"&gt;
                    &lt;!--#plugin:fragment(page)--&gt;
                &lt;/div&gt;
                &lt;div id="sidebar"&gt;

                &lt;/div&gt;
                &lt;div class="clear"&gt;&lt;/div&gt;
                &lt;div id="footer"&gt;

                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;</pre>
<p>That was pretty easy wasn&#8217;t it?</p>
<p>Now, let&#8217;s go ahead and put our full page together with navigation, a sidebar and header and footer:</p>
<pre class="html">&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" {doc:lang}&gt;
    &lt;head profile="http://gmpg.org/xfn/11"&gt;
        &lt;title&gt;Page Title&lt;/title&gt;
        &lt;meta http-equiv="content-type"
            content="text/html; charset=UTF-8" /&gt;
    &lt;/head&gt;
    &lt;body id="home"&gt;
        &lt;div id="doc"&gt;
            &lt;div id="header"&gt;
                &lt;!--#plugin:fragment(header)--&gt;
            &lt;/div&gt;
            &lt;div id="navigation"&gt;
                &lt;!--#plugin:fragment(menu,view,menu=1)--&gt;
            &lt;/div&gt;
            &lt;div id="body"&gt;
                &lt;div id="content"&gt;
                    &lt;!--#plugin:fragment(page)--&gt;
                &lt;/div&gt;
                &lt;div id="sidebar"&gt;
                    &lt;!--#plugin:fragment(sidebar)--&gt;
                &lt;/div&gt;
                &lt;div class="clear"&gt;&lt;/div&gt;
                &lt;div id="footer"&gt;
                    &lt;!--#plugin:fragment(footer)--&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;</pre>
<p>Now, just save the above code to <span class="file-path">/skyblue_root/data/skins/your_skin/skin.standard.html</span></p>
<p>To use this template for a page, go to Admin &gt; Pages and create a new page. Enter your page text. Then on the Meta Data tab, set the Page Type to &#8220;standard&#8221;. When your new pages is requested, SkyBlueCanvas will use the template we created to build the page.</p>
<p>One final example will help round out your understanding of SkyBlueCanvas skins. This part is a little more difficult but still very simple. The example we have used so far only works for pages whose page type is set to Standard. What if you want a Gallery page?</p>
<p>You will need to read the article on <a href="http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/skybluecanvas-fragments-explained/">Fragments</a> in order to fully understand how this is done, but the page template itself, is almost identical to the Standard page, with one small change. Rather than including:</p>
<pre class="html">&lt;!--#plugin:fragment(page)--&gt;</pre>
<p>in the main content region, you will include:</p>
<pre class="html">&lt;!--#plugin:fragment(portfolio)--&gt;</pre>
<p>Full List of Template Hooks:</p>
<pre class="php">// Load the page meta data:

$this-&gt;get_meta_data();

// Getting the Skin root path:

$this-&gt;get_path();

// Getting the page title:

$this-&gt;get_page_title();

// Get the home page URL:

$this-&gt;get_home_url();

// Get the page name as a CSS ID:

$this-&gt;get_page_name();</pre>
<p>SkyBlueCanvas also has some additional hooks via the SiteVars plugin. The full list is beyond the scope of this article, but you can learn more in the blog post about <a href="http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/skybluecanvas-sitevars-plugin/">SiteVars</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.skybluecanvas.com/skybluecanvas-lightweight-cms/skybluecanvas-v11-rc1-skins-explained/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
