<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <channel>
    
    <title>Train&#45;ee.com Free Tutorials</title>
    <link>http://www.train-ee.com/courseware/free-tutorials/</link>
    <description>Learn ExpressionEngine Fast with Free Tutorials from Train-ee.com</description>
    <dc:language>en</dc:language>
    <dc:creator>eeforme@train-ee.com</dc:creator>
    <dc:rights>Copyright 2009</dc:rights>
    <dc:date>2009-07-02T00:18:49+00:00</dc:date>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />
    

    <item>
      <title>Dynamic = &#8220;Off&#8221; Explained!</title>
      <link>http://www.train-ee.com/courseware/free-tutorials/comments/dynamic-off-explained/</link>
      <guid>http://www.train-ee.com/courseware/free-tutorials/comments/dynamic-off-explained/#When:00:18:49Z</guid>
	<description>
		<![CDATA[
			<p>If you are new to EE the <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdocs%2Fmodules%2Fweblog%2Fparameters.html%23par_dynamic">dynamic=&#8220;off&#8221;</a> parameter can be both tough to understand but also critical in getting EE to work correctly.&nbsp; I put together this corny little video to try and explain what the parameter does and when you want it on vs. off.&nbsp; Enjoy!</p>

<object width="480" height="371"> <param name="movie" value="http://content.screencast.com/users/Train-ee.com/folders/Default/media/a3c618d1-ca27-4807-aefe-60d6bbbd33ef/flvplayer.swf"></param> <param name="quality" value="high"></param> <param name="bgcolor" value="#FFFFFF"></param> <param name="flashVars" value="thumb=http://content.screencast.com/users/Train-ee.com/folders/Default/media/a3c618d1-ca27-4807-aefe-60d6bbbd33ef/FirstFrame.jpg&amp;containerwidth=480&amp;containerheight=371&amp;content=http://content.screencast.com/users/Train-ee.com/folders/Default/media/a3c618d1-ca27-4807-aefe-60d6bbbd33ef/dynamic_off.mp4"></param> <param name="allowFullScreen" value="true"></param> <param name="scale" value="showall"></param> <param name="allowScriptAccess" value="always"></param> <param name="base" value="http://content.screencast.com/users/Train-ee.com/folders/Default/media/a3c618d1-ca27-4807-aefe-60d6bbbd33ef/"></param>&nbsp; <embed src="http://content.screencast.com/users/Train-ee.com/folders/Default/media/a3c618d1-ca27-4807-aefe-60d6bbbd33ef/flvplayer.swf" quality="high" bgcolor="#FFFFFF" width="480" height="371" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/Train-ee.com/folders/Default/media/a3c618d1-ca27-4807-aefe-60d6bbbd33ef/FirstFrame.jpg&amp;containerwidth=480&amp;containerheight=371&amp;content=http://content.screencast.com/users/Train-ee.com/folders/Default/media/a3c618d1-ca27-4807-aefe-60d6bbbd33ef/dynamic_off.mp4" allowFullScreen="true" base="http://content.screencast.com/users/Train-ee.com/folders/Default/media/a3c618d1-ca27-4807-aefe-60d6bbbd33ef/" scale="showall"></embed> </object>

<p>&nbsp;</p> 
		]]>
	</description>       

      <dc:subject>Quick n Dirty Screencasts</dc:subject>
      <dc:date>2009-07-02T00:18:49+00:00</dc:date>
    </item>

    <item>
      <title>Simple Multifaceted Navigation Using Categories</title>
      <link>http://www.train-ee.com/courseware/free-tutorials/comments/simple-multifaceted-navigation-using-categories/</link>
      <guid>http://www.train-ee.com/courseware/free-tutorials/comments/simple-multifaceted-navigation-using-categories/#When:14:36:51Z</guid>
	<description>
		<![CDATA[
			<p>I needed a way to assign two category groups to one weblog, assign entries into categories in each group, and then build navigation based on those category assignments.&nbsp; However rather than the typical EE way of selecting one category and getting a list of results, I wanted another navigation level where after choosing a category from category group A the site would present a filtered list of categories from group B based on the selection from Group A.&nbsp; </p>

<p>Does that make sense?&nbsp; Here&#8230;maybe showing is better than telling in this case:</p>

<object width="480" height="386"> <param name="movie" value="http://content.screencast.com/users/train-ee/folders/Jing/media/63d1d9fd-dfc0-4778-8d77-c627163e6697/jingh264player.swf"></param> <param name="quality" value="high"></param> <param name="bgcolor" value="#FFFFFF"></param> <param name="flashVars" value="thumb=http://content.screencast.com/users/train-ee/folders/Jing/media/63d1d9fd-dfc0-4778-8d77-c627163e6697/FirstFrame.jpg&amp;containerwidth=480&amp;containerheight=386&amp;showbranding=false&amp;content=http://content.screencast.com/users/train-ee/folders/Jing/media/63d1d9fd-dfc0-4778-8d77-c627163e6697/2009-06-23_1129.mp4"></param> <param name="allowFullScreen" value="true"></param> <param name="scale" value="showall"></param> <param name="allowScriptAccess" value="always"></param> <param name="base" value="http://content.screencast.com/users/train-ee/folders/Jing/media/63d1d9fd-dfc0-4778-8d77-c627163e6697/"></param>&nbsp; <embed src="http://content.screencast.com/users/train-ee/folders/Jing/media/63d1d9fd-dfc0-4778-8d77-c627163e6697/jingh264player.swf" quality="high" bgcolor="#FFFFFF" width="480" height="386" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/train-ee/folders/Jing/media/63d1d9fd-dfc0-4778-8d77-c627163e6697/FirstFrame.jpg&amp;containerwidth=480&amp;containerheight=386&amp;showbranding=false&amp;content=http://content.screencast.com/users/train-ee/folders/Jing/media/63d1d9fd-dfc0-4778-8d77-c627163e6697/2009-06-23_1129.mp4" allowFullScreen="true" base="http://content.screencast.com/users/train-ee/folders/Jing/media/63d1d9fd-dfc0-4778-8d77-c627163e6697/" scale="showall"></embed> </object><p>
<br /><br />
If that helped and you want to see how it was done&#8230;read on!</p>

 <p>So just to recap - in this tutorial I have a weblog containing business names.&nbsp; The weblog has two category groups assigned to it - one category containing state names and the other business types.&nbsp; On the site I want to allow users to navigate to a final list of entries in two ways:
</p><ul><li>Select a state</li>
<li>Get a list of valid (only those actually containing results) business types for that state</li>
<li>Select a business type</li>
<li>Get a list of businesses of that type doing business in that state</li></ul>

<p>or</p>

<ul><li>Select a business type</li>
<li>Get a list of valid states (only those actually containing results) having that business type in them</li>
<li>Select a state</li>
<li>Get a list of businesses of that type doing business in that state.</li></ul>

<p><a href="http://www.expressionengine.com/index.php?affiliate=boyink">ExpressionEngine</a> lets you assign multiple category groups to one weblog - which from a content entry and maintenance point of view gets me where I want to be.&nbsp; However there is no built-in way of getting the categories to interact with each other as outlined above - where second-level category list is filtered by a choice from a first-level category group.&nbsp; </p>

<p>I see this as navigation based on a very simplistic <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FFaceted_classification">faceted classification</a> or what I&#8217;ve seen called &#8220;multifaceted navigation&#8221;.&nbsp; I&#8217;m not sure how far you could push this approach with more than two facets but this should provide a good jumping-off point.</p>

<p><strong>Assumptions</strong>
</p><ul>
<li>Your categories are only one layer deep - no nested subcategories</li>
<li>Your category url titles are unique</li>
</ul>

<p><strong>Setup Requirements</strong><br />
Since this is a more advanced tutorial I&#8217;m going to assume you can get through the following without step by step instructions. 
</p><ul>
<li>Weblog named &#8220;businesses&#8221;. For the purposes of this tutorial I have no additional custom fields assigned - all I&#8217;m using is the default title field</li>
<li>Two category groups - one for states and one for business types</li>
<li>Some categories created within the category groups - again all with unique category_url_titles</li>
<li>Knowledge of the category group IDs</li>
<li>No other weblog using those category groups</li>
<li>A number of entries posted into the weblog and assigned to various combinations of categories</li>
<li>The EE <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3Ddocs%2Fmodules%2Fquery%2Findex.html">Query Module</a> (which is not available in the Core version)</li>
<li>The <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Floweblog.com%2Ffreelance%2Farticle%2Fee-low-seg2cat-extension%2F">Seg2Cat Extension</a> from Lodewijk Schutte installed</li>
</ul>

<p><strong>The Index Template</strong><br />
I&#8217;ve included the templates used here as a downloadable zip file - but let&#8217;s walk through the logic here a template at a time.&nbsp; </p>

<p>The index template has the following code:
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">&#123;if&nbsp;segment_2&nbsp;</span><span style="color: #007700">==</span><span style="color: #DD0000">""</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">h2</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Select&nbsp;a&nbsp;State</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h2</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;exp</span><span style="color: #007700">:</span><span style="color: #0000BB">weblog</span><span style="color: #007700">:</span><span style="color: #0000BB">categories&nbsp;weblog</span><span style="color: #007700">=</span><span style="color: #DD0000">"businesses"&nbsp;</span><span style="color: #0000BB">category_group</span><span style="color: #007700">=</span><span style="color: #DD0000">"2"&nbsp;</span><span style="color: #0000BB">show_empty</span><span style="color: #007700">=</span><span style="color: #DD0000">"no"&nbsp;</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">a&nbsp;href</span><span style="color: #007700">=</span><span style="color: #DD0000">"/index.php/businesses/in/&#123;category_url_title&#125;/"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#123;category_name&#125;</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">exp</span><span style="color: #007700">:</span><span style="color: #0000BB">weblog</span><span style="color: #007700">:</span><span style="color: #0000BB">categories&#125;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">h2</span><span style="color: #007700">&gt;or&nbsp;</span><span style="color: #0000BB">Select&nbsp;a&nbsp;Business&nbsp;Type</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h2</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;exp</span><span style="color: #007700">:</span><span style="color: #0000BB">weblog</span><span style="color: #007700">:</span><span style="color: #0000BB">categories&nbsp;weblog</span><span style="color: #007700">=</span><span style="color: #DD0000">"businesses"&nbsp;</span><span style="color: #0000BB">category_group</span><span style="color: #007700">=</span><span style="color: #DD0000">"4"&nbsp;</span><span style="color: #0000BB">show_empty</span><span style="color: #007700">=</span><span style="color: #DD0000">"no"</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">a&nbsp;href</span><span style="color: #007700">=</span><span style="color: #DD0000">"/index.php/businesses/type/&#123;category_url_title&#125;/"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#123;category_name&#125;</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">exp</span><span style="color: #007700">:</span><span style="color: #0000BB">weblog</span><span style="color: #007700">:</span><span style="color: #0000BB">categories&#125;<br /><br />&#123;if</span><span style="color: #007700">:elseif&nbsp;</span><span style="color: #0000BB">segment_2</span><span style="color: #007700">==</span><span style="color: #DD0000">"in"</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">h2</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Business&nbsp;Types&nbsp;in&nbsp;&#123;segment_3_category_name&#125;</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h2</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;embed</span><span style="color: #007700">=</span><span style="color: #DD0000">"businesses/get_categories"&nbsp;</span><span style="color: #0000BB">from_category_group</span><span style="color: #007700">=</span><span style="color: #DD0000">"4"</span><span style="color: #0000BB">&#125;<br /><br />&#123;if</span><span style="color: #007700">:elseif&nbsp;</span><span style="color: #0000BB">segment_2</span><span style="color: #007700">==</span><span style="color: #DD0000">"type"</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">h2</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">States&nbsp;with&nbsp;&#123;segment_3_category_name&#125;&nbsp;Businesses</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h2</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;embed</span><span style="color: #007700">=</span><span style="color: #DD0000">"businesses/get_categories"&nbsp;</span><span style="color: #0000BB">from_category_group</span><span style="color: #007700">=</span><span style="color: #DD0000">"2"</span><span style="color: #0000BB">&#125;<br />&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">if&#125;&nbsp;</span>
</span>
</code></div>

<p>The first clause in the if statement handles the &#8220;index&#8221; view of the template before any choice has been made.&nbsp; All I&#8217;m doing there is using the standard <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3Ddocs%2Fmodules%2Fweblog%2Fcategories.html">weblog categories</a> tag to return the top-level choices for each group.&nbsp; Do note the links that I&#8217;m building are not traditional EE category links - I&#8217;m rolling my own here.&nbsp; Businesses is the name of the template group I&#8217;m operating out of.&nbsp; This is the index template, so everything else is virtual.&nbsp; In the next segment I use either &#8220;in&#8221; or &#8220;type&#8221; keywords, then append on the category url title.&nbsp; Clicking any of these links reloads this template (because there are no actual saved templates with the names of &#8220;in&#8221; or &#8220;type&#8221;).</p>

<p>When the template is re-loaded after clicking a top-level category link, one of the next two clauses in the if statement fires, and this is where the Seg2Cat extension kicks in by providing the {segment_3_category_name} variable, which looks at segment 3, sees the category_url_title and returns the category name for it.</p>

<p>Now EE needs to take the selected category, look through the entries in the businesses weblog in that category, and see what categories those entries are assigned to in the <em>other </em>category group.&nbsp; That happens in the embedded &#8220;get_categories&#8221; template&#8212;and that template is made reusable by passing the ID of the category group we want results from.&nbsp; Here&#8217;s the code in that template:</p>

<p><strong>The Embedded Template</strong>
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">&lt;</span><span style="color: #0000BB">ul</span><span style="color: #007700">&gt;<br /></span><span style="color: #0000BB">&#123;exp</span><span style="color: #007700">:</span><span style="color: #0000BB">query&nbsp;sql</span><span style="color: #007700">=</span><span style="color: #DD0000">"<br />&nbsp;&nbsp;&nbsp;&nbsp;SELECT&nbsp;exp_categories_1.cat_id&nbsp;AS&nbsp;my_cat_id,&nbsp;exp_categories_1.cat_name&nbsp;AS&nbsp;my_cat_name,&nbsp;exp_categories_1.cat_url_title&nbsp;AS&nbsp;my_cat_url_title<br />&nbsp;&nbsp;&nbsp;&nbsp;FROM&nbsp;(((exp_categories&nbsp;INNER&nbsp;JOIN&nbsp;exp_category_posts&nbsp;ON&nbsp;exp_categories.cat_id&nbsp;=&nbsp;exp_category_posts.cat_id)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INNER&nbsp;JOIN&nbsp;exp_category_posts&nbsp;AS&nbsp;exp_category_posts_1&nbsp;ON&nbsp;exp_category_posts.entry_id&nbsp;=&nbsp;exp_category_posts_1.entry_id)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INNER&nbsp;JOIN&nbsp;exp_categories&nbsp;AS&nbsp;exp_categories_1&nbsp;ON&nbsp;exp_category_posts_1.cat_id&nbsp;=&nbsp;exp_categories_1.cat_id)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;INNER&nbsp;JOIN&nbsp;exp_weblog_titles&nbsp;AS&nbsp;exp_weblog_titles_1&nbsp;ON&nbsp;exp_category_posts.entry_id&nbsp;=&nbsp;exp_weblog_titles_1.entry_id<br />&nbsp;&nbsp;&nbsp;&nbsp;WHERE&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(((exp_categories_1.parent_id)=0)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AND&nbsp;((exp_categories.cat_id)=&#123;segment_3_category_id&#125;)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AND&nbsp;((exp_categories_1.group_id)=&#123;embed:from_category_group&#125;)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AND&nbsp;((exp_weblog_titles_1.status)='open'))<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;GROUP&nbsp;BY&nbsp;exp_categories_1.cat_id,&nbsp;exp_categories_1.cat_name,&nbsp;exp_categories_1.cat_url_title,&nbsp;exp_categories_1.cat_order<br />&nbsp;&nbsp;&nbsp;&nbsp;ORDER&nbsp;BY&nbsp;exp_categories_1.cat_order;"</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">li</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">a&nbsp;href</span><span style="color: #007700">=</span><span style="color: #DD0000">"/index.php/businesses/list/&#123;segment_3&#125;/&#123;my_cat_url_title&#125;/"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#123;my_cat_name&#125;</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/</span><span style="color: #0000BB">li</span><span style="color: #007700">&gt;<br /></span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">exp</span><span style="color: #007700">:</span><span style="color: #0000BB">query&#125;<br /></span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">ul</span><span style="color: #007700">&gt;&nbsp;</span>
</span>
</code></div>

<p>This query essentially:
</p><ul>
<li>Takes a known category ID</li>
<li>Takes a known category group ID</li>
<li>Finds entries assigned to the known category ID</li>
<li>Makes sure those entries have an &#8220;open&#8221; status</li>
<li>Finds what other categories those entries have been assigned to&#8212;from the category group represented by the known category group ID</li>
<li>Builds a list of the unique values it finds</li>
<li>Creates links that contain url_titles from both categories</li>
<li>Orders those results as per the order specified in the Control Panel<li>
</ul>

<p><em>Note - for this example I&#8217;m not specifying a weblog.&nbsp; If you need to narrow the results to a specific weblog you can do that by appending onto the queries WHERE clause and specify the weblog ID.&nbsp; You could also pass that in as an embedded variable if you needed this embedded template to be flexible in what weblog it looked at.</em></p>

<p>Again the magic happening in this code is provided by the Seg2Cat extension that gives access to a category ID based on the category url title currently being displayed.&nbsp; The extension comes in handy yet again on the final template - the list template:</p>

<p><strong>The List Template</strong>
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">&lt;</span><span style="color: #0000BB">h2</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#123;segment_3_category_name&#125;&nbsp;&#123;segment_4_category_name&#125;&nbsp;Businesses</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h2</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">ul</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;exp</span><span style="color: #007700">:</span><span style="color: #0000BB">weblog</span><span style="color: #007700">:</span><span style="color: #0000BB">entries&nbsp;weblog</span><span style="color: #007700">=</span><span style="color: #DD0000">"businesses"&nbsp;</span><span style="color: #0000BB">category</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;segment_3_category_id&#125;&amp;&#123;segment_4_category_id&#125;"</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">li</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#123;title&#125;</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">li</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">exp</span><span style="color: #007700">:</span><span style="color: #0000BB">weblog</span><span style="color: #007700">:</span><span style="color: #0000BB">entries&#125;<br /></span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">ul</span><span style="color: #007700">&gt;&nbsp;</span>
</span>
</code></div>

<p>Seg2Cat is necessary here to get around another limitation of the native weblog:entries tag&#8212;in that while it has the <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3Ddocs%2Fmodules%2Fweblog%2Fparameters.html%23par_category">category parameter</a> which can find only entries that exist in two categories, it needs category ID&#8217;s rather than the more SEO-friendly category_url_titles.&nbsp; Seg2Cat again steps in to provide the translation of category_url_titles to category IDs - so now I can have URLs like:</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">/</span><span style="color: #0000BB">index</span><span style="color: #007700">.</span><span style="color: #0000BB">php</span><span style="color: #007700">/</span><span style="color: #0000BB">businesses</span><span style="color: #007700">/list/</span><span style="color: #0000BB">alabama</span><span style="color: #007700">/</span><span style="color: #0000BB">big_box_retailer</span><span style="color: #007700">/&nbsp;</span>
</span>
</code></div><p>
or 
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">/</span><span style="color: #0000BB">index</span><span style="color: #007700">.</span><span style="color: #0000BB">php</span><span style="color: #007700">/</span><span style="color: #0000BB">businesses</span><span style="color: #007700">/list/</span><span style="color: #0000BB">big_box_retailer</span><span style="color: #007700">/</span><span style="color: #0000BB">alabama</span><span style="color: #007700">/&nbsp;</span>
</span>
</code></div>

<p>...and the weblog:entries tag can still function.&nbsp; Note also that while these URLs are using category_url_titles they are not using the typical /category/ segment needed when using EE categories.</p>

<p>So there you have it!&nbsp; While this tutorial is a bit more advanced, what with an extension, embedded template using an embedded variable, segment variables, and conditionals&#8212; it all comes together to create a nifty little front-end navigation approach with search-friendly URLs and easy client content maintenance.</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>
		]]>
	</description>       

      <dc:subject>Advanced Coding, Static Content / Dynamic Nav</dc:subject>
      <dc:date>2009-06-23T14:36:51+00:00</dc:date>
    </item>

    <item>
      <title>Splitting a Site out of an ExpressionEngine Multiple Site Manager Installation</title>
      <link>http://www.train-ee.com/courseware/free-tutorials/comments/splitting-a-site-out-of-an-ee-msm-installation/</link>
      <guid>http://www.train-ee.com/courseware/free-tutorials/comments/splitting-a-site-out-of-an-ee-msm-installation/#When:19:46:38Z</guid>
	<description>
		<![CDATA[
			<p>As part of the <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.train-ee.com%2Fcourseware%2Ffree-tutorials%2Fcategory%2Fbuilding-a-church-site%2F">Building a Church Site Series</a> I&#8217;ll be auctioning off a copy of the complete site with proceeds going to charity.&nbsp; Part of my preparations for that auction are getting the site installed on it&#8217;s own hosting account.&nbsp; No big deal, except for Train-ee.com uses the <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdownloads%2Fdetails%2Fmultiple_site_manager%2F">Multiple Site Manager</a> to run the main site plus the church site and the <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fsmall-business.train-ee.com%2F">Small Business Site</a> featured in an <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.train-ee.com%2Fcourseware%2Ffree-tutorials%2Fcategory%2Fbuilding-a-small-business-site%2F">earlier series</a>.&nbsp; There is no automated way to pull a single site out of an MSM installation, so this article will cover the process I went through to do so.
</p> <p><strong>Disclaimer</strong><br />
<em>Methods used in this article directly manipulate the EE database and as such are somewhat risky.&nbsp; They are best undertaken by people experienced with databases and SQL statements. By no means do this on a live site!&nbsp; Make a backup or two before proceeding, and do your manipulations on a copy. And - proceed at your own risk.&nbsp; I or Train-ee.com will not be held responsible for damage inflicted to your site by attempting this work on your own.</em></p>

<p><strong>The Situation:</strong><br />
OK - so here&#8217;s what I had:
</p><ul><li>Three sites total, with the target site being #2</li>
<li>A whole bunch of registered user accounts in multiple member groups</li>
<li>All templates stored in the database (vs external flat files)</li>
<li>Site hosted at EngineHosting (who do, in fact, rock)</li>
</ul>

<p><strong>Starting Out</strong><br />
I did what anyone in this situation might do - searched the EE Forums to see if anyone else had done this and posted any tips or gotchas.&nbsp; I came up with <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fexpressionengine.com%2Fforums%2Fviewthread%2F91313%2F">this thread</a> which served to lay out my basic workflow:
</p><ul><li>Make a backup of the entire site</li>
<li>Download the database locally for manipulation</li>
<li>Delete Site #3 entirely<li>
<li>Clean out all weblogs, field groups, status groups, member accounts, template groups and templates from Site #1</li>
<li>Go through the database and change all site_id&#8217;s currently storing Site #2 to store Site #1 instead (effectively moving all EE backend objects from Site #2 to Site #1)</li>
<li>Once Site #2 objects have been moved over to Site #1, delete Site #2</li>
<li>Once done/successful upload single site to new host</li>
</ul>

<p>I had a feeling this would make a good article for Train-ee so kept notes during the process.&nbsp; Below are those notes, prettied up a bit, but still including the stops and starts that I ran into as I felt it was important to note what kind of issues can come up in this type of work.</p>

<p><strong>Loading the Database</strong><br />
I logged into the EngineHosting Control Panel and did a databse backup of Train-ee.com using PHPMySQL.&nbsp; So far so good.</p>

<p>Once I had the db backup saved locally I fired up my WAMP setup and set about to load the database locally.&nbsp; Attempting to import the database using the PHPMySQL interface I got a PHP file size limit error.&nbsp; I&#8217;ve run into this before trying to load tables back into the database and found this <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.ozerov.de%2Fbigdump.php">Staggered MySQL Dump Importer Script</a> named BigDump that works a treat.&nbsp; I configured that and ran it, but then ran into an error about the database backup containing Extended Inserts.&nbsp; I went back to the Train-ee hosting control panel and re-ran the export with Complete Inserts only.&nbsp; I ran BigDump again and the database imported without error.</p>

<p><strong>EE Control Panel</strong><br />
I loaded ExpressionEngine but found that the Control Panel wasn&#8217;t loading any styles. I updated paths under Admin  / System Preferences to no avail.&nbsp; I then also noticed that my local EE install was 1.6.6 yet - and worried about bringing in 1.6.7 data to an 1.6.6 install.&nbsp; I updated ExpressionEngine to 1.6.7 successfully but still had no Control Panel styles.</p>

<p>I found that the Theme Folder Path still wasn&#8217;t correct (I looked at the WAMP/EE setup on another system for direction).&nbsp; I specified a full path for the theme folder starting from C:\ and once I updated the Control Panel styles returned.&nbsp;  I also had to remember to update these same paths in the configuration of the other MSM sites.</p>

<p><strong>Re-arranging the Furniture</strong><br />
I deleted Site #3 using the CP interface - easy peasey there.</p>

<p>I then set about deleting all the objects within Site #1:
</p><ul><li>Weblogs</li>
<li>Field Groups</li>
<li>Category Groups</li>
<li>Custom Status Groups</li>
<li>Template Groups</li>
<li>Member Groups</li>
</ul>

<p><strong>Member Accounts</strong><br />
<strong><em>Remember - deleting members also deletes their entries and comments.&nbsp; This was fine in my case but may not be for you if your site has user-generated content that you wish to move over.</em></strong></p>

<p>While I was deleting member groups, ExpressionEngine put all the members into Banned group - which you can&#8217;t delete.&nbsp; I still wanted all these accounts gone, so at first started deleting members via the Control Panel.&nbsp; This only deletes 30 or so at a time, however so I started to wonder if a SQL-based approach might work faster. I turned on <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.expressionengine.com%2Fdocs%2Fcp%2Fadmin%2Fsystem_preferences%2Foutput_and_debugging_preferences.html">Display SQL Queries</a> in hopes of being able to copy and modify the query that EE generates and delete all the members at once, but the queries are relatively complex with ID&#8217;s getting specified everywhere so that approach looked too hard.&nbsp; I ended up just turning the queries back off and used interface controls to delete all member accounts except for my SuperAdmin login.</p>

<p><strong>Database Updates</strong><br />
When you install the MSM Expansion, EE makes use of a Site ID contained in many of the tables.&nbsp; The value in this field tells EE which site a particular database record is associated with.&nbsp; The task at hand, then, is to go through the database, find those records that have a site_id of &#8220;2&#8221;, and change those records to instead have a site_id of &#8220;1&#8221;.&nbsp; This effectively moves all backend objects from Site #2 to Site #1.&nbsp; I recommend doing this table by table, as I ran into a few that I choose not to touch.&nbsp; </p>

<p>Here is the query statement I used:</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">UPDATE&nbsp;exp_table_name_here&nbsp;SET&nbsp;exp_table_name_here</span><span style="color: #007700">.</span><span style="color: #0000BB">site_id&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"1"</span><span style="color: #007700">;&nbsp;</span>
</span>
</code></div>

<p>I kept this query in a Notepad document where I could change the table name as needed.&nbsp; </p>

<p>There are two spots in the EE interface you want to be in during this process - so have two tabs or two browser windows available. Both of these are found under Admin > Utilities > SQL Manager.&nbsp; The first one you want is the <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3Ddocs%2Fcp%2Fadmin%2Futilities%2Fsql_query_form.html">SQL Query Form</a>.&nbsp; The other one is the <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3Ddocs%2Fcp%2Fadmin%2Futilities%2Fsql_manage_tables.html">Manage Database Tables</a> interface.&nbsp; Note that you could do this all within PHPMySQL as well, I just chose to stay in ExpressionEngine.</p>

<p>The workflow is:
</p><ul><li>Go through the Manage Database Tables interface one table at a time</li>
<li>Look for tables that have data</li>
<li>Click the Browse link to take a look at the data</li>
<li>If the table has the site_id field (usually it&#8217;s one of the first couple of fields) then the update query needs to run on that table</li>
<li>Edit the SQL query to use the name of the table you&#8217;re looking at</li>
<li>Paste that query into the SQL Query Form</li>
<li>Click Submit - You should get a message about the number of rows affected</li></ul>

<p>Here&#8217;s my list - if a table is mentioned with no notes I ran the query against it.&nbsp; Tables not mentioned either had no data or no site_id field.&nbsp; Tables with notes had the data but I chose to leave them alone for reasons indicated:
</p><ul><li>exp_categories</li>
<li>exp_category_field_data</li>
<li>exp_category_groups</li>
<li>exp_comments</li>
<li>exp_cp_log</li>
<li>exp_field_groups</li>
<li>exp_html_buttons</li>
<li>exp_member_groups: I left this one alone as I didn&#8217;t want to mess up my own login.&nbsp; I figured appropriate member groups will be deleted when site #2 is deleted.</li>
<li>exp_online_users</li>
<li>exp_referrers</li>
<li>exp_search_log</li>
<li>exp_sites - I&#8217;m going to leave this one alone as well as I expect it&#8217;ll get updated when I delete Site #2</li>
<li>exp_specialty_templates - going to leave this one alone assuming deletions will happen here when I delete Site #2</li>
<li>exp_stats: I&#8217;m also leaving this one alone as it&#8217;s not mission critical and I expect it to be updated when I delete Site #2.</li>
<li>exp_status_groups</li>
<li>exp_template_groups</li>
<li>exp_templates</li>
<li>exp_upload_prefs</li>
<li>exp_weblog_data</li>
<li>exp_weblog_fields</li>
<li>exp_weblog_titles</li>
<li>exp_weblogs</li></ul>

<p>With the database updates all done I went back through the EE Control Panel - and it appeared to have worked.&nbsp; All template groups, weblogs, posts, field groups, category groups etc that were all previously in Site #2 were now showing in Site #1. I made a few quick posts, saving then deleting them with no error. I then went into the Sites menu and deleted Site #2.</p>

<p><strong>The Rest of the Site</strong><br />
I then moved all ancillary files from server to local - images, JavaScript files, etc. Once these were pulled down I tried to load the site in my browser.&nbsp; I forgot a couple of plugin files and got an error to that extent.&nbsp; Once I installed the missing plugins the site loaded and functioned normally.</p>

<p>Success!&nbsp; At this point the site is running well locally - and I foresee no real issues with loading it up to a new hosting account where it can stand on it&#8217;s own feet.&nbsp; </p>

<p><strong>The Last Step</strong><br />
There&#8217;s no real way to &#8220;completely uninstall&#8221; MSM - the site_id field will remain in the database  The last step - to remove the MSM related options from the CP - would be to edit the config.php file to include:
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">$conf&#91;</span><span style="color: #DD0000">'multiple_sites_enabled'</span><span style="color: #0000BB">&#93;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"n"</span><span style="color: #007700">;&nbsp;</span>
</span>
</code></div>

<p>(Thanks to the EE Tech Support staff for input on that one).</p>

<p>I&#8217;d say this process took roughly 2.5 to 3 hours&#8212;and while it&#8217;s always a bit unnerving to go muck about at the database level it seemed to come off fairly easily.&nbsp; If you undertake this process and encounter other issues or gotchas be sure to leave a comment!
</p>
		]]>
	</description>       

      <dc:subject>Advanced Coding</dc:subject>
      <dc:date>2009-04-08T19:46:38+00:00</dc:date>
    </item>

    <item>
      <title>Comment Spam Prevention Extension for ExpressionEngine</title>
      <link>http://www.train-ee.com/courseware/free-tutorials/comments/comment-spam-prevention-extension-for-expressionengine/</link>
      <guid>http://www.train-ee.com/courseware/free-tutorials/comments/comment-spam-prevention-extension-for-expressionengine/#When:14:51:11Z</guid>
	<description>
		<![CDATA[
			<p>In a <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.train-ee.com%2Fcourseware%2Ffree-tutorials%2Fcomments%2Fexpressionengine-comments-editing-in-groups-and-moving%2F">previous screencast</a> I showed how to delete comments in bulk - handy for those times when your site gets alot of spam comments.&nbsp; What I want to make sure is that you know that there are tools out there to help prevent getting spam in the first place.&nbsp;  In addition to the popular <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Floweblog.com%2Ffreelance%2Farticle%2Fakismet-for-expression-engine%2F">Askimet</a> and <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fexpressionengine.com%2Fdownloads%2Fdetails%2Fbad_behavior%2F">Bad Behavior</a> extensions there is also a lesser-known <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fexpressionengine.com%2Fdownloads%2Fdetails%2Fcomment_spam_prevention%2F">Comment Spam Prevention</a> extension for <a href="http://www.expressionengine.com/index.php?affiliate=boyink">ExpressionEngine</a>-based sites, and this extension is the feature of this installment in the quick and dirty screencast series.
</p> <object width="470" height="269"> <param name="movie" value="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/529dbc98-3daa-409c-856e-f7a0428ecefe/jingh264player.swf"></param> <param name="quality" value="high"></param> <param name="bgcolor" value="#FFFFFF"></param> <param name="flashVars" value="thumb=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/529dbc98-3daa-409c-856e-f7a0428ecefe/FirstFrame.jpg&amp;containerwidth=470&amp;containerheight=269&amp;showbranding=false&amp;content=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/529dbc98-3daa-409c-856e-f7a0428ecefe/2009-04-07_1043.mp4"></param> <param name="allowFullScreen" value="true"></param> <param name="scale" value="showall"></param> <param name="allowScriptAccess" value="always"></param> <param name="base" value="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/529dbc98-3daa-409c-856e-f7a0428ecefe/"></param>&nbsp; <embed src="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/529dbc98-3daa-409c-856e-f7a0428ecefe/jingh264player.swf" quality="high" bgcolor="#FFFFFF" width="470" height="269" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/529dbc98-3daa-409c-856e-f7a0428ecefe/FirstFrame.jpg&amp;containerwidth=470&amp;containerheight=269&amp;showbranding=false&amp;content=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/529dbc98-3daa-409c-856e-f7a0428ecefe/2009-04-07_1043.mp4" allowFullScreen="true" base="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/529dbc98-3daa-409c-856e-f7a0428ecefe/" scale="showall"></embed> </object><p>
<br /><br />
<br />
</p>
		]]>
	</description>       

      <dc:subject>Quick n Dirty Screencasts</dc:subject>
      <dc:date>2009-04-07T14:51:11+00:00</dc:date>
    </item>

    <item>
      <title>Adding Tabs in the Control Panel</title>
      <link>http://www.train-ee.com/courseware/free-tutorials/comments/adding-tabs-in-the-control-panel/</link>
      <guid>http://www.train-ee.com/courseware/free-tutorials/comments/adding-tabs-in-the-control-panel/#When:13:47:37Z</guid>
	<description>
		<![CDATA[
			<p>In this short screencast I show how to add tabs to the <a href="http://www.expressionengine.com/index.php?affiliate=boyink">ExpressionEngine</a> Control Panel main navigation.&nbsp; Adding tabs to Control Panel &#8220;hotspots&#8221; like the Weblog Administration or Field Group administration can save you some development time.&nbsp; 
</p> <object width="470" height="244"> <param name="movie" value="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/d042897e-b4ea-4ff2-9863-eeef470522cb/jingh264player.swf"></param> <param name="quality" value="high"></param> <param name="bgcolor" value="#FFFFFF"></param> <param name="flashVars" value="thumb=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/d042897e-b4ea-4ff2-9863-eeef470522cb/FirstFrame.jpg&amp;containerwidth=470&amp;containerheight=244&amp;showbranding=false&amp;content=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/d042897e-b4ea-4ff2-9863-eeef470522cb/2009-04-02_0944.mp4"></param> <param name="allowFullScreen" value="true"></param> <param name="scale" value="showall"></param> <param name="allowScriptAccess" value="always"></param> <param name="base" value="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/d042897e-b4ea-4ff2-9863-eeef470522cb/"></param>&nbsp; <embed src="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/d042897e-b4ea-4ff2-9863-eeef470522cb/jingh264player.swf" quality="high" bgcolor="#FFFFFF" width="470" height="244" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/d042897e-b4ea-4ff2-9863-eeef470522cb/FirstFrame.jpg&amp;containerwidth=470&amp;containerheight=244&amp;showbranding=false&amp;content=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/d042897e-b4ea-4ff2-9863-eeef470522cb/2009-04-02_0944.mp4" allowFullScreen="true" base="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/d042897e-b4ea-4ff2-9863-eeef470522cb/" scale="showall"></embed> </object><p>
<br /></p>


		]]>
	</description>       

      <dc:subject>Control Panel, Quick n Dirty Screencasts</dc:subject>
      <dc:date>2009-04-02T13:47:37+00:00</dc:date>
    </item>

    <item>
      <title>Multiselecting Template Groups</title>
      <link>http://www.train-ee.com/courseware/free-tutorials/comments/multiselecting-template-groups/</link>
      <guid>http://www.train-ee.com/courseware/free-tutorials/comments/multiselecting-template-groups/#When:13:03:41Z</guid>
	<description>
		<![CDATA[
			<p>This short screencasts shows the multi-select feature on the Templates tab of <a href="http://www.expressionengine.com/index.php?affiliate=boyink">ExpressionEngine</a>.
</p> <object width="470" height="277"> <param name="movie" value="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/c6caa8a0-707a-4138-ac64-c4752bb9094e/jingh264player.swf"></param> <param name="quality" value="high"></param> <param name="bgcolor" value="#FFFFFF"></param> <param name="flashVars" value="thumb=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/c6caa8a0-707a-4138-ac64-c4752bb9094e/FirstFrame.jpg&amp;containerwidth=470&amp;containerheight=277&amp;showbranding=false&amp;content=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/c6caa8a0-707a-4138-ac64-c4752bb9094e/2009-03-30_0859.mp4"></param> <param name="allowFullScreen" value="true"></param> <param name="scale" value="showall"></param> <param name="allowScriptAccess" value="always"></param> <param name="base" value="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/c6caa8a0-707a-4138-ac64-c4752bb9094e/"></param>&nbsp; <embed src="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/c6caa8a0-707a-4138-ac64-c4752bb9094e/jingh264player.swf" quality="high" bgcolor="#FFFFFF" width="470" height="277" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/c6caa8a0-707a-4138-ac64-c4752bb9094e/FirstFrame.jpg&amp;containerwidth=470&amp;containerheight=277&amp;showbranding=false&amp;content=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/c6caa8a0-707a-4138-ac64-c4752bb9094e/2009-03-30_0859.mp4" allowFullScreen="true" base="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/c6caa8a0-707a-4138-ac64-c4752bb9094e/" scale="showall"></embed> </object><p>
<br /><br />
<br /></p>


		]]>
	</description>       

      <dc:subject>Control Panel, Quick n Dirty Screencasts</dc:subject>
      <dc:date>2009-03-30T13:03:41+00:00</dc:date>
    </item>

    <item>
      <title>ExpressionEngine Comments: Editing in Groups and Moving</title>
      <link>http://www.train-ee.com/courseware/free-tutorials/comments/expressionengine-comments-editing-in-groups-and-moving/</link>
      <guid>http://www.train-ee.com/courseware/free-tutorials/comments/expressionengine-comments-editing-in-groups-and-moving/#When:21:09:01Z</guid>
	<description>
		<![CDATA[
			<p>Here&#8217;s another quick screencast to close out the week here at Train-ee - this time on how to work with comments in bulk and also move comments in <a href="http://www.expressionengine.com/index.php?affiliate=boyink">ExpressionEngine</a>.&nbsp; This is handy if you want to close or delete multiple comments at once or if someone has mistakenly commented on the wrong entry.&nbsp; A couple of notes: When I first mention the &#8220;move&#8221; option it&#8217;s dropped below the recording window&#8212;but keep watching as it does make an appearance after that.&nbsp; Also - while I mention this feature as a way to delete spam comments there are some steps you can take to prevent spam in the first place and I&#8217;ll cover a couple of those in a future screencast.
</p> <object width="470" height="258"> <param name="movie" value="http://content.screencast.com/users/Train-ee.com/folders/Default/media/70b98436-218a-4480-9e70-f1e41ad33046/flvplayer.swf"></param> <param name="quality" value="high"></param> <param name="bgcolor" value="#FFFFFF"></param> <param name="flashVars" value="thumb=http://content.screencast.com/users/Train-ee.com/folders/Default/media/70b98436-218a-4480-9e70-f1e41ad33046/FirstFrame.jpg&amp;containerwidth=470&amp;containerheight=258&amp;content=http://content.screencast.com/users/Train-ee.com/folders/Default/media/70b98436-218a-4480-9e70-f1e41ad33046/CommentSearchMove.mp4"></param> <param name="allowFullScreen" value="true"></param> <param name="scale" value="showall"></param> <param name="allowScriptAccess" value="always"></param> <param name="base" value="http://content.screencast.com/users/Train-ee.com/folders/Default/media/70b98436-218a-4480-9e70-f1e41ad33046/"></param>&nbsp; <embed src="http://content.screencast.com/users/Train-ee.com/folders/Default/media/70b98436-218a-4480-9e70-f1e41ad33046/flvplayer.swf" quality="high" bgcolor="#FFFFFF" width="470" height="258" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/Train-ee.com/folders/Default/media/70b98436-218a-4480-9e70-f1e41ad33046/FirstFrame.jpg&amp;containerwidth=470&amp;containerheight=258&amp;content=http://content.screencast.com/users/Train-ee.com/folders/Default/media/70b98436-218a-4480-9e70-f1e41ad33046/CommentSearchMove.mp4" allowFullScreen="true" base="http://content.screencast.com/users/Train-ee.com/folders/Default/media/70b98436-218a-4480-9e70-f1e41ad33046/" scale="showall"></embed> </object><p>
<br /><br />
<br /></p>


		]]>
	</description>       

      <dc:subject>Control Panel, Quick n Dirty Screencasts</dc:subject>
      <dc:date>2009-03-27T21:09:01+00:00</dc:date>
    </item>

    <item>
      <title>Multi Edit Interface</title>
      <link>http://www.train-ee.com/courseware/free-tutorials/comments/multi-edit-interface/</link>
      <guid>http://www.train-ee.com/courseware/free-tutorials/comments/multi-edit-interface/#When:14:03:12Z</guid>
	<description>
		<![CDATA[
			<p>This is the first in what I hope is at least a weekly series of short, quick and dirty feature-specific EE screencasts.&nbsp; This one is somewhat of a test run for using <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fjingproject.com%2F">Jing</a>&#8212;so let me know if you have any issues or feedback. In this installment I show the multi-entry editor in <a href="http://www.expressionengine.com/index.php?affiliate=boyink">ExpressionEngine</a> where you can select multiple entries from the Edit tab and then edit certain aspects of them all from one screen.&nbsp; Note that you can show the screencast full-screen by clicking the button in the lower right corner.
</p> <object width="470" height="302"> <param name="movie" value="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/f2875932-9421-4659-9f9f-568b1644d585/jingswfplayer.swf"></param> <param name="quality" value="high"></param> <param name="bgcolor" value="#FFFFFF"></param> <param name="flashVars" value="thumb=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/f2875932-9421-4659-9f9f-568b1644d585/FirstFrame.jpg&containerwidth=681&containerheight=438&loaderstyle=jing&content=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/f2875932-9421-4659-9f9f-568b1644d585/2009-03-26_0958.swf"></param> <param name="allowFullScreen" value="true"></param> <param name="scale" value="showall"></param> <param name="allowScriptAccess" value="always"></param> <param name="base" value="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/f2875932-9421-4659-9f9f-568b1644d585/"></param>  <embed src="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/f2875932-9421-4659-9f9f-568b1644d585/jingswfplayer.swf" quality="high" bgcolor="#FFFFFF" width="470" height="302" type="application/x-shockwave-flash" allowScriptAccess="always" flashVars="thumb=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/f2875932-9421-4659-9f9f-568b1644d585/FirstFrame.jpg&containerwidth=681&containerheight=438&loaderstyle=jing&content=http://content.screencast.com/users/Train-ee.com/folders/Jing/media/f2875932-9421-4659-9f9f-568b1644d585/2009-03-26_0958.swf" allowFullScreen="true" base="http://content.screencast.com/users/Train-ee.com/folders/Jing/media/f2875932-9421-4659-9f9f-568b1644d585/" scale="showall"></embed> </object>
<br />
<br />
<br />
<br />
		]]>
	</description>       

      <dc:subject>Control Panel, Quick n Dirty Screencasts</dc:subject>
      <dc:date>2009-03-26T14:03:12+00:00</dc:date>
    </item>

    <item>
      <title>39 &#45; Implementing a Mailing List in ExpressionEngine</title>
      <link>http://www.train-ee.com/courseware/free-tutorials/comments/39-implementing-a-mailing-list-in-expressionengine/</link>
      <guid>http://www.train-ee.com/courseware/free-tutorials/comments/39-implementing-a-mailing-list-in-expressionengine/#When:18:31:12Z</guid>
	<description>
		<![CDATA[
			<p>The last piece of the puzzle on the Train-ee <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fchurch.train-ee.com">Church Site</a> is implementing an email mailing list for the church to use in communicating with its members.
</p> <p>I know - if you&#8217;re reading this you&#8217;re probably not a fan of anything email based anymore.&nbsp; RSS feeds, twitter, Facebook - surely there must be a better way for a church to communicate with its members than plain old email?&nbsp; </p>

<p>I agree - but the plain and simple truth of the matter is that for many people email <strong>is </strong>their internet experience.&nbsp; If your church has a variety of demographic groups you&#8217;ll probably need to still use email in order to reach all of them.</p>

<p>Luckily, with EE the implementation is straightforward, the list is double opt-in, and recipients can unsubscribe themselves.&nbsp; Now - creating and sending out regular email missives is still no small task, but at least the list management is handled by ExpressionEngine.</p>

<p><strong>Caveats</strong><br />
The EE Mailing List Module is overall a pretty simplistic tool - I&#8217;d say it&#8217;s a good one to use if your list is in the 100&#8217;s rather than the 1000&#8217;s and you&#8217;re sending out a few emails a month.&nbsp; You don&#8217;t get to track metrics like open rates, etc - and while you can send HTML email there&#8217;s no direct way to use an existing EE template as the basis (although there is a <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fexpressionengine.com%2Fforums%2Fviewthread%2F38845%2F">3rd Party Extension</a> that adds that functionality).&nbsp; </p>

<p>If your mailing list needs are more advanced then I&#8217;d recommend checking out <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.campaignmonitor.com%2F">Campaign Monitor</a> and the <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.campaignmonitor.com%2Fblog%2Fpost%2F2692%2Fexpressionengine-extension-now-available%2F">CM Extension for EE</a>.&nbsp; As a sidenote, the Campaign Monitor site is itself an ExpressionEngine site, built by Newism - who is writing a <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fnewism.com.au%2Fblog%2Fcategory-archive%2Fcategory%2Fexpressionengine%2F">series of blog posts</a> about how the job was done.</p>

<p>OK-&nbsp; back to the Church site.&nbsp; Here are the steps required for the task at hand:</p>

<ul>
<li>Make Sure the List is Enabled</li>
<li>Create the mailing list</li>
<li>Create a new template</li>
<li>Add the necessary tags to the new template</li>
<li>Test</li>
</ul>

<p><strong>Make Sure the List is Enabled</strong><br />
In the Control Panel under Admin  ›&nbsp; System Preferences  ›&nbsp; Mailing List Preferences - make sure the &#8220;Mailing List is Enabled&#8221; option is set to Yes.&nbsp; This is also where you can set notification preferences such that an admin will be notified of new sign-ups to the mailing list.&nbsp; This is nice if you want to send a more personal welcome message or just track the popularity of the list in general.</p>

<p><strong>Create the Mailing List</strong><br />
The mailing list functionality of ExpressionEngine is a module, so to interact with it go to the EE Control Panel and select the Modules tab, then the Mailing List name.&nbsp; From there:</p>

<ul><li>Click Create New Mailing List</li>
<li>Fill in the Short Name - I specified &#8220;church_newsletter&#8221; - this value will be necessary later so make a note of it</li>
<li>Fill in the Full Name - I specified &#8220;Church Newsletter&#8221;</li>
<li>Click &#8220;Create&#8221;</li>
</ul>

<p>Note that you can tweak some aspects of the emails that will get sent out - if you want a standard greeting, or each email to always have the church address, service times, and phone/fax number.&nbsp; You can also change the language of the unsubscribe links etc.&nbsp; To do this just find your mailing list in the list and click &#8220;Edit Template&#8221;.</p>

<p><strong>Create a New Template</strong><br />
OK - back in the Templates area of EE let&#8217;s move forward with getting the subscription form on the site.&nbsp; </p>

<p>While on some sites you may implement this subscription form as a sidebar or footer element, for this site it will just live on a dedicated template.&nbsp; I created a &#8220;subscribe&#8221; template in the default &#8220;site&#8221; template group, choosing to copy page-comps/one-column-content as it include a newsletter subscription form.</p>

<p><strong>Add EE Tags to site/subscribe</strong><br />
The new template will need the basics configured - page name, body id (which sets the picture that shows), etc - but I trust you&#8217;ll figure that out.&nbsp; I want to focus on the core content of the page - the subscription form.</p>

<p>The <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3Ddocs%2Fmodules%2Fmailing_list%2Findex.html">sample code in the EE docs</a> is a good starting point - so copy that and paste it into your template to work with.&nbsp; Essentially you need to meld together the styling from the template subscribe form with the code from the EE docs - and the result is this:</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">&#123;exp</span><span style="color: #007700">:</span><span style="color: #0000BB">mailinglist</span><span style="color: #007700">:</span><span style="color: #0000BB">form&nbsp;</span><span style="color: #007700">list=</span><span style="color: #DD0000">"church_newsletter"</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">p</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">strong</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Newsletter&nbsp;Sign&nbsp;Up</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">strong</span><span style="color: #007700">&gt;&lt;/</span><span style="color: #0000BB">p</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">p</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">input&nbsp;type</span><span style="color: #007700">=</span><span style="color: #DD0000">"text"&nbsp;</span><span style="color: #007700">class=</span><span style="color: #DD0000">"form"&nbsp;</span><span style="color: #0000BB">name</span><span style="color: #007700">=</span><span style="color: #DD0000">"email"&nbsp;</span><span style="color: #0000BB">value</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;email&#125;"&nbsp;</span><span style="color: #007700">/&gt;&lt;/</span><span style="color: #0000BB">p</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">p</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">input&nbsp;type</span><span style="color: #007700">=</span><span style="color: #DD0000">"image"&nbsp;</span><span style="color: #0000BB">value</span><span style="color: #007700">=</span><span style="color: #DD0000">"submit"&nbsp;</span><span style="color: #0000BB">src</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;site_url&#125;images/interface/send-button.gif"&nbsp;</span><span style="color: #007700">/&gt;&lt;/</span><span style="color: #0000BB">p</span><span style="color: #007700">&gt;<br /></span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">exp</span><span style="color: #007700">:</span><span style="color: #0000BB">mailinglist</span><span style="color: #007700">:</span><span style="color: #0000BB">form&#125;&nbsp;</span>
</span>
</code></div>

<p>Note that the short name of the mailing list that I created earlier is specified as a parameter in the opening tag.&nbsp; EE lets you have multiple mailing lists, so this is how you tell EE which list to assign this email address to.</p>

<p>Also note the variable being used in the email text field:</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">value</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;email&#125;"&nbsp;</span>
</span>
</code></div>

<p>The email value is a <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdocs%2Ftemplates%2Fglobals%2Fsingle_variables.html%23var_email">Global Variable</a> and used as is it will default the contents of the email box to the email address of the currently logged-in member. If your site doesn&#8217;t use the EE Membership module for more than a content administrator or three, then this is probably unnecessary&#8212;but also harmless if left in.</p>

<p><strong>Test Subscribing</strong><br />
With that code in place you should be able to load the rendered page and test the form.&nbsp; Enter in an email address that you can check and submit - you should get a notification message, and then an email with a confirmation link in it.&nbsp; Clicking that link should add your address to the list (note that you can manually remove it again back in the Mailing List Module Interface).</p>

<p><strong>Test Sending</strong><br />
With an address on the list you should now be able to send a message out. Do this by navigating to the Communicate tab in the EE Control Panel.&nbsp; Enter the basics of a message, select the proper Mailing List in the right column, and click Send It.&nbsp; You should get an email a few minutes later and be able to unsubscribe yourself from it.</p>

<p>If you have any issues with the list not working I&#8217;d suggest reviewing the Email-related configurations in the EE CP:&nbsp; Admin  ›&nbsp; System Preferences  ›&nbsp; Email Configuration, and checking with your webhost to see if what you&#8217;ve specified should work.&nbsp; Here on Train-ee I have it set to use Sendmail and it works well.</p>

<p><strong>Is It Over?</strong><br />
Unbelieveably almost <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.train-ee.com%2Fcourseware%2Ffree-tutorials%2Fcomments%2Fwhy-expressionengine-for-a-church-site%2F">a year after beginning this series</a> I believe I have found the end of it!&nbsp; This proved to be a much broader and deeper site than the <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.train-ee.com%2Fcourseware%2Ffree-tutorials%2Fcategory%2Fbuilding-a-small-business-site%2F">Small Business Series</a> - and it&#8217;s been quite a ride.</p>

<p><strong>What&#8217;s Next?</strong><br />
As I promised at the beginning of this series, the next step will be auctioning the completed site off on eBay, and donating the proceeds to a charity.&nbsp; Schedule-wise this will be in a few weeks after the SXSW buzz is over. Then I&#8217;ll follow the same model as with the Small Business series in that I&#8217;ll use these blog posts as the basis for another book that will be sold here on Train-ee.com.&nbsp;  I&#8217;m not quite sure how to handle EE 2.0 in regards to this content - so will need to decide that yet.</p>

<p>But for now - chalk up another project as being complete!
</p>
		]]>
	</description>       

      <dc:subject>Building a Church Site</dc:subject>
      <dc:date>2009-03-05T18:31:12+00:00</dc:date>
    </item>

    <item>
      <title>38 &#45; Pulling Latest Photo to the Home Page</title>
      <link>http://www.train-ee.com/courseware/free-tutorials/comments/38-pulling-latest-photo-to-the-home-page/</link>
      <guid>http://www.train-ee.com/courseware/free-tutorials/comments/38-pulling-latest-photo-to-the-home-page/#When:13:34:47Z</guid>
	<description>
		<![CDATA[
			<p>In this shorter chapter I&#8217;ll use up a bit of free space on the church site home page to bring in the latest photo from the photo gallery.
</p> <p>When I last left the church site home page, the left column had only a list of upcoming events.&nbsp; The left column wasn&#8217;t as long as the right column so there was a bit of free space in the left/lower portion of the page.&nbsp; In this installment I&#8217;ll use that space to show the most recently uploaded photo to the photo gallery.</p>

<p>This is a pretty quick update, only made a bit longer because while I was at it I decided to undo the embedding out of the home page events listing.&nbsp; Why?&nbsp; I typically only embed code if it can be reused in another template or if creating an embed makes the parent template much easier to understand.&nbsp; When I started this series I embedded out the events listing thinking I might use it in the sidebar of another template but as it turns out I didn&#8217;t.&nbsp; The parent template isn&#8217;t that complex, so by leaving the embed in place I just have a slightly more complex template structure to come back to later if I want to make changes to the event listing.&nbsp; By putting the code back into the parent template I&#8217;ll save myself a couple of clicks to find the code and it&#8217;ll also reinforce the fact that the code is only used in this one template.</p>

<p>Which actually brings up a good point&#8212;if you ever need to know which templates use a specific embedded template you can use the Control Panel search function (the search box is under the template group listing on the left-bottom of the templates tab).&nbsp; Enter the name of the embedded template name and EE should filter the template groups and templates down to just those that contain the embed statement with that template name.&nbsp; To get the full unfiltered list back again just click the templates tab.</p>

<p>So for the task at hand I&#8217;ll need to update three templates:
</p><ul><li>site/index</li>
<li>stylesheets/style</li>
<li>embeds/html_header</li></ul>

<p><br />
<strong>Updating site/index</strong><br />
I first added the gallery code to embeds/events and then consolidated embeds/events back into site/index, but you could choose to do that in the reverse order.&nbsp; I&#8217;ll provide the complete site/index templates in the companion files and just focus on the net change here with the new gallery code:</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">&lt;</span><span style="color: #0000BB">div&nbsp;</span><span style="color: #007700">class=</span><span style="color: #DD0000">"home_latest_photo"</span><span style="color: #007700">&gt;<br /></span><span style="color: #0000BB">&#123;exp</span><span style="color: #007700">:</span><span style="color: #0000BB">gallery</span><span style="color: #007700">:</span><span style="color: #0000BB">entries&nbsp;gallery</span><span style="color: #007700">=</span><span style="color: #DD0000">"photos"&nbsp;</span><span style="color: #0000BB">limit</span><span style="color: #007700">=</span><span style="color: #DD0000">"1"&nbsp;</span><span style="color: #0000BB">orderby</span><span style="color: #007700">=</span><span style="color: #DD0000">"date"</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Latest&nbsp;Photo</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">&#123;title&#125;</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">a&nbsp;href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;image_url&#125;"&nbsp;</span><span style="color: #0000BB">rel</span><span style="color: #007700">=</span><span style="color: #DD0000">"lightbox&#91;recent&#93;"&nbsp;&nbsp;</span><span style="color: #0000BB">title</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;exp:html_strip&#125;&#123;title&#125;:&nbsp;&#123;caption&#125;&#123;/exp:html_strip&#125;"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;thumb_url&#125;"&nbsp;&nbsp;</span><span style="color: #007700">class=</span><span style="color: #DD0000">"border"&nbsp;</span><span style="color: #0000BB">width</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;thumb_width&#125;"&nbsp;</span><span style="color: #0000BB">height</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;thumb_height&#125;"&nbsp;</span><span style="color: #0000BB">title</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;title&#125;"&nbsp;</span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;title&#125;"&nbsp;</span><span style="color: #007700">/&gt;&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">br&nbsp;</span><span style="color: #007700">/&gt;<br /></span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">exp</span><span style="color: #007700">:</span><span style="color: #0000BB">gallery</span><span style="color: #007700">:</span><span style="color: #0000BB">entries&#125;<br /><br /></span><span style="color: #007700">&lt;</span><span style="color: #0000BB">a&nbsp;href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;path='photos'&#125;"&nbsp;</span><span style="color: #007700">class=</span><span style="color: #DD0000">"redBglink"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">All&nbsp;Photos&nbsp;</span><span style="color: #007700">&amp;</span><span style="color: #0000BB">raquo</span><span style="color: #007700">;&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;&amp;</span><span style="color: #0000BB">nbsp</span><span style="color: #007700">;&nbsp;<br />&lt;/</span><span style="color: #0000BB">div</span><span style="color: #007700">&gt;&nbsp;</span>
</span>
</code></div>

<p>I&#8217;m using the exp:gallery:entries tag pair in <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3Ddocs%2Fmodules%2Fgallery%2Fgallery_entries.html%23single_entry">single-entry mode</a> here, which avoids having to worry about the rows and columns of multiple entries.&nbsp; For the image itself since I wanted to also use the Lightbox effect on this image I just copied the code from photos/index.&nbsp; With this code in place I could re-load the site home page and get the latest image popping in.&nbsp; </p>

<p><strong>Updating stylesheets/style</strong><br />
I wrapped the image code in a new div class so that I could do some styling - mainly just to add margins.&nbsp; </p>

<p><strong>Updating embeds/html_header</strong><br />
In order to get the Lightbox javascript to work on this image I had to update embeds/html_header and change the conditional that looks at the current url and loads the javascript files if the current page is in the photos section.</p>

<p>Since segment_1 should only be empty when the home page is being viewed this code:
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">&#123;if&nbsp;segment_1</span><span style="color: #007700">==</span><span style="color: #DD0000">"photos"&nbsp;</span><span style="color: #0000BB">&#125;&nbsp;</span>
</span>
</code></div>

<p>Needed to change to:
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">&#123;if&nbsp;segment_1</span><span style="color: #007700">==</span><span style="color: #DD0000">"photos"&nbsp;</span><span style="color: #007700">OR&nbsp;</span><span style="color: #0000BB">segment_1</span><span style="color: #007700">==</span><span style="color: #DD0000">""</span><span style="color: #0000BB">&#125;&nbsp;</span>
</span>
</code></div>

<p>Reloading the page and clicking the image thumbnail should now load the full-size image using the javascript Lightbox effect.</p>

<p>And that&#8217;s it!&nbsp; I now have a <a href="http://www.train-ee.com/courseware?URL=http%3A%2F%2Fchurch.train-ee.com">home page</a> that feels just a bit more balanced design-wise and features the latest photo uploaded.&nbsp; </p>

<p>&nbsp;</p>

<p>
</p>
		]]>
	</description>       

      <dc:subject>Building a Church Site</dc:subject>
      <dc:date>2009-03-02T13:34:47+00:00</dc:date>
    </item>

    
    </channel>
</rss>