<?xml version="1.0" encoding="UTF-8"?>
<rss version='2.0'>
<channel>
	<title>JoshLockhart.com Tutorials</title>
	<link>http://www.joshlockhart.com/tutorials/</link>
	<description>Learn techniques for RapidWeaver, HTML, CSS, and jQuery with my written and video tutorials</description>
	<language>en-us</language>
	<copyright>Copyright 2010, Josh Lockhart. All rights reserved.</copyright>
	
	<item>
		<title>How to convert a RapidWeaver photo album to a PrettyPhoto gallery</title>
		<link>http://www.joshlockhart.com/tutorials/photo-album-to-prettyphoto</link>
		<description><![CDATA[<h2>Prerequisites</h2>




<p>This tutorial assumes your RapidWeaver theme provides built-in support for the jQuery Javascript framework. If your RapidWeaver theme does not provide built-in support for jQuery, you should <a href="http://www.joshlockhart.com/tutorials/how_to_install_jquery_in_a_rapidweaver_theme.html">add jQuery to your RapidWeaver theme</a>.</p>




<h2>Download PrettyPhoto</h2>




<p><a href="http://www.no-margin-for-errors.com/demos/prettyPhoto-jquery-lightbox-clone/prettyPhoto_compressed_2.5.6.zip">Download PrettyPhoto</a></p>




<p>Unzip the downloaded file. You should now see a &#8220;prettyPhoto/&#8221; folder. This folder contains the Javascript, CSS, and images for PrettyPhoto. Remember the location of this folder because we will need this folder for the next step.</p>




<h2>Add PrettyPhoto as a Page Asset</h2>




<p>If you haven&#8217;t already, open your website file in RapidWeaver and view your Photo Album page in Edit Mode. Open the Page Inspector for the Photo Album page and view the <em>Page Inspector &rarr; Header &rarr; Assets</em> tab. Click the &#8220;Add Files&hellip;&#8221; button, then navigate to and select the &#8220;prettyPhoto/&#8221; folder that you downloaded and unzipped earlier.</p>


<p><img src="/images/tutorials/prettyphoto_assets.png" alt="RapidWeaver Page Assets Panel"/></p>




<h2>Import Javascript and <span class="caps">CSS</span></h2>




<p>Next, while still on the <em>Page Inspector &rarr; Header</em> panel, click the <em>Header</em> tab and insert the following code into the Custom Header field:</p>




<pre class="brush:html">
&lt;link href="assets/prettyPhoto/css/prettyPhoto.css" rel="stylesheet" type="text/css" media="screen"/&gt;
&lt;script src="assets/prettyPhoto/js/jquery.prettyPhoto.js"&gt;&lt;/script&gt;
</pre>




<p><img src="/images/tutorials/prettyphoto_header.png" alt="RapidWeaver Page Header Panel"/></p>




<h2>Activate PrettyPhoto</h2>




<p>And finally, while still on the <em>Page Inspector &rarr; Header</em> panel, click the <em>Javascript</em> tab and insert the following code into the Custom Javascript field:</p>




<pre class="brush:js">
jQuery(document).ready(function($){
    $('.thumbnail-frame').each(function(){
        $('a',this).attr({
            'href' : $('a img',this).attr('src').replace(/thumb/i,'full'),
            'rel' : 'prettyPhoto[gallery]',
            'title' : $('.thumbnail-caption',this).text()
        });
    });
    $('a[rel^=prettyPhoto]').prettyPhoto();
});
</pre>




<p><img src="/images/tutorials/prettyphoto_js.png" alt="RapidWeaver Page Javascript Panel"/></p>




<p>That&#8217;s it. Preview or publish your Photo Album page and it should now use the PrettyPhoto lightbox when you click a thumbnail image.</p>




<h2>Customize PrettyPhoto</h2>




<p>For advanced users, you can easily customize the PrettyPhoto theme and PrettyPhoto settings by passing an object as the first parameter into the <code>prettyPhoto()</code> function, like this:</p>




<pre class="brush:js">
$('a[rel^=prettyPhoto]').prettyPhoto({
    theme : 'light_rounded',
    showTitle : false
});
</pre>




<p>You can find a complete list of PrettyPhoto options on the <a href="http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/documentation/">PrettyPhoto documentation website</a>.</p>]]></description>
		<guid isPermaLink="true">http://www.joshlockhart.com/tutorials/photo-album-to-prettyphoto</guid>
		<pubDate>Wed, 07 Apr 2010 00:00:00 GMT</pubDate>
	</item>
	
	<item>
		<title>What is ExtraContent and how to use it</title>
		<link>http://www.joshlockhart.com/tutorials/how-to-use-extracontent</link>
		<description><![CDATA[<h2>What is ExtraContent?</h2>




<p><a href="http://extracontent.info">ExtraContent</a> is a popular feature amongst <a href="http://www.joshlockhart.com/">RapidWeaver themes</a> that allows you (the user) to add custom code to various locations in your <a href="http://www.realmacsoftware.com/rapidweaver/">RapidWeaver</a> theme that, without ExtraContent, would otherwise be inaccessible. ExtraContent is itself Javascript code that comes built into supporting RapidWeaver themes. Not all RapidWeaver themes support ExtraContent, so check with your theme&#8217;s developer or consult your theme&#8217;s documentation to be sure.</p>




<h2>How does ExtraContent work?</h2>




<p>A RapidWeaver theme that supports ExtraContent will define specific ExtraContent containers throughout its layout. For example, my new <a href="http://www.joshlockhart.com/shop/archetype.html">Archetype RapidWeaver theme</a> provides ExtraContent locations above the content area, above and below the sidebar, and above the footer. Each ExtraContent location is assigned a number (1, 2, 3, 4, and so on). The ExtraContent container at the top left corner of the layout will have the lowest number, usually "1", and the ExtraContent location at the bottom right corner of the layout will have the highest number.</p>




<p>You, the user, can insert custom code at each ExtraContent location. To do so, you must wrap your custom code in a special <code>div</code> element and insert that <code>div</code> element into the <em>Page Inspector &rarr; Sidebar</em> panel. Why must you place the custom code in the Sidebar panel? Because RapidWeaver does not provide the tools necessary to insert custom code elsewhere.</p>




<p>For example, to add <code>&lt;h1&gt;Hello world!&lt;/h1&gt;</code> at the first ExtraContent location, you insert the following code into the <em>Page Inspector &rarr; Sidebar</em> panel.</p>




<pre class="brush:html">
    &lt;div id=&quot;myExtraContent1&quot;&gt;&lt;h1&gt;Hello world!&lt;/h1&gt;&lt;/div&gt;
</pre>




<p>Notice the <em>ID</em> attribute of the <code>div</code> element &mdash; &#8220;myExtraContent1&#8221;. This says that <code>&lt;h1&gt;Hello World!&lt;/h1&gt;</code> should be placed into the first ExtraContent location. To place this code into the second ExtraContent location, change the <code>div</code> ID attribute to &#8220;myExtraContent2&#8221;; the updated code in the <em>Page Inspector &rarr; Sidebar</em> panel looks like this:</p>




<pre class="brush:html">
    &lt;div id=&quot;myExtraContent2&quot;&gt;&lt;h1&gt;Hello world!&lt;/h1&gt;&lt;/div&gt;
</pre>




<p>To place <code>&lt;p&gt;This is more custom text&lt;/p&gt;</code> into the third ExtraContent location in addition to the code above, use the following code instead.</p>




<pre class="brush:html">
    &lt;div id=&quot;myExtraContent2&quot;&gt;&lt;h1&gt;Hello world!&lt;/h1&gt;&lt;/div&gt;
    &lt;div id=&quot;myExtraContent3&quot;&gt;&lt;p&gt;This is more custom text&lt;/p&gt;&lt;/div&gt;
</pre>




<p>As you can see, it is very easy to insert different code in different ExtraContent containers. You only need to create a new <code>div</code> element and assign it an ID attribute for the associated ExtraContent container &mdash; &#8220;myExtraContent&#8221; + the number of the ExtraContent location. The exact location for each ExtraContent container varies from theme to theme, so you should consult your theme&#8217;s documentation for this information.</p>




<p>It is <strong>very important</strong> that your custom ExtraContent code, including <code>div</code> wrappers, is rendered as <abbr title="Hypertext Markup Language">HTML</abbr> and <em>not</em> Styled Text. If you are using a Styled Text sidebar, select all of your custom ExtraContent code in the <em>Page Inspector &rarr; Sidebar</em> panel and choose <em>Format &rarr; Ignore Formatting</em> from the Main Menu. This tells RapidWeaver to render your custom ExtraContent code as <abbr title="Hypertext Markup Language">HTML</abbr>, not Styled Text.</p>




<h2>More Information</h2>




<p>This tutorial is a quick introduction to ExtraContent and how to use ExtraContent to customize your RapidWeaver website. If you need more information about ExtraContent itself, please refer to the official <a href="http://extracontent.info">ExtraContent documentation</a>.</p>]]></description>
		<guid isPermaLink="true">http://www.joshlockhart.com/tutorials/how-to-use-extracontent</guid>
		<pubDate>Sun, 04 Apr 2010 00:00:00 GMT</pubDate>
	</item>
	
	<item>
		<title>How to add a RapidSearch form to your RapidWeaver website with ExtraContent</title>
		<link>http://www.joshlockhart.com/tutorials/how-to-add-a-rapidsearch-form</link>
		<description><![CDATA[<h2>What is RapidSearch?</h2>




<p><a href="http://www.joshlockhart.com/shop/rapidsearch.html">RapidSearch</a> is the easiest way to add powerful Google<sup>&trade;</sup> search to any <a href="http://realmacsoftware.com/rapidweaver/">RapidWeaver</a> website. RapidSearch is a RapidWeaver plugin that allows you to search for web pages, images, blog entries, and news articles from your own website or from an <em>unlimited</em> number of other websites. Search results are displayed immediately on your own website with your own branding.</p>




<p>For many RapidWeaver users, however, having a dedicated search page is not sufficient. This tutorial demonstrates how to add a RapidSearch form to your RapidWeaver website&#8217;s header, sidebar, or footer so that your website&#8217;s visitors can quickly and easily search your RapidWeaver website from any page.</p>




<h2>Prerequisites</h2>




<p>This tutorial assumes you have <a href="http://www.joshlockhart.com/shop/rapidsearch.html">purchased RapidSearch</a> and have <a href="http://www.joshlockhart.com/shop/rapidsearch.html#guide">added a RapidSearch page to your RapidWeaver website</a>.</p>




<h2>The HTML markup</h2>




<p>First thing&#8217;s first. Here is the <abbr title="HyperText Markup Language">HTML</abbr> you will need to add the search form to your RapidWeaver website. <strong>It is extremely important</strong> that you change the form&#8217;s <code>action</code> attribute in the following markup so that it <em>points to your RapidSearch page</em> using a relative or absolute <abbr title="Universal Resource Locator">URL</abbr>. This markup <em>will not</em> work if the form&#8217;s <code>action</code> attribute does not point to your RapidSearch page.</p>




<pre class="brush:html">
&lt;form action=&quot;http://your_website.com/path/to/your/RapidSearch/page.html&quot; method=&quot;get&quot;&gt;
    &lt;fieldset&gt;
        &lt;input type=&quot;text&quot; name=&quot;query&quot; value=&quot;&quot;/&gt;
        &lt;input type=&quot;submit&quot; value=&quot;Search&quot;/&gt;
    &lt;/fieldset&gt;
&lt;/form&gt;
</pre>




<h2>Add the search form</h2>




<h3>With ExtraContent</h3>




<p>Follow these directions only if your RapidWeaver theme supports <a href="http://extracontent.info/">ExtraContent</a>. Many <a href="http://www.joshlockhart.com/">RapidWeaver themes</a> support ExtraContent, a feature that enables you to inject custom <abbr title="HyperText Markup Language">HTML</abbr> in various locations of your website&#8217;s layout, such as the header, sidebar, or footer. These locations vary from theme to theme, so you should consult your theme&#8217;s documentation before you choose an ExtraContent location.</p>




<ol>
    <li>Open your website file in RapidWeaver</li>
    <li>Select a page that should display the search form</li>
    <li>Open the <em>Page Inspector &rarr; Sidebar</em> panel</li>
</ol>




<p>After you open the <em>Page Inspector &rarr; Sidebar</em> panel, copy and paste the following markup into the <em>Sidebar</em> panel; ensure you apply <em>Main Menu &rarr; Format &rarr; Ignore Formatting</em> to the pasted code if your sidebar is using Styled Text formatting rather than <abbr title="HyperText Markup Language">HTML</abbr> formatting. You may need to change the <code>myExtraContent1</code> ID attribute of the ExtraContent container in the markup below, depending on the ExtraContent container you choose. For example, you may change the ID attribute to <code>myExtraContent2</code> or <code>myExtraContent3</code>. Refer to your theme&#8217;s documentation for more information about the ExtraContent containers available in your theme. Also, be sure you change the form&#8217;s <code>action</code> attribute as I mentioned above.</p>




<pre class="brush:html">
&lt;div id=&quot;myExtraContent1&quot;&gt;
    &lt;form action=&quot;/path/to/your/RapidSearch/page.html&quot; method=&quot;get&quot;&gt;
        &lt;fieldset&gt;
            &lt;input type=&quot;text&quot; name=&quot;query&quot; value=&quot;&quot;/&gt;
            &lt;input type=&quot;submit&quot; value=&quot;Search&quot;/&gt;
        &lt;/fieldset&gt;
    &lt;/form&gt;
&lt;/div&gt;
</pre>




<p><img src="http://files.joshlockhart.com/photos/rapidsearch_with_extracontent.jpg" alt="Insert RapidSearch HTML code in RapidWeaver with ExtraContent"/></p>




<h3>Without ExtraContent</h3>




<p>Follow these directions only if your RapidWeaver theme <em>does not</em> support ExtraContent.</p>




<ol>
    <li>Open your website file in RapidWeaver</li>
    <li>Select a page that should display the search form</li>
    <li>Open the <em>Page Inspector &rarr; Sidebar</em> panel</li>
</ol>




<p>After you open the <em>Page Inspector &rarr; Sidebar</em> panel, copy and paste the following markup into the <em>Sidebar</em> panel; ensure you apply <em>Main Menu &rarr; Format &rarr; Ignore Formatting</em> to the pasted code if your sidebar is using Styled Text formatting rather than <abbr title="HyperText Markup Language">HTML</abbr> formatting. Without ExtraContent, this RapidSearch form can only be added to your RapidWeaver website&#8217;s sidebar.</p>




<pre class="brush:html">
&lt;form action=&quot;/path/to/your/RapidSearch/page.html&quot; method=&quot;get&quot;&gt;
    &lt;fieldset&gt;
        &lt;input type=&quot;text&quot; name=&quot;query&quot; value=&quot;&quot;/&gt;
        &lt;input type=&quot;submit&quot; value=&quot;Search&quot;/&gt;
    &lt;/fieldset&gt;
&lt;/form&gt;
</pre>




<p><img src="http://files.joshlockhart.com/photos/rapidsearch_without_extracontent.jpg" alt="Insert RapidSearch HTML code in RapidWeaver without ExtraContent"/></p>




<h2>Search your website</h2>




<p>You will need to publish your RapidWeaver website before the new search form will work. After you publish your RapidWeaver website, open your published website in a web browser. View a page that uses the new RapidSearch form, enter a keyword in the search form, and click &#8220;Search&#8221;. Assuming you correctly changed the form&#8217;s <code>action</code> attribute, you will be directed to the RapidSearch page and shown a list of search results. Congratulations! Your website&#8217;s visitors can now search your website from any page &mdash; not just the dedicated RapidSearch page.</p>]]></description>
		<guid isPermaLink="true">http://www.joshlockhart.com/tutorials/how-to-add-a-rapidsearch-form</guid>
		<pubDate>Thu, 01 Apr 2010 00:00:00 GMT</pubDate>
	</item>
	
	<item>
		<title>How to install jQuery in a RapidWeaver theme</title>
		<link>http://www.joshlockhart.com/tutorials/how-to-install-jquery-in-a-rapidweaver-theme</link>
		<description><![CDATA[<p>
    One of the most popular Javascript frameworks available today is
    <a href="http://jquery.com/" title="Learn more about the jQuery Javascript framework">jQuery</a>, a fast and easy way to manipulate your
    website with Javascript. Many <a href="http://www.realmacsoftware.com/rapidweaver/">RapidWeaver themes</a>, including my own, include the 
    jQuery framework by default; however, many RapidWeaver themes do not. This tutorial will demonstrate how to add the jQuery 
    framework to your RapidWeaver website so you can use the many features jQuery has to offer. As cool as jQuery is, you don&#8217;t 
    need to include jQuery on <strong>every</strong> page in your website. Instead, you should only include jQuery in pages that need jQuery. 
    With this in mind, let&#8217;s get started.
</p>




<h2>Install jQuery</h2>


<p>
    Open your website file in RapidWeaver. Select a page and view its <em>Page Inspector &rarr; Header &rarr; Header</em> field. 
    Insert the following code into the <em>Header</em> field.
</p>


<pre class="brush:html">
    &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot; type="text/javascript"&gt;&lt;/script&gt;
</pre>


<p>
    This code includes the latest jQuery framework from Google&#8217;s content delivery network. This ensures the code is 
    minified (to reduce bandwidth) and delivered from a server closest to the website visitor&#8217;s physical location 
    (to reduce latency).
</p>




<h2>Avoid conflicts with other Javascript frameworks</h2>


<p>
    Next, we should make sure the included jQuery framework does not conflict with other Javascript frameworks already included on the current page. To do this, insert the following code into the <em>Page Inspector &rarr; Header &rarr; Header</em> field
    <em>immediately after</em> the code you just added (see above).
</p>


<pre class="brush:html">
&lt;script type=&quot;text/javascript&quot;&gt;
    $.noConflict();
&lt;/script&gt;
</pre>


<p>
    This code relinquishes the <code>$</code> handle to other libraries, such as 
    <a href="http://mootools.net/" title="Learn more about the MooTools Javascript framework">MooTools</a> or 
    <a href="http://www.prototypejs.org/" title="Learn more about the Prototype Javascript framework">Prototype</a>.
</p>




<h2>Start using jQuery</h2>


<p>
    Now is the fun part. Let&#8217;s write some custom code with jQuery. First, add the following Javascript <em>inside</em> 
    the <code>&lt;script&gt;</code> element (see above) <em>immediately after</em> <code>$.noConflict();</code>.
</p>


<pre class="brush:js">
jQuery(document).ready(function($){
    //add your code here
});
</pre>


<p>
    The <em>Page Inspector &rarr; Header &rarr; Header</em> tab should now read:
</p>


<pre class="brush:html">
&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
    $.noConflict();
    jQuery(document).ready(function($){
        //your code here
    });
&lt;/script&gt;
</pre>


<p>
    Next, replace "//your code here" with your own Javascript. Although we relinquished control of the <code>$</code> handle earlier 
    using <code>$.noConflict</code>, we can continue to use the <code>$</code> handle since the jQuery object is aliased by the 
    <code>.ready()</code> callback function. That's it! Now start coding.
</p>]]></description>
		<guid isPermaLink="true">http://www.joshlockhart.com/tutorials/how-to-install-jquery-in-a-rapidweaver-theme</guid>
		<pubDate>Sat, 27 Mar 2010 00:00:00 GMT</pubDate>
	</item>
	
</channel>
</rss>