<?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>Boyink! Blog</title>
    <link>http://www.boyink.com/splaat/weblog/</link>
    <description>Mostly web stuff from Michael Boyink of Boyink Interactive</description>
    <dc:language>en</dc:language>
    <dc:creator>pmachine@boyink.com</dc:creator>
    <dc:rights>Copyright 2008</dc:rights>
    <dc:date>2008-05-15T13:10:00-05:00</dc:date>
    <admin:generatorAgent rdf:resource="http://www.pmachine.com/" />
    

    <item>
      <title>A New Blog, A New Series</title>
      <link>http://www.boyink.com/splaat/comments/a-new-blog/</link>
      <guid>http://www.boyink.com/splaat/comments/a-new-blog/#When:14:28:00Z</guid>
      <description><![CDATA[<p>Find another Building an ExpressionEngine Site tutorial series going on at <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.train-ee.com">Train-ee.com</a>.
</p><p>I&#8217;m pleased to announce that I&#8217;ve added a blog to <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.train-ee.com">Train-ee</a>.&nbsp; The Train-ee.com blog will be the home of a new Building an <a href="http://www.expressionengine.com/index.php?affiliate=boyink">ExpressionEngine</a> Site Series, this time covering the build of a church website.&nbsp; You can read the full <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.train-ee.com%2Fcourseware%2Fblog%2Fcomments%2Fa-new-blog-a-new-series%2F">announcement over at Train-ee.com</a>.
</p>]]></description>
      <dc:subject>building&#45;an&#45;expression&#45;engine&#45;site, expression&#45;engine</dc:subject>
      <dc:date>2008-03-22T14:28:00-05:00</dc:date>
    </item>

    <item>
      <title>Win a Book!</title>
      <link>http://www.boyink.com/splaat/comments/win-a-book/</link>
      <guid>http://www.boyink.com/splaat/comments/win-a-book/#When:13:44:01Z</guid>
      <description><![CDATA[<p>What?
</p>
<p>
You&#8217;re working with <a href="http://www.expressionengine.com/index.php?affiliate=boyink">ExpressionEngine</a> and you&#8217;re not visiting the EE forums on a daily basis - gleaning tips and tricks to use in your project sites?
</p>
<p>
For shame.....
</p>
<p>
Yea - I know...there probably aren&#8217;t many of you coming here to Boyink.com and not also perusing the EE forums - but just in case I want to make sure you don&#8217;t miss an opportunity to <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fexpressionengine.com%2Fblog%2Fentry%2Fwin_building_an_expressionengine_site_by_boyink%2F">Win a Building an EE Site Book</a> via a giveaway sponsored by EllisLab.
</p>
<p>
Just post a reply in the associated forum thread to be entered into a drawing we&#8217;ll do over the weekend.&nbsp; You can choose either the eBook (selling currently for $25) or the printed version ($29 + Shipping).
</p>
<p>
Good luck!
</p>]]></description>
      <dc:subject>boyink&#45;interactive&#45;news, building&#45;an&#45;expression&#45;engine&#45;site</dc:subject>
      <dc:date>2008-02-07T13:44:01-05:00</dc:date>
    </item>

    <item>
      <title>Printed Book Now Available</title>
      <link>http://www.boyink.com/splaat/comments/printed-book-now-available/</link>
      <guid>http://www.boyink.com/splaat/comments/printed-book-now-available/#When:01:00:00Z</guid>
      <description><![CDATA[<p>Printed version now available on <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fstores.lulu.com%2Ftrain-ee">http://stores.lulu.com/train-ee</a>.
</p><p>Prefer print?&nbsp; Or not so big on PayPal?&nbsp; 
</p>
<p>
The <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.train-ee.com%2Fcourseware%2Febooks%2F">Building an ExpressionEngine Series - Small Business</a> book is now available in print form via Lulu.com:
<br />
<a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fstores.lulu.com%2Ftrain-ee">http://stores.lulu.com/train-ee</a>
</p>
<p>
Make sure to purchase both the CD and book so you get the text versions of all the companion files mentioned in the book.
</p>
<p>
The CD also includes the EE Control Panel Overview screencast (viewable with a web browser setup with javascript and Flash).
</p>]]></description>
      <dc:subject>boyink&#45;interactive&#45;news, building&#45;an&#45;expression&#45;engine&#45;site</dc:subject>
      <dc:date>2008-01-17T01:00:00-05:00</dc:date>
    </item>

    <item>
      <title>Building an ExpressionEngine Site: The Book!</title>
      <link>http://www.boyink.com/splaat/comments/building-an-expressionengine-site-the-book/</link>
      <guid>http://www.boyink.com/splaat/comments/building-an-expressionengine-site-the-book/#When:00:49:00Z</guid>
      <description><![CDATA[<p>This series now available for purchase in eBook form on <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.train-ee.com%2Fcourseware%2Febooks%2F">Train-ee.com</a>
</p><p>Yes - you&#8217;ve read the the <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fweblog%2Fcategory%2Fbuilding-an-expressionengine-site%2F">weblog series</a>, now own the book!
</p>
<p>
By popular demand, I&#8217;ve culled the &#8220;Building an ExpressionEngine Site&#8221; weblog posts out, and have compiled them into a downloadable eBook for your reading pleasure.
</p><p>First - make no mistake - I fully intend to leave the weblog series here on Boyink.com.&nbsp; If you can derive value from them and jump-start your EE development, use them with my regards.&nbsp; I had fun writing them, and have received a ton of comments, links and search engine traffic from them.
</p>
<p>
So why buy the book?
</p>
<p>
A few reasons:<ul>
<li>The content is aggregated into one document for ease of printing.</li>
<li>The sample site is assembled on its own (rather than as part of Boyink.com) which allowed me to organize the templates better.</li>
<li>The Weblog names are semantic and simpler.</li>
<li>Image paths are simpler</li>
<li>I&#8217;ve added dozens of screen captures to make processes clearer.</li>
<li>EE variable names, EE tags, and HTML appear in more complete form.</li>
<li>The content has been revised and edited for clarity and accuracy (the blog posts could really be considered rough drafts in a formal writing process).</li>
<li>All templates used in the book are included as text files for ease of copying into EE</li>
<li>Purchasing the book will give access to the new Train-ee forums for support.</li>
<li>I&#8217;ve promised each of my kids $0.50 for each copy sold (think of the children!)</li>
</ul>
<p>
The last bit is true, actually.&nbsp; What started as a simple Saturday project to pull the blog posts into a Word document turned into a 50-hour project involving both myself and my wife putting in weekends and late nights to complete.&nbsp;  I decided the kids were really making a &#8220;business investment&#8221; into the book - giving up time with parents - so decided to cut them in on the profits.&nbsp; 
</p>
<p>
Just to be clear, however - this is a self-published book that hasn&#8217;t been through a &#8220;formal&#8221; editing and review process.&nbsp; What it did get was the close, detailed editing that my wife can do - even more valuable because she&#8217;s not as familiar with the inner trappings of EE.&nbsp; The content is much better for her input - with much more accurate references to the different links, buttons and section names found in the EE Control Panel.
</p>
<p>
So - if you learn better by reading, if you&#8217;ve found the Building Series helpful and would like a way to &#8220;give back&#8221; - buy the <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.train-ee.com%2Fcourseware%2Febooks%2F">Building an ExpressionEngine Site - Small Business</a> book now available on the newly-launched <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.train-ee.com%2F">Train-ee.com</a>.
</p>
]]></description>
      <dc:subject>boyink&#45;interactive&#45;news, building&#45;an&#45;expression&#45;engine&#45;site</dc:subject>
      <dc:date>2008-01-16T00:49:00-05:00</dc:date>
    </item>

    <item>
      <title>Building an ExpressionEngine Site &#45; Chapter 17</title>
      <link>http://www.boyink.com/splaat/comments/building-an-expressionengine-site-chapter-17/</link>
      <guid>http://www.boyink.com/splaat/comments/building-an-expressionengine-site-chapter-17/#When:19:49:00Z</guid>
      <description><![CDATA[<p>In which we, yes, finish this series by implementing the &#8220;latest news&#8221; sidebar widget, building a contact form, hooking up the EE search function and formatting the search results.
</p><p>Call it a New Years Resolution, call it a last-ditch-2007-effort, but at any rate, at the end of this chapter you can call this tutorial series &#8220;done&#8221;.&nbsp;   In the last chapter we worked through the weblog implementation, and it was a pretty heavy chapter with the most advanced code in this entire tutorial.&nbsp; This chapter won&#8217;t be like that&#8230;
</p>
<p><b>Sidebar Latest News</b>
<br />
This really should have been part of the Weblog implementation in <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fcomments%2Fbuilding-an-expressionengine-site-chapter-15%2F">Chapter 15</a>, but that chapter was long enough already.
</p>
<p>
The goal with this sidebar widget is to do two things:<ul>
<li>Allow a client to update several pages or sections of the site by the publishing of one post.&nbsp; This is one of the great advantages and &#8220;sells&#8221; of a system like EE - that the finished site can not only be updated by an end client but the process is simple and updates are leveraged through reuse across the site.</li>
<li>Give greater prominence to the most updated/freshest part of the site.&nbsp; From a user perspective you are helping them easily find the latest and greatest content by bubbling it to the home page and every other section of the site.</li>
</ul>
<p>
Implementation here is pretty straight-forward.&nbsp; You&#8217;ll need to edit your existing placeholder Latest News embedded template to add the code I&#8217;ll give you.&nbsp; You&#8217;ll need to tweak the paths and category parameters and then save the updated template.
</p>
<p>
<b>The Latest News Template</b>
<br />
Here&#8217;s the text version of the Latest News template: <a href="http://www.boyink.com/images/blog/chapter_17_latest_news.txt">chapter_17_latest_news.txt</a>.&nbsp; This code should be pasted into your existing latest_news embedded template.
</p>
<p>
<b>Tweak the Template</b>
<br />
Let&#8217;s look at the code here as we&#8217;re doing something a bit new: </p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Latest news</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">div </span><span style="color: #007700">class=</span><span style="color: #DD0000">"lcontent"</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 weblog</span><span style="color: #007700">=</span><span style="color: #DD0000">"bees_weblog" </span><span style="color: #0000BB">dynamic</span><span style="color: #007700">=</span><span style="color: #DD0000">"off" </span><span style="color: #0000BB">limit</span><span style="color: #007700">=</span><span style="color: #DD0000">"1" </span><span style="color: #0000BB">category</span><span style="color: #007700">=</span><span style="color: #DD0000">"130" </span><span style="color: #0000BB">disable</span><span style="color: #007700">=</span><span style="color: #DD0000">"pagination|trackbacks|member_data"</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">p</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">strong</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#123;entry_date format</span><span style="color: #007700">=</span><span style="color: #DD0000">'%m/%d'</span><span style="color: #007700">%</span><span style="color: #0000BB">y</span><span style="color: #007700">'</span><span style="color: #0000BB">&#125; : &#123;title&#125; &lt;/strong&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#123;exp:word_limit total="30"&#125;&#123;exp:html_strip&#125;&#123;body&#125;&#123;/exp:html_strip&#125;&#123;/exp:word_limit&#125;&amp;nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a href="&#123;url_title_path=building_series/chapter_17_comments&#125;"&gt;more &gt;&gt;&lt;/a&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/p&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&#123;/exp:weblog:entries&#125;<br />&lt;/div&gt;</span>
</code></div><p>
</p>
<p>
Overall this is a pretty straightforward use of the workhorse exp:weblog:entries tag. Note the dynamic="off" parameter again used so that EE will ignore the current URL when building the results for this tag.&nbsp; The important parameter here is the &#8220;category=130&#8221;.&nbsp; This limits the results of this tag to just entries in that specific category - which happens to be the &#8220;company news&#8221; category for me.&nbsp; You can either remove this parameter to display all weblog posts, or change it to reflect the category ID of your Company News category.&nbsp; You can find that ID by visiting the category management interface for your weblog category group in the Control Panel.&nbsp; If you click the add/edit link for your group, the ID&#8217;s will appear at the left of the list.
</p>
<p>
You&#8217;ll also need to change the link to reflect the names of your template group and weblog comments template.
</p>
<p>
Note that I&#8217;m again using some of the plug-ins we covered in <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fcomments%2Fbuilding-an-expressionengine-site-chapter-13%2F">Chapter 13</a> to format the Latest Products sidebar content.
</p>
<p>
Once you&#8217;ve made your tweaks, save the template and re-visit your site.&nbsp; The new dynamic content should appear (this is always one of those moments I really enjoy working with EE - one saved template and most of the pages on my site are now updated showing real content).
</p>
<p>
The updated sidebar can be viewed on my <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fbuilding_series%2Fchapter_17_index%2F">sample site</a>.
</p>
<p>
<b>The Contact Form</b>
<br />
Most business sites will want - in the very least - a simple contact us form and ExpressionEngine can handle that with out-of-the-box functionality.&nbsp; If your needs are more advanced&#8212;wanting to save form submissions in a database table, more advanced error checking, user messages, etc then you&#8217;ll want to look into the popular <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.solspace.com%2Fsoftware%2Fdetail%2Ffreeform%2F">FreeForm</a> module from Solspace.&nbsp;  
</p>
<p>
Note: the Email Module isn&#8217;t available in the Core version of EE so if you&#8217;re following along in Core you&#8217;ll have to skip this step.
</p>
<p>
Here&#8217;s what you&#8217;ll need to do to get a basic contact us form working with EE code:<ul>
<li>Turn on the Email Module</li>
<li>Copy my Contact Us template</li>
<li>Tweak the template</li>
<li>Update your main navigation</li>
<li>Test</li>
</ul>
<p>
<b>Turn on the Email Module</b>
<br />
The Contact Us form requires the ExpressionEngine <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdocs%2Fmodules%2Femail%2Findex.html">Email Module</a>, which isn&#8217;t installed by default.&nbsp; To install it, visit the Modules tab in the EE Control Panel, and the Email Module will show up around #4.&nbsp; Click the &#8220;Install&#8221; link to enable the Email Module. 
</p>
<p>
<b>Copy the Contact Us Template</b>
<br />
Grab the Contact Us template: <a href="http://www.boyink.com/images/blog/chapter_17_contact.txt">chapter_17_contact.txt</a>.&nbsp; Note that this template is largely based on the <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdocs%2Fmodules%2Femail%2Fcontact_form.html">example from the EE docs</a>.&nbsp; Create a new template in your main template group, and paste that code in.&nbsp; I&#8217;ve named mine chapter_17_contact.
</p>
<p>
<b>Tweak the Template</b>
<br />
You&#8217;ll need to edit the &#8220;assign variable&#8221; at the top of the template to specify the name of your embedded template group.&nbsp; 
</p>
<p>
You&#8217;ll also need to make some changes to the opening exp:email:contact_form tag. Put the email address you want to receive the email in the &#8220;recipients&#8221; parameter (I&#8217;ve put a fake one in the text file to avoid the spam-bots) and tweak the &#8220;return&#8221; parameter to specify a URL that&#8217;s appropriate for your site:
<br />
</p><div class="codeblock"><code>
<span style="color: #0000BB">&#123;exp</span><span style="color: #007700">:</span><span style="color: #0000BB">email</span><span style="color: #007700">:</span><span style="color: #0000BB">contact_form user_recipients</span><span style="color: #007700">=</span><span style="color: #DD0000">"false" </span><span style="color: #0000BB">recipients</span><span style="color: #007700">=</span><span style="color: #DD0000">"your_email_address@yoursite.com" </span><span style="color: #0000BB">charset</span><span style="color: #007700">=</span><span style="color: #DD0000">"utf-8" </span><span style="color: #007700">return=</span><span style="color: #DD0000">"http://www.boyink.com/splaat/building_series/chapter_17_index|Home Page"</span><span style="color: #0000BB">&#125;</span>
</code></div><p>
</p>
<p>
<b>Update Main Navigation</b>
<br />
You&#8217;ll now need to edit your main navigation embedded template.&nbsp; Here&#8217;s what mine looks like now:
<br />
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">div id</span><span style="color: #007700">=</span><span style="color: #DD0000">"menu"</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">div </span><span style="color: #007700">class=</span><span style="color: #DD0000">"submit"</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">ul</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">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a&#123;if </span><span style="color: #DD0000">'&#123;embed:my_location&#125;'</span><span style="color: #007700">==</span><span style="color: #DD0000">"home"</span><span style="color: #0000BB">&#125; </span><span style="color: #007700">class=</span><span style="color: #DD0000">"selected"</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">if&#125; href</span><span style="color: #007700">=</span><span style="color: #DD0000">"/splaat/building_series/chapter_17_index/" </span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Home</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</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">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">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a&#123;if </span><span style="color: #DD0000">'&#123;embed:my_location&#125;'</span><span style="color: #007700">==</span><span style="color: #DD0000">"about"</span><span style="color: #0000BB">&#125; </span><span style="color: #007700">class=</span><span style="color: #DD0000">"selected"</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">if&#125; href</span><span style="color: #007700">=</span><span style="color: #DD0000">"/splaat/building_series/chapter_17_about/"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">About</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</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">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">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a&#123;if </span><span style="color: #DD0000">'&#123;embed:my_location&#125;'</span><span style="color: #007700">==</span><span style="color: #DD0000">"products"</span><span style="color: #0000BB">&#125; </span><span style="color: #007700">class=</span><span style="color: #DD0000">"selected"</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">if&#125; href</span><span style="color: #007700">=</span><span style="color: #DD0000">"/splaat/building_series/chapter_17_products/"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Products</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</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">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">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a&#123;if </span><span style="color: #DD0000">'&#123;embed:my_location&#125;'</span><span style="color: #007700">==</span><span style="color: #DD0000">"services"</span><span style="color: #0000BB">&#125; </span><span style="color: #007700">class=</span><span style="color: #DD0000">"selected"</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">if&#125; href</span><span style="color: #007700">=</span><span style="color: #DD0000">"/splaat/building_series/chapter_17_services/"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Services</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</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">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">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a&#123;if </span><span style="color: #DD0000">'&#123;embed:my_location&#125;'</span><span style="color: #007700">==</span><span style="color: #DD0000">"weblog"</span><span style="color: #0000BB">&#125; </span><span style="color: #007700">class=</span><span style="color: #DD0000">"selected"</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">if&#125; href</span><span style="color: #007700">=</span><span style="color: #DD0000">"/splaat/building_series/chapter_17_weblog/"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Weblog</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</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">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">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a&#123;if </span><span style="color: #DD0000">'&#123;embed:my_location&#125;'</span><span style="color: #007700">==</span><span style="color: #DD0000">"contact"</span><span style="color: #0000BB">&#125; </span><span style="color: #007700">class=</span><span style="color: #DD0000">"selected"</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">if&#125; href</span><span style="color: #007700">=</span><span style="color: #DD0000">"/splaat/building_series/chapter_17_contact/"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Contact</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</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">li</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/</span><span style="color: #0000BB">ul</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;/</span><span style="color: #0000BB">div</span><span style="color: #007700">&gt;<br />&lt;/</span><span style="color: #0000BB">div</span><span style="color: #007700">&gt;</span>
</code></div><p>
</p>
<p>
<b>Test the Form</b>
<br />
Load the form in your browser, and give it a whirl.&nbsp;  If the email doesn&#8217;t come through, try sending yourself an email using the Communicate tab of the Control Panel.&nbsp; If still no go, you might need to visit the email configuration section found at CP Home  >  Admin  >  System Preferences  >  Email Configuration, and have a conversation with your webhost about which email protocol to use.&nbsp; With Boyink.com on EngineHosting I&#8217;m using the PHP mail option successfully.
</p>
<p>
<b>CAPTCHA&#8217;s for Contact Us Form</b>
<br />
The template provided has the code for CAPTCHA&#8217;s, but you have to enable them before they&#8217;ll show up.&nbsp; The setting is also found on the Email Configuration screen of the Control Panel.&nbsp; Set &#8220;Enable CAPTCHAs for Tell-a-Friend and Contact emails&#8221; to Yes.&nbsp; And remember -they won&#8217;t show for you while you are logged in.&nbsp; I&#8217;ve found it easiest to debug/test CAPTCHAs by being logged in in one browser (usually Firefox) and logged out in another browser (IE).&nbsp; This way you can make template tweaks and see the changes without constantly having to log in and out.
</p>
<p>
<b>I&#8217;ll Show You Mine...</b>
<br />
Here&#8217;s my contact form: <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fbuilding_series%2Fchapter_17_contact%2F">http://www.boyink.com/splaat/building_series/chapter_17_contact/</a>
</p>
<p>
<b>Hooking up the Search Engine</b>
<br />
And for my final trick...hooking up the EE search engine.&nbsp; But first, some caveats.
</p>
<p>
ExpressionEngine&#8217;s supplied search engine doesn&#8217;t function like high-end search engines in that it doesn&#8217;t roll through your site, looking at and indexing your rendered pages.&nbsp; In my mind I think of that as an &#8220;outside-in&#8221; search, where a spider would just see your site as a collection of HTML pages as it comes out in the browser.
</p>
<p>
EE&#8217;s search is more of an &#8220;inside-out&#8221; approach, where it searches at the database level first then, when it finds a match, needs to be told where that database content is supposed to show up on the site.&nbsp; Because of this there are some inherent limitations that will affect your results:<ul>
<li>Content that is re-used will not get multiple hits.&nbsp; For example - if your search contained words that were contained in the &#8220;Latest News&#8221; sidebar we created above, an outside-in engine would return hits for every page/section on the site.&nbsp; EE&#8217;s inside out will return one hit, mapped to the weblog comments template for that weblog entry.</li>
<li>Content in our Miscellaneous Weblog cannot be searched.&nbsp; We&#8217;ve used this weblog to hold snippets of text that get reused around the site, but they don&#8217;t have a &#8220;home template&#8221; for us to map EE to, so it&#8217;s best to exclude them from the search.</li>
<li>Category content cannot be searched.&nbsp; EE 1.6.1 has increased category capabilities with it&#8217;s category custom fields, but anything stored at the category level isn&#8217;t currently included in the search.</li>
</ul>
<p>
At times these limitations are more than I prefer - which is why here on Boyink.com I&#8217;ve used a custom Google search instead, and also why I logged this <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fforums%2Fviewthread%2F39170%2F">feature request</a> for a new search engine for EE.
</p>
<p>
I should also point out - typically I will create a new template group for the search results,no results and css templates.&nbsp; In this tutorial I&#8217;m keeping them all in the main template group for the sake of simplicity.&nbsp; You should be able to organize them differently if need be - just look for places where template and template group names are specified and update them accordingly.
</p>
<p>
<b>Having Said That</b>
<br />
Let&#8217;s again implement the native ExpressionEngine search engine, and you can decide if it meets your needs or not.&nbsp; To fully implement the search function, you&#8217;ll need to:<ul>
<li>Update your search &amp; section heading embedded template to include the EE simple search tags</li>
<li>Create a template that loads when there are no results</li>
<li>Create a template to display results</li>
</ul>
<p>
<b>Updating the Search &amp; Section Intro Template</b>
<br />
In your embedded template group, you should have a template called search_section_intros that contains the code for the search box &amp; submit button.&nbsp; Open it for editing, and copy the updated code in from this text file: <a href="http://www.boyink.com/images/blog/chapter_17_search_section_intros.txt">chapter_17_search_section_intros.txt</a>.
</p>
<p>
Let&#8217;s look at what&#8217;s going on with the search-specific code:
<br />
</p><div class="codeblock"><code>
<span style="color: #0000BB">&#123;exp</span><span style="color: #007700">:</span><span style="color: #0000BB">search</span><span style="color: #007700">:</span><span style="color: #0000BB">simple_form weblog</span><span style="color: #007700">=</span><span style="color: #DD0000">"bees_about|bees_home|bees_products|bees_services|bees_weblog" </span><span style="color: #0000BB">no_result_page</span><span style="color: #007700">=</span><span style="color: #DD0000">"building_series/chapter_17_noresults" </span><span style="color: #0000BB">result_page</span><span style="color: #007700">=</span><span style="color: #DD0000">"building_series/chapter_17_search_results" </span><span style="color: #0000BB">search_in</span><span style="color: #007700">=</span><span style="color: #DD0000">"everywhere"</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;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">input type</span><span style="color: #007700">=</span><span style="color: #DD0000">"text" </span><span style="color: #0000BB">name</span><span style="color: #007700">=</span><span style="color: #DD0000">"keywords" </span><span style="color: #0000BB">id</span><span style="color: #007700">=</span><span style="color: #DD0000">"keywords" </span><span style="color: #0000BB">value</span><span style="color: #007700">=</span><span style="color: #DD0000">"" </span><span style="color: #0000BB">size</span><span style="color: #007700">=</span><span style="color: #DD0000">"20" </span><span style="color: #0000BB">maxlength</span><span style="color: #007700">=</span><span style="color: #DD0000">"250" </span><span style="color: #007700">class=</span><span style="color: #DD0000">"text" </span><span style="color: #007700">/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">input type</span><span style="color: #007700">=</span><span style="color: #DD0000">"submit" </span><span style="color: #0000BB">value</span><span style="color: #007700">=</span><span style="color: #DD0000">"" </span><span style="color: #007700">class=</span><span style="color: #DD0000">"btn1" </span><span style="color: #007700">/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&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">search</span><span style="color: #007700">:</span><span style="color: #0000BB">simple_form&#125;</span>
</code></div><p>
With this code we are using the ExpressionEngine <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdocs%2Fmodules%2Fsearch%2Fsimple.html">Simple Search</a> tags.&nbsp; There is also an <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdocs%2Fmodules%2Fsearch%2Fadvanced.html">Advanced Search</a> tagset which I don&#8217;t think I&#8217;ve honestly ever used.
</p>
<p>
The parameters you&#8217;ll need to tweak are the names of the weblogs, and the names of the no results and results templates - which we&#8217;ll load next.&nbsp; The other parameter you can look at is the <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdocs%2Fmodules%2Fsearch%2Fsimple.html%23par_search_in">&#8220;search_in&#8221;</a> - I&#8217;ve set it to everywhere since we have comments on this site.&nbsp; 
</p>
<p>
The important thing to remember when integrating the EE search tags with an existing design is that the style can be provided by the design through the use of the name and class parameters, but EE needs the &#8220;name=keywords&#8221; to stay.&nbsp; 
</p>
<p>
OK - save the updated code in that template and let&#8217;s load up the results and no results templates.
</p>
<p>
<b>No Results Template</b>
<br />
For these I typically just create a dedicated template, but again use the Miscellaneous_Content weblog as a source for the messages that are displayed.&nbsp; This approach lets my clients control those messages easily.&nbsp; So to get this working we need to:<ul>
<li>Load and tweak the no results template</li>
<li>Create two new entries in the Miscellaneous Content weblog</li>
<li>test</li>
</ul>
<p>
<b>Copy the No Results Template</b>
<br />
Create a new template in your main template group, and paste in this code :<a href="http://www.boyink.com/images/blog/chapter_17_noresults.txt">chapter_17_noresults.txt</a>.&nbsp; Tweak any of the necessary names and paths and save it.&nbsp; I&#8217;ve got it named as chapter_17_noresults.&nbsp; If you name it differently you&#8217;ll need to go back into the search_section_intros embedded template and update the search tag parameter with the new template name.
</p>
<p>
<b>Create New Miscellaneous Content Entries</b>
<br />
The new no results template assumes two new entries:<ul>
<li>The section header entry that appears next to the search bar in the green area.&nbsp; This entry needs a url_title of &#8220;please-try-again&#8221;.&nbsp; Enter some text and save.</li>
<li>The body content.&nbsp; The entry needs a url_title of no-results.&nbsp; Enter some sort of sympathetic &#8220;we&#8217;re sorry&#8221; text and save.</li>
</ul>
<p>
Again remember that if you&#8217;ve specified url titles using underscores rather than dashes the url titles parameters in the template will need to be tweaked to suit.
</p>
<p>
Note that this template doesn&#8217;t exist in the main navigation for the site, so I&#8217;m passing an empty string to the main navigation for the location value.&nbsp; This ensures that the main navigation isn&#8217;t &#8220;lit up&#8221; for this template. 
</p>
<p>
<b>Test</b>
<br />
You should now be able to test your no results operation.&nbsp; Re-visit your site, refresh the page to ensure you&#8217;e got the latest,and enter in a non-sensical search term that you know doesn&#8217;t appear on the site.&nbsp; You should get the new no results template as a result, with the messages you created in the Miscellaneous Content weblog.&nbsp; Here&#8217;s my rendered no results template: <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fbuilding_series%2Fchapter_17_noresults%2F">http://www.boyink.com/splaat/building_series/chapter_17_noresults/</a>
</p>
<p>
<b>Search Results</b>
<br />
With the no results handled, let&#8217;s move on now to the search results.&nbsp; We&#8217;ll be using the <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdocs%2Fmodules%2Fsearch%2Fresults.html">Search Results</a> tag, but implementing it in a vastly simplified fashion that just feels better for this site.&nbsp; I did a small amount of CSS work for the results, so you might want to again grab the latest version of the stylesheet:
<br />
<a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%3Fcss%3Dbuilding_series%2Fstylesheet%2F">http://www.boyink.com/splaat?css=building_series/stylesheet/</a>
</p>
<p>
Our process here will be:<ul>
<li>Loading up and tweaking the search results template</li>
<li>Creating a &#8220;results found&#8221; entry in the Miscellaneous Content weblog?</li>
<li>Going through our weblog configurations, making sure the search results path is specified, and the excerpt field is specified.</li>
</ul>
<p>
<b>Create the Search Results Template</b>
<br />
Create a new template in your main template group.&nbsp; I&#8217;ve named my &#8220;chapter_17_search_results&#8221;.&nbsp; You can name yours differently but again you&#8217;ll need to go back and edit the parameters on the simple search tag.&nbsp; Here&#8217;s the code to paste into this template: <a href="http://www.boyink.com/images/blog/chapter_17_search_results.txt">chapter_17_search_results.txt</a>.
</p>
<p>
Paste that into your new template, and tweak any names/paths necessary for your installation.
</p>
<p>
You&#8217;&#8217;ll note that we have a couple new variables being displayed on this template - one for total hits and one that displays the keywords that were passed to the search:
<br />
</p><div class="codeblock"><code>
<span style="color: #0000BB">&#123;exp</span><span style="color: #007700">:</span><span style="color: #0000BB">search</span><span style="color: #007700">:</span><span style="color: #0000BB">total_results&#125; Result</span><span style="color: #007700">(</span><span style="color: #0000BB">s</span><span style="color: #007700">) for </span><span style="color: #0000BB">&#123;exp</span><span style="color: #007700">:</span><span style="color: #0000BB">search</span><span style="color: #007700">:</span><span style="color: #0000BB">keywords&#125;</span>
</code></div><p>
</p>
<p>
You&#8217;ll also note that each result has a couple of variables in each list item - and these we need to look at more closely:
<br />
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">li </span><span style="color: #007700">class=</span><span style="color: #DD0000">"search_results"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">b</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;auto_path&#125;"</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">a</span><span style="color: #007700">&gt;&lt;/</span><span style="color: #0000BB">b</span><span style="color: #007700">&gt; </span><span style="color: #0000BB">from </span><span style="color: #007700">&lt;</span><span style="color: #0000BB">em</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#123;weblog&#125;</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">em</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">br</span><span style="color: #007700">/&gt;</span><span style="color: #0000BB">&#123;excerpt&#125;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">br</span><span style="color: #007700">/&gt;&lt;/</span><span style="color: #0000BB">li</span><span style="color: #007700">&gt;</span>
</code></div><p>
</p>
<p>
First let&#8217;s tackle the auto_path.&nbsp; This variable is where EE holds that mapping of database content to template location I spoke of earlier.&nbsp; If you look at the <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdocs%2Fmodules%2Fsearch%2Fresults.html%23var_auto_path">docs</a> for this variable you&#8217;ll see that it&#8217;s set in the Weblog Management area for each weblog.&nbsp; So let me provide you a list of how I&#8217;ve setup each weblog for this tutorial, and it&#8217;s Search Results URL setting:<ul>
<li>Building Series About<br/>http://www.boyink.com/splaat/building_series/chapter_17_about</li>
<li>Building Series Homepage<br/>http://www.boyink.com/splaat/building_series/chapter_17_index</li>
<li>Building Series Products<br/>http://www.boyink.com/splaat/building_series/chapter_17_product_detail</li>
<li>Building Series Services<br/>http://www.boyink.com/splaat/building_series/chapter_17_services_detail</li>
<li>Building Series Weblog<br/>http://www.boyink.com/splaat/building_series/chapter_17_comments</li>
</ul>
<p>
Basically - where the section is configured with single-view templates I link to them.&nbsp; If there is no single-view template, I link to the multiview - knowing that when the search results are formatted EE will append on the url_title which will have the effect of making the multi-view template display only the one entry.
</p>
<p>
Nw let&#8217;s tackle the excerpt variable.&nbsp; This is also a per-weblog setting, and is found in Weblog Administration  >  Weblog Management  >  Administrative Settings > &#8220;Which field should be used for search excerpt?&#8221;  
</p>
<p>
Typically I just pick the field that will, on average, have the most content for that weblog.&nbsp; For our weblogs above it&#8217;s the page content field for the Home and About pages, the description field for Products and Services and the Body field for the weblog.
</p>
<p>
With those configurations saved you should be able to use your search engine with terms that you know appear in the content, and get results.&nbsp; The results should have links that take you to that entry on the site, using the template you&#8217;ve specified.
</p>
<p>
<b>Keep In Mind</b>
<br />
Keep in mind that, on the search results template, you can use conditionals and &#8220;nearly all&#8221; of the variables etc from the weblog:entries tag - in addition to plug ins, etc.&nbsp; I&#8217;ve built more complex search results templates with these extra tools that in the end performed a bit better than the defaults - but at least you know have a starting point.
</p>
<p>
You can view the search results template in action by doing a search on the <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fbuilding_series%2Fchapter_17_index%2F">Chapter 17 site</a>.&nbsp; I&#8217;d suggest the keyword of &#8220;car&#8221; for a few results.
</p>
<p>
<b>Are Your Fields Searchable?</b>
<br />
Not seeing the results you expect?&nbsp; 
</p>
<p>
Here&#8217;s another thing to remember: each field in EE is configurable to be searchable or not.&nbsp; Now would be a good time to run through all your fields and make sure they are configured properly.&nbsp; The setting can be found in  Admin >  Weblog Administration  >  Field Groups  >  Custom Fields.&nbsp; Choose your field group, then your field.&nbsp; Scroll down to where it says &#8220;Is field searchable?&#8221; and make sure that it&#8217;s set to &#8220;Yes&#8221;.
</p>
<p>
<b>Updating the Footer</b>
<br />
Oh - one small change I hadn&#8217;t noted anywhere.&nbsp; Now that the site&#8217;s main sections are fully implemented, you can go back to the Miscellaneous Content entry that&#8217;s holding your footer content and update the links.&nbsp; I got rid of the links to the HTML and CSS validator in order to make room to replicate the main navigation with text links.
</p>
<p>
<b>And With That...</b>
<br />
Five months <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fcomments%2Fbuilding-an-expressionengine-site-chapter-1%2F">to the day</a> of starting this series....we&#8217;re done!&nbsp; I&#8217;ve had a good time writing this, and have benefited greatly with encouraging comments, emails and links (thanks to all of you for your kind words).&nbsp; My Google page rank has gone up, and I&#8217;ve gotten some good PR over on the ExpressionEngine blog and forums.&nbsp;  
</p>
<p>
But it has been a ton of work with each chapter being a few hours in the making - so I am glad to be done.&nbsp; 
</p>
<p>
I am, however, more convinced than ever that there is still a great need for EE tutorials and training, and have some not-quite-fully baked ideas for some more work to that end.&nbsp; Stay tuned!
</p>
<p>
Back to <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fcomments%2Fbuilding-an-expressionengine-site-chapter-16%2F">Chapter 16</a>
</p>]]></description>
      <dc:subject>building&#45;an&#45;expression&#45;engine&#45;site, expression&#45;engine</dc:subject>
      <dc:date>2008-01-01T19:49:00-05:00</dc:date>
    </item>

    <item>
      <title>Building an ExpressionEngine Site &#45; Chapter 16</title>
      <link>http://www.boyink.com/splaat/comments/building-an-expressionengine-site-chapter-16/</link>
      <guid>http://www.boyink.com/splaat/comments/building-an-expressionengine-site-chapter-16/#When:18:32:01Z</guid>
      <description><![CDATA[<p>In which we fully implement the Weblog section, learn about global variables and passing variables in variables.&nbsp;
</p><p><i>Author&#8217;s Note: My apologies - I accidentally deleted this entry while working on chapter 17.&nbsp; I was able to retrieve the article text from my rss feed, but lost all the original comments.</i>
</p>
<p>
Yes, finally, I&#8217;m back with another chapter in the Building an <a href="http://www.expressionengine.com/index.php?affiliate=boyink">ExpressionEngine</a> Site series.&nbsp; It&#8217;s been a couple of weeks since our last installment - but with the holidays plus negotiating for my <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fcomments%2Fmichael-boyink-joins-ellislab%2F">new job with EllisLab</a> and other projects going on, this one took awhile.&nbsp; Also - and this is a good heads up for those of you new to implementing sites on EE, weblogs will always take longer than other sections of the site.&nbsp; Why?&nbsp; Simply because they require more work - more templates and more formatting.&nbsp; 
</p>
<p>
However, as always with EE, there are a number of ways to implement a weblog with EE.&nbsp; Let me explain at a high level the approach I&#8217;m taking here and you can decide if it meets your needs or not.&nbsp;
</p><p><b>Weblog Implementation Overview</b>
<br />
Most weblogs will require a number of templates - however, depending on your requirements and expectations of traffic to a weblog you can make some choices that will save you some time and trouble on the front end. 
</p>
<p>
Weblogs being, well, weblogs, they usually have the following needs:<ul>
<li>An index template that comes up by default, and shows the last x number of posts with the newest at the top.&nbsp; If there are longer posts, often this template only shows part of the post and has a &#8220;read more&#8221; link of some sort, which leads to the&#8230; </li>
<li>Single-view template that shows an entire post </li>
<li>Comments template where users can respond </li>
<li>Permalink template which places this post at a specific URL that won&#8217;t change as new content gets added to the weblog </li>
<li>Category Index - if the weblog posts are categorized, this view shows the latest posts assigned to the desired category </li>
<li>Archive - most often this is broken down by month </li>
<li>RSS or Atom feed </li>
</ul>
<p>
Quite a list.&nbsp; 
</p>
<p>
However - especially for weblogs like we&#8217;re building that are part of a business site (rather than really being the entire site) we can repurpose one template to serve multiple needs.&nbsp; In this tutorial we&#8217;ll accomplish the weblog implementation with three main templates and a few new embedded templates.&nbsp; The three main templates will be:<ul>
<li>Weblog Index.&nbsp; This will serve as the default index view, the category view and the archive view </li>
<li>Weblog Comments.&nbsp; This will serve as the single-view, comments, and permalink template. </li>
<li>RSS feed. </li>
</ul>
<p>
<b>Working Model</b>
<br />
Here&#8217;s a link to the working model weblog that this tutorial covers: <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fbuilding_series%2Fchapter_16_weblog%2F">http://www.boyink.com/splaat/building_series/chapter_16_weblog/</a>.&nbsp; Play around with it, and note where all the links go. 
</p>
<p>
If your blog is busier, has deep archives, or you want a different category view, you might consider dedicated templates for those purposes.&nbsp; I prefer to start simple so for most clients just getting into blogs will start with this approach and modify it later based on actual need.&nbsp; 
</p>
<p>
Onto the build! 
</p>
<p>
<b>Create Data Structures </b>
<br />
To begin, you&#8217;ll first need to get the EE data structures in place.&nbsp; You&#8217;ll need:<ul>
<li>A new weblog.&nbsp; In my case and in all the sample templates I&#8217;ll be providing this is called &#8220;bees_weblog&#8221;.&nbsp; Make sure commenting is enabled. </li>
<li>A fieldset.&nbsp; I&#8217;m using the default field set that installs with EE so will have fields of body, summary, and extended. </li>
<li>A category group.&nbsp; I created a weblog-specific category group called &#8220;bees_weblog&#8221; with categories of Company News, Industry News, and Ramblings.&nbsp; I entered short descriptions for each. </li>
<li>Remember to assign the new category group and field group to the new weblog. </li>
</ul>
<p>
<b>Do Some Data Entry</b>
<br />
Go ahead and make some entries in your new weblog - at least one per category.&nbsp; Make sure to use all the fields so you&#8217;ll know if your templates function correctly.&nbsp; Oh - and also post a new section heading type thing into your miscellaneous_content weblog.&nbsp; Make sure it has a url_title of &#8220;weblog&#8221;. 
</p>
<p>
<b>Load the New Main Templates </b>
<br />
Here are the new templates you&#8217;ll need.&nbsp; Let&#8217;s get these and the new embedded templates loaded up and working, then I&#8217;ll go through and hit the highlights.&nbsp; I&#8217;ve done a bit of higher-level coding in these both to save you some time tweaking them and to demonstrate the use of EE variables.&nbsp; Here are the three main templates.&nbsp; These should go in the same template group as the other main templates in your site:<ul>
<li>Weblog Index (saved as chapter_16_weblog in my example site): <a href="http://www.boyink.com/images/blog/chapter_16_weblog.txt">chapter_16_weblog.txt</a> </li>
<li>Weblog Comments (saved as chapter_16_comments in my example site):<a href="http://www.boyink.com/images/blog/chapter_16_comments.txt">chapter_16_comments.txt</a> </li>
<li>RSS (saved as rss_2 in my example site). Note that this feed has been modified so that it will display HTML. <a href="http://www.boyink.com/images/blog/rss_2.txt">rss_2.txt</a> </li>
</ul>
<p>
<b>RSS Template</b>
<br />
Make sure when you create the new template for the RSS feed, you choose &#8220;RSS Page&#8221; in the &#8220;Template Type&#8221; drop-down.&nbsp; If you forget while creating the template, just click the &#8220;preferences&#8221; link for the template group you put it in, and change it there.
</p>
<p>
<b>Load the New Embedded Templates </b>
<br />
The weblog index and weblog comments template share some right-column elements, so I&#8217;ve pulled these out and saved them as embedded templates.&nbsp; Here are the ones you&#8217;ll need.&nbsp; Save them into the template group holding the rest of your embedded templates:<ul>
<li>Weblog Categories (saved as weblog_categories): <a href="http://www.boyink.com/images/blog/chapter_16_weblog_categories.txt">chapter_16_weblog_categories.txt</a></li>
<li>Weblog Monthly Archives (saved as monthly_archives):<a href="http://www.boyink.com/images/blog/chapter_16_monthly_archives.txt">chapter_16_monthly_archives.txt</a></li>
<li>RSS link (saved as syndicate_block):<a href="http://www.boyink.com/images/blog/chapter_16_syndicate_block.txt">chapter_16_syndicate_block.txt</a></li>
<li>Comments form (more on why I embed this later) saved as weblog_entry_comments:<a href="http://www.boyink.com/images/blog/chapter_16_weblog_entry_comments.txt">chapter_16_weblog_entry_comments.txt</a> </li>
</ul>
<p>
<b>Grab the Updated Stylesheet </b>
<br />
We&#8217;ve several new content types now, and I had to create entries in the stylesheet for them.&nbsp; Make sure to grab the latest version: <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%3Fbuilding_series%2Fstylesheet%2F">http://www.boyink.com/splaat?building_series/stylesheet/</a> 
</p>
<p>
<b>Update Main Navigation </b>
<br />
Remember to update the embedded template that contains your main navigation.&nbsp; Mine now looks like this:
<br />
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">div id</span><span style="color: #007700">=</span><span style="color: #DD0000">"menu"</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">div </span><span style="color: #007700">class=</span><span style="color: #DD0000">"submit"</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">ul</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">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a&#123;if </span><span style="color: #DD0000">'&#123;embed:my_location&#125;'</span><span style="color: #007700">==</span><span style="color: #DD0000">"home"</span><span style="color: #0000BB">&#125; </span><span style="color: #007700">class=</span><span style="color: #DD0000">"selected"</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">if&#125; href</span><span style="color: #007700">=</span><span style="color: #DD0000">"/splaat/building_series/chapter_16_index/" </span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Home</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</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">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">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a&#123;if </span><span style="color: #DD0000">'&#123;embed:my_location&#125;'</span><span style="color: #007700">==</span><span style="color: #DD0000">"about"</span><span style="color: #0000BB">&#125; </span><span style="color: #007700">class=</span><span style="color: #DD0000">"selected"</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">if&#125; href</span><span style="color: #007700">=</span><span style="color: #DD0000">"/splaat/building_series/chapter_16_about/"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">About</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</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">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">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a&#123;if </span><span style="color: #DD0000">'&#123;embed:my_location&#125;'</span><span style="color: #007700">==</span><span style="color: #DD0000">"products"</span><span style="color: #0000BB">&#125; </span><span style="color: #007700">class=</span><span style="color: #DD0000">"selected"</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">if&#125; href</span><span style="color: #007700">=</span><span style="color: #DD0000">"/splaat/building_series/chapter_16_products/"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Products</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</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">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">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a&#123;if </span><span style="color: #DD0000">'&#123;embed:my_location&#125;'</span><span style="color: #007700">==</span><span style="color: #DD0000">"services"</span><span style="color: #0000BB">&#125; </span><span style="color: #007700">class=</span><span style="color: #DD0000">"selected"</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">if&#125; href</span><span style="color: #007700">=</span><span style="color: #DD0000">"/splaat/building_series/chapter_16_services/"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Services</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</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">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">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a&#123;if </span><span style="color: #DD0000">'&#123;embed:my_location&#125;'</span><span style="color: #007700">==</span><span style="color: #DD0000">"weblog"</span><span style="color: #0000BB">&#125; </span><span style="color: #007700">class=</span><span style="color: #DD0000">"selected"</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">if&#125; href</span><span style="color: #007700">=</span><span style="color: #DD0000">"/splaat/building_series/chapter_16_weblog/"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Weblog</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</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">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">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a href</span><span style="color: #007700">=</span><span style="color: #DD0000">"#"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Contact</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</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">li</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/</span><span style="color: #0000BB">ul</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;/</span><span style="color: #0000BB">div</span><span style="color: #007700">&gt;<br />&lt;/</span><span style="color: #0000BB">div</span><span style="color: #007700">&gt;</span>
</code></div><p>
</p>
<p>
<b>Specifying Names with Global Variables </b>
<br />
OK, with those new templates loaded you&#8217;ll need to make and name or pathing changes required for using them in your environment.&nbsp; If you&#8217;ve been following along with this series, you&#8217;ll have done this several times, changing the code of the embeds to reflect the name of your specific template group holding your embedded templates. 
</p>
<p>
But don&#8217;t do that yet.&nbsp; I&#8217;ve made this easier, and want to explain how.&nbsp; First open the weblog_index template.&nbsp; See where it has the following code: 
<br />
</p><div class="codeblock"><code>
<span style="color: #0000BB">&#123;assign_variable</span><span style="color: #007700">:</span><span style="color: #0000BB">my_weblog</span><span style="color: #007700">=</span><span style="color: #DD0000">"bees_weblog"</span><span style="color: #0000BB">&#125;<br />&#123;assign_variable</span><span style="color: #007700">:</span><span style="color: #0000BB">my_template_group</span><span style="color: #007700">=</span><span style="color: #DD0000">"building_series"</span><span style="color: #0000BB">&#125;<br />&#123;assign_variable</span><span style="color: #007700">:</span><span style="color: #0000BB">my_embedded_template_group</span><span style="color: #007700">=</span><span style="color: #DD0000">"building_series_ch16_embeds"</span><span style="color: #0000BB">&#125;<br />&#123;assign_variable</span><span style="color: #007700">:</span><span style="color: #0000BB">my_index_template</span><span style="color: #007700">=</span><span style="color: #DD0000">"chapter_16_weblog"</span><span style="color: #0000BB">&#125;<br />&#123;assign_variable</span><span style="color: #007700">:</span><span style="color: #0000BB">my_comments_template</span><span style="color: #007700">=</span><span style="color: #DD0000">"chapter_16_comments"</span><span style="color: #0000BB">&#125;</span>
</code></div><p>
</p>
<p>
What&#8217;s that all about? 
</p>
<p>
These are <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdocs%2Ftemplates%2Fglobals%2Fassign_variable.html">Dynamically Assigned Global Variables</a>, although don&#8217;t let the &#8220;Global&#8221; world fool you.&nbsp; Like the docs state: &#8220;Variables created this way are available for use anywhere within that template.&#8221;
</p>
<p>
Essentially you can think of these as &#8220;text-replacement&#8221; variables.&nbsp; As EE parses the template, it will store the text you specify in the &#8220;assign_variable&#8221; statement, and then anywhere it runs into that variable name in the rest of the code template, EE will swap out the variable name for the text.&nbsp; For example, we&#8217;ve specified &#8220;building_series_ch16_embeds&#8221; as the value for &#8220;my_embedded_template_group&#8221;.&nbsp; Later in the template, when EE finds: 
<br />
</p><div class="codeblock"><code>
<span style="color: #0000BB">&#123;embed</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;my_embedded_template_group&#125;/logo_title"</span><span style="color: #0000BB">&#125;</span>
</code></div><p>
</p>
<p>
EE will substitute the text we specified and see that line of code as: 
<br />
</p><div class="codeblock"><code>
<span style="color: #0000BB">&#123;embed</span><span style="color: #007700">=</span><span style="color: #DD0000">"building_series_ch16_embeds/logo_title"</span><span style="color: #0000BB">&#125;</span>
</code></div><p>
</p>
<p>
Got it?
</p>
<p>
Cool. 
</p>
<p>
Why did I use them?&nbsp; Two reasons:<ul>
<li>First, to make it easier for you to move these templates into your environment.&nbsp; Rather than having to edit several lines of code, now you can just make the change in one spot and the rest of the template will use that updated variable value.</li>
<li>To get you thinking about more advanced coding methods like this.&nbsp; Depending on your specific EE project, using things like Global Variables can make it easier to get your work done by centralizing templates that do the same thing but for different areas of your site. </li>
</ul>
<p>
So - take a moment now and edit the values of those variables in both the chapter_16_weblog and chapter_16_comments templates where appropriate. Once saved, the templates should load and function properly. 
</p>
<p>
<b>Building Links Using a Combination of Variables </b>
<br />
With the global variables in place, now it&#8217;s possible to build links using a combination of true Global Variables, template Global Variables, and content from a weblog entry.&nbsp; Consider this link: 
<br />
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">a href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;homepage&#125;/&#123;my_template_group&#125;/&#123;my_comments_template&#125;/&#123;url_title&#125;"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Read More</span><span style="color: #007700">...&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;</span>
</code></div><p>
</p>
<p>
<b>Passing Global Variables to Embedded Templates </b>
<br />
OK, take a deep breath.&nbsp; This will be the most complex part of this chapter, and possibly this entire tutorial series. Go do some carbo-loading if need be.&nbsp; Ready?&nbsp; OK.&nbsp; 
</p>
<p>
Here&#8217;s the situation.&nbsp; The parent weblog index and weblog comments templates know some things that the embedded templates also need to know.&nbsp; The embedded templates are building the navigation to the category and archive views of our weblog, which will use the index template for presentation.&nbsp; The parent templates know the name of the weblog needed, the name of the index template and what template group it&#8217;s in, because we&#8217;ve specified those items as global variables.&nbsp; But we have two embedded templates that will also need that information.&nbsp; 
</p>
<p>
What to do?&nbsp; Well, we could just copy our &#8220;assign_variable&#8221; code from the parent templates to the embedded templates.&nbsp; But that&#8217;s not very elegant, and increases the number of places to make edits if those values change. 
</p>
<p>
The other alternative is to combine Global Variables with Embed variables.&nbsp; This way, the variable is specified in the parent template, then passed into the embedded template for use there.&nbsp; 
</p>
<p>
Now just stop and think about this for a minute.&nbsp; What we&#8217;ll end up with is an embedded template that builds, for example, links to weblog categories.&nbsp; But the weblog name of where the categories come from along with the location of the templates it needs to link to are variables.&nbsp; What&#8217;s this mean?&nbsp; You now have a little &#8220;category-link-builder&#8221; that you could re-use across different parts of a site, even when the weblog is different or the templates it&#8217;s linking to is different.&nbsp; I&#8217;ve used this approach here on Boyink.com—I have four main weblogs (the business blog, Jeep, Bantam, and Photos).&nbsp; On each of them I wanted category navigation for the bottom of the page. With this approach I have one embedded template that builds that category nav, and I just send it the necessary weblog name, and template names it needs to link to.&nbsp; Then, for example, when I wanted to pull category descriptions in addition to the category name, all I had to do was edit that one embedded template&#8217;s code, and voila - all four weblogs instantly see the update. 
</p>
<p>
So how to do this?&nbsp; The trick to remember is that in order to pass a Global Variable to an embedded template you have to change it&#8217;s name on the way.&nbsp; For example, in our weblog index template we have: 
<br />
</p><div class="codeblock"><code>
<span style="color: #0000BB">&#123;assign_variable</span><span style="color: #007700">:</span><span style="color: #0000BB">my_weblog</span><span style="color: #007700">=</span><span style="color: #DD0000">"bees_weblog"</span><span style="color: #0000BB">&#125;</span>
</code></div><p>
</p>
<p>
While passing it to the embedded template (category navigation builder), the variable gets its name changed to &#8220;the_weblog&#8221;: 
<br />
</p><div class="codeblock"><code>
<span style="color: #0000BB">&#123;embed</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;my_embedded_template_group&#125;/weblog_categories" </span><span style="color: #0000BB">the_index_template</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;my_index_template&#125;" </span><span style="color: #0000BB">the_template_group</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;my_template_group&#125;" </span><span style="color: #0000BB">the_weblog</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;my_weblog&#125;"</span><span style="color: #0000BB">&#125;</span>
</code></div><p>
</p>
<p>
Then in the embedded template, the new name is used: 
<br />
</p><div class="codeblock"><code>
<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 weblog</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;embed:the_weblog&#125;" </span><span style="color: #0000BB">style</span><span style="color: #007700">=</span><span style="color: #DD0000">"linear"</span><span style="color: #0000BB">&#125;</span>
</code></div><p>
</p>
<p>
Also note that formatting with quotes etc. is very picky and particular while doing this. 
</p>
<p>
OK- breathe easy. The hardest part is over. 
</p>
<p>
Again, to summarize, with these templates you should be able to load them up, edit the global variables to reflect what you&#8217;ve named both the templates and your template groups (make sure to edit both the weblog_index and weblog_comments) and once saved, the weblog should function. 
</p>
<p>
<b>The Comments Form</b>
<br />
Let&#8217;s take a look at the comments form now.&nbsp; You might be wondering why, since I have only one weblog single view/permalink/comments template why I choose to embed the part of the page that actually displays the comments (the embedded template called &#8220;weblog_entry_comments").&nbsp; Mainly it makes the parent comments template a bit shorter/cleaner, and it sets you up well for use with multiple weblogs.&nbsp; Ever since building Boyink.com in this fashion - where I wanted to have a centralized comments form for use by four different weblogs - I&#8217;ve been doing it this way.&nbsp; Comments are a bit of a pain to layout and style, so only doing it once for multiple weblogs is a nice way to go. 
</p>
<p>
Lesse...what else is there with this Chapter.&nbsp; Oh yea&#8230; 
</p>
<p>
<b>Highlighted Category Nav </b>
<br />
Just for fun I used URL Segments along with conditionals to apply an active class to the currently viewed category.&nbsp; You can see it action <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fbuilding_series%2Fchapter_16_weblog%2Fcategory%2Fcompany-news%2F">here</a>. 
</p>
<p>
Let&#8217;s look at that code: 
<br />
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Weblog Categories</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">div </span><span style="color: #007700">class=</span><span style="color: #DD0000">"lcontent"</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">ul</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">!-- </span><span style="color: #0000BB">Conditional on the </span><span style="color: #007700">list </span><span style="color: #0000BB">item applies an active </span><span style="color: #007700">class </span><span style="color: #0000BB">to the currently viewed category</span><span style="color: #007700">. --</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#123;exp</span><span style="color: #007700">:</span><span style="color: #0000BB">weblog</span><span style="color: #007700">:</span><span style="color: #0000BB">categories weblog</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;embed:the_weblog&#125;" </span><span style="color: #0000BB">style</span><span style="color: #007700">=</span><span style="color: #DD0000">"linear"</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">li &#123;if segment_4</span><span style="color: #007700">==</span><span style="color: #0000BB">category_url_title&#125;class</span><span style="color: #007700">=</span><span style="color: #DD0000">"active_cat"</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">if&#125;</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">a href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;homepage&#125;/&#123;embed:the_template_group&#125;/&#123;embed:the_index_template&#125;/category/&#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;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/</span><span style="color: #0000BB">li</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 />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#123;</span><span style="color: #007700">!-- </span><span style="color: #0000BB">This conditional will only show when a category has been selected</span><span style="color: #007700">, and </span><span style="color: #0000BB">allows a user to </span><span style="color: #007700">return </span><span style="color: #0000BB">to the </span><span style="color: #007700">default </span><span style="color: #0000BB">of showing all posts on the weblog </span><span style="color: #007700">--</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#123;if segment_3</span><span style="color: #007700">==</span><span style="color: #DD0000">"category"</span><span style="color: #0000BB">&#125;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&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;&lt;</span><span style="color: #0000BB">a href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;homepage&#125;/&#123;embed:the_template_group&#125;/&#123;embed:the_index_template&#125;/"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">All News Items</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;&lt;/</span><span style="color: #0000BB">li</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">if&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">ul</span><span style="color: #007700">&gt;<br />&lt;/</span><span style="color: #0000BB">div</span><span style="color: #007700">&gt;</span>
</code></div><p>
 
<br />
All this does is compare the 4th url segment (which displays the category url title for the currently viewed category) to the category_url_title of each category returned by the weblog:categories tag.&nbsp; When the condition is true, the class of &#8220;active_cat&#8221; is applied to that category name.&nbsp; If your URL structure is different you may need to change what segment the code looks at. 
</p>
<p>
Also - I&#8217;ve used another conditional to display an &#8220;All News Items&#8221; link under the category list.&nbsp; This will only display of a category has been choosen.&nbsp; Not a big deal - it just flags the user that they are looking at a category view and provides a link that&#8217;s a bit more clear than remembering to click the &#8220;weblog&#8221; main navigation item. 
</p>
<p>
<b>Monthly Archives </b>
<br />
Aside from our trickery with the variables, the archive links are built using a straightforward implementation of the weblog:month_links tag. 
</p>
<p>
<b>RSS Template </b>
<br />
The RSS template is also a straightforward copy/tweak of the template that EE installs with.&nbsp; As mentioned above I did make the changes required for it to display HTML. 
</p>
<p>
<b>Zzzzzzzz </b>
<br />
Still with me?&nbsp; My eyes are bugging out a bit reading this.&nbsp; I have a feeling I may need to re-visit this chapter, but since it&#8217;s been a while and since this is such a big chapter I&#8217;m going to put it live.&nbsp; You can let me know in the comments if there&#8217;s something I didn&#8217;t explain clearly or if the templates didn&#8217;t load and work as expected. 
</p>
<p>
Next up - barring the need to re-vamp this chapter - I&#8217;ll work on the Contact Us page.&nbsp; That should be really quick and easy compared to this one.&nbsp; Past that all we&#8217;ve got is the Search and Search results to get going. 
</p>
<p>
Back to <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fcomments%2Fbuilding-an-expressionengine-site-chapter-15%2F">Chapter 15</a>.
<br />
On to <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fcomments%2Fbuilding-an-expressionengine-site-chapter-17%2F">Chapter 17</a>.
</p>
]]></description>
      <dc:subject>building&#45;an&#45;expression&#45;engine&#45;site, expression&#45;engine</dc:subject>
      <dc:date>2007-12-27T18:32:01-05:00</dc:date>
    </item>

    <item>
      <title>Building an ExpressionEngine Site &#45; Chapter 15</title>
      <link>http://www.boyink.com/splaat/comments/building-an-expressionengine-site-chapter-15/</link>
      <guid>http://www.boyink.com/splaat/comments/building-an-expressionengine-site-chapter-15/#When:17:58:00Z</guid>
      <description><![CDATA[<p>In which we get all....related-like.&nbsp; Using categories to display services related to products and vice-versa.
</p><p>So in <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fcomments%2Fbuilding-an-expressionengine-site-chapter-14%2F">Chapter 14</a>, we implemented the Services section of our model site, and assigned those services to the same categories as our existing Products.
</p>
<p>
In this chapter, we&#8217;ll display Services related to Products on the Products category pages, and Products related to Services on the Services category pages.&nbsp; Confused yet?&nbsp; 
</p>
<p>
We&#8217;ll need two new embedded templates (one each for related products and related services), and we&#8217;ll need to edit the two existing category templates for those sections.&nbsp; 
</p><p>Note that the full-text versions of the templates will be available at the bottom of this post.
</p>
<p>
<b>New Related Services Template</b>
<br />
This template will go on the Products category page, and pull in the Services that are assigned to the same category as the currently-viewed Products category.&nbsp; The template is a simple one, and gets saved into your &#8220;embeds&#8221; template group:
<br />
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Related Services</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">div </span><span style="color: #007700">class=</span><span style="color: #DD0000">"lcontent"</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">ul</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">entries weblog</span><span style="color: #007700">=</span><span style="color: #DD0000">"bees_services" </span><span style="color: #0000BB">disable</span><span style="color: #007700">=</span><span style="color: #DD0000">"categories|pagination|trackbacks|member_data|custom_fields"</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">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;url_title_path=building_series/chapter_15_services_detail&#125;"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#123;title&#125; </span><span style="color: #007700">&gt;&gt;&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;&lt;/</span><span style="color: #0000BB">li</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">entries&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">ul</span><span style="color: #007700">&gt;<br />&lt;/</span><span style="color: #0000BB">div</span><span style="color: #007700">&gt;</span>
</code></div><p>
</p>
<p>
This template is just a simple weblog:entries tag, with as much disabled as possible that returns an unordered list of linked titles.
</p>
<p>
But wait - don&#8217;t we need to somehow tell the tag what category we need?&nbsp; There is the <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdocs%2Fmodules%2Fweblog%2Fparameters.html%23par_category">category</a> parameter and we could grab the category from the url using segments and.....
</p>
<p>
Hold on.
</p>
<p>
I&#8217;ve found that just about every time I&#8217;ve started down the path of forcing the weblog:entries tag to display a specific category it&#8217;s been unnecessary.&nbsp; Why?&nbsp; Because EE is going to do it anyway.&nbsp; The most important thing to note about this template is what <b>isn&#8217;t</b> there - and that&#8217;s the  <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdocs%2Fmodules%2Fweblog%2Fparameters.html%23par_dynamic">&#8220;dynamic="off&#8221;</a> parameter that is usually required for sidebar content to display correctly.&nbsp; 
</p>
<p>
In this case, we want the weblog:entries tag to be dynamic, as then EE will dynamically grab the category from the URL and use it filter the list of services to just the ones that are the same category group as the products being displayed.
</p>
<p>
<b>New Related Products Template</b>
<br />
Got it?&nbsp; Good.&nbsp; Let&#8217;s make another one - this one to pull in products that are in the same category group as the Services category being displayed.&nbsp; Save it into your &#8220;embeds&#8221; template group as well:
<br />
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Related Products</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">div </span><span style="color: #007700">class=</span><span style="color: #DD0000">"lcontent"</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">ul</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">entries weblog</span><span style="color: #007700">=</span><span style="color: #DD0000">"bees_products" </span><span style="color: #0000BB">disable</span><span style="color: #007700">=</span><span style="color: #DD0000">"categories|pagination|trackbacks|member_data|custom_fields"</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">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;url_title_path=building_series/chapter_15_product_detail&#125;"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#123;title&#125; </span><span style="color: #007700">&gt;&gt;&lt;/</span><span style="color: #0000BB">a</span><span style="color: #007700">&gt;&lt;/</span><span style="color: #0000BB">li</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">entries&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">ul</span><span style="color: #007700">&gt;<br />&lt;/</span><span style="color: #0000BB">div</span><span style="color: #007700">&gt;</span>
</code></div><p>
</p>
<p>
<b>Editing the Products Category Template</b>
<br />
Now all we need to is add our new Related Services embedded template into the existing product_list template.&nbsp; Let&#8217;s put this new content at the top of the right column so it won&#8217;t be missed:
</p>
<p>
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">div id</span><span style="color: #007700">=</span><span style="color: #DD0000">"right_side"</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">"building_series_ch15_embeds/related_services"</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&#123;embed</span><span style="color: #007700">=</span><span style="color: #DD0000">"building_series_ch15_embeds/latest_news"</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&#123;embed</span><span style="color: #007700">=</span><span style="color: #DD0000">"building_series_ch15_embeds/latest_products"</span><span style="color: #0000BB">&#125;<br /></span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">div</span><span style="color: #007700">&gt;&lt;!-- </span><span style="color: #0000BB">close right_side </span><span style="color: #007700">--&gt;</span>
</code></div><p>
</p>
<p>
<b>Editing the Services Category Template</b>
<br />
And same with the existing services_list template, just embedding the related_products instead:
<br />
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">div id</span><span style="color: #007700">=</span><span style="color: #DD0000">"right_side"</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">"building_series_ch15_embeds/related_products"</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&#123;embed</span><span style="color: #007700">=</span><span style="color: #DD0000">"building_series_ch15_embeds/latest_news"</span><span style="color: #0000BB">&#125;<br />&nbsp;&nbsp;&nbsp;&nbsp;&#123;embed</span><span style="color: #007700">=</span><span style="color: #DD0000">"building_series_ch15_embeds/latest_products"</span><span style="color: #0000BB">&#125;<br /></span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">div</span><span style="color: #007700">&gt;&lt;!-- </span><span style="color: #0000BB">close right_side </span><span style="color: #007700">--&gt;</span>
</code></div><p>
</p>
<p>
<b>The Working Example</b>
<br />
Ready to see this in action?&nbsp; OK - let&#8217;s look at two sides of the same category - Accessories.&nbsp; First, here is the <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fbuilding_series%2Fchapter_15_product_list%2Fcategory%2Faccessories%2F">Products List</a>, showing our Accessories products in the main column, and related Accessories Services in the right column.&nbsp; Now let&#8217;s flip to the other side - here is the <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fbuilding_series%2Fchapter_15_services_list%2Fcategory%2Faccessories%2F">Services List</a> - showing the Services in the main column and the related Accessories Products in the sidebar.
</p>
<p>
I&#8217;ve seen a few posts in the ExpressionEngine forums wondering what Categories were really useful for - and I hope this shows one solid example.&nbsp; Being able to group and relate content from different areas of your main navigation is often very handy to do - essentially letting you slice your site horizontally as well as vertically.&nbsp; Keeping in mind that each weblog can have multiple category groups assigned to it and the possibilities grow even more.
</p>
<p>
<b>Templates</b>
<br />
Here are the full-text versions of the templates used in this chapter.&nbsp; Note again that I have chapter-specific groups for my embeds, so you will likely need to edit those paths to match your setup.
<br />
<ul>
<li>embeds/related_services:<a href="http://www.boyink.com/images/blog/chapter_15_related_services.txt">chapter_15_related_services.txt</a></li>
<li>embeds/related_products:<a href="http://www.boyink.com/images/blog/chapter_15_related_products.txt">chapter_15_related_products.txt</a></li>
<li>services_list:<a href="http://www.boyink.com/images/blog/chapter_15_services_list.txt">chapter_15_services_list.txt</a></li>
<li>products_list:<a href="http://www.boyink.com/images/blog/chapter_15_products_list.txt">chapter_15_products_list.txt</a></li>
</ul>
<p>
Next up - beginning the Weblog implementation.
</p>
<p>
Back to <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fcomments%2Fbuilding-an-expressionengine-site-chapter-14%2F">Chapter 14</a>.
<br />
On to <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fcomments%2Fbuilding-an-expressionengine-site-chapter-16%2F">Chapter 16</a>.
<br />

</p>]]></description>
      <dc:subject>building&#45;an&#45;expression&#45;engine&#45;site, expression&#45;engine</dc:subject>
      <dc:date>2007-12-06T17:58:00-05:00</dc:date>
    </item>

    <item>
      <title>Building an ExpressionEngine Site &#45; Chapter 14</title>
      <link>http://www.boyink.com/splaat/comments/building-an-expressionengine-site-chapter-14/</link>
      <guid>http://www.boyink.com/splaat/comments/building-an-expressionengine-site-chapter-14/#When:14:41:00Z</guid>
      <description><![CDATA[<p>In which we implement the Services section.
</p><p>In this chapter of the Building an <a href="http://www.expressionengine.com/index.php?affiliate=boyink">ExpressionEngine</a> site series I&#8217;ll work you through implementing the Services section of our example site.&nbsp; Between using EE objects that are already created (field groups, category groups, etc) and copying/tweaking existing templates I can get you through it in one chapter.
</p><p>Wa-a-ay back in <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fcomments%2Fbuilding-an-expressionengine-site-chapter-3%2F">chapter 3</a> we looked at the possibility of the Services section sharing a category group with the Products section.&nbsp; 
</p>
<p>
I think this is a good idea - as many businesses will offer a set of products and services that are related to each other.&nbsp; Being able to show those relationships on the website would then be valuable - to ensure that clients/users can be fully served, and (from a business perspective) to not miss out on potential upsell opportunities.
</p>
<p>
Now I&#8217;ve gone and used the word &#8220;relationships&#8221; so I should take a moment and explain the approach here.&nbsp; ExpressionEngine has a few different ways of - generically speaking - relating content.&nbsp; One way is weblogs - if two posts are in the same weblog they are inherently related.&nbsp;  Another way is categories. Having two posts assigned to the same category establishes another content relationship between those two posts.&nbsp; You can think of two posts in the same category as being more closely related than two posts in the same weblog but not in the same category.
</p>
<p>
New lets push it another way - category groups can also be assigned to more than one weblog.&nbsp;  So - if two posts are in different weblogs but assigned to the same category there is a relationship there that we can use to display those two posts on the same page.&nbsp; This is the approach I&#8217;ll be assuming.
</p>
<p>
EE also allows more formal content <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdocs%2Fmodules%2Fweblog%2Frelated_entries.html">relationships</a>.&nbsp;  These formal relationships are also valuable, but are (IMHO) more advanced. I think it&#8217;s best to get a grip on the ins and outs of categories before looking at formal relationships.
</p>
<p>
Having said all that - this chapter will focus on getting the Services section implemented.&nbsp; In the next chapter we&#8217;ll look at tying the Products and Services together from a presentational viewpoint.
</p>
<p>
OK - so here&#8217;s the overview list of what needs to happen for the Services section:<ul>
<li>New Services weblog, using existing field group and category group</li>
<li>Content entry<li>
<li>Template copying/tweaking</li>
<li>New Section Intro post in Miscellaneous Content weblog</li>
<li>Update main navigation</li>
</ul>
<p>
<b>New Services Weblog</b>
<br />
You&#8217;ve created a couple weblogs now, so I&#8217;m not going to walk through the specific steps (you can review earlier chapters if need be).&nbsp; Just create your new weblog, and name it.&nbsp; I&#8217;m naming mine with a full name of &#8220;Building Series Services&#8221; and a short name of &#8220;bees_services&#8221;.&nbsp; 
</p>
<p>
Once your weblog exists, use the &#8220;edit groups&#8221; link to assign it a field group of &#8220;simple_content&#8221; and a category group of &#8220;bees_products&#8221;.
</p>
<p>
<b>Content Entry</b>
<br />
Your new weblog is empty - so best to get some content in there before moving on.&nbsp; Even if it&#8217;s &#8220;greeking&#8221; without some content you won&#8217;t really know if your templates are working or not.
</p>
<p>
Enter about a half-dozen posts, and remember to assign each one to a category. Two per category should work well.
</p>
<p>
<b>Template Copying &amp; Tweaking</b>
<br />
Functionally the Services section of the site will be the same as the Products section; the index template will be a list of Services categories, clicking a category will return a list of the entries in that category, and clicking an entry will bring up the detail for that entry.
</p>
<p>
So let&#8217;s jump-start our template development by copying the 3 Products related templates: the index template, the product list template, and the product_detail template.&nbsp; I&#8217;ve named mine in the following manner:<ul>
<li>chapter_14_services</li>
<li>chapter_14_services_list</li>
<li>chapter_14_services_detail</li>
</ul>
<p>
Now for the tweaking.
</p>
<p>
To the Index template I had to change the following:<ul>
<li>Page title</li>
<li>my_location main navigation location flag</li>
<li>my_url_title variable in the search section intros embed</li>
<li>Weblog names</li>
<li>Link targets</li>
<li>Text in the &#8220;View Products&#8221; text link</li>
</ul>
<p>
<b>Small Change of Direction - another Custom Category Field</b>
<br />
I also removed the category photos and line manager information.&nbsp; After reviewing the results, I&#8217;ve decided that the category description I wrote for the Products just doesn&#8217;t cut it for describing the Services.&nbsp; I could re-write the description, but rather than making one description more generic I&#8217;d rather use another custom category field for describing the Services.&nbsp; You may choose to do it differently.
</p>
<p>
I&#8217;ve added a custom field to the bees_products category group, called &#8220;services_description&#8221; (text area, no formatting).&nbsp; I&#8217;ve gone back and added a services-specific description to each of my existing categories.&nbsp; I&#8217;ve also changed out the field in the Services index template, trading &#8220;category_description&#8221; for the new &#8220;services_description&#8221;.
</p>
<p>
<b>Back to Tweaking</b>
<br />
To the chapter_14_services_list template I made the following changes:<ul>
<li>Page title</li>
<li>Weblog name</li>
<li>my_location variable</li>
<li>the_url_title variable</li>
<li>Weblog names in main weblog:category heading tag and weblog:entry tag</li>
<li>Link targets</li>
<li>Linked text</li>
<li>Replaced category_description with services_description</li>
<li>Got rid of the images, and just made linked titles</li>
</ul>
<p>
Note that you could, if you desired more content on this page, use a new custom field set for the Services weblog, and create a &#8220;summary&#8221; field to use here.&nbsp; Or, similar to what we did with the Latest Products section, use the word_limit plug-in to pull the first 50 characters of text from the page_body field.&nbsp; At this point I&#8217;m going to keep this page simple with linked titles to each Service description.
</p>
<p>
To the chapter_14_services_detail I made the following changes:<ul>
<li>Page title</li>
<li>Weblog names</li>
<li>my_location variable</li>
<li>my_url_title variable</li>
<li>weblog name in the weblog:entries tag</li>
<li>changed fieldset in the weblog:entries tag</li>
</ul>
<p>
<b>Download the new templates</b>
<br />
Here are the three templates required for the Services section:<ul>
<li><a href="http://www.boyink.com/images/blog/chapter_14_services_index.txt">chapter_14_services_index.txt</a></li>
<li><a href="http://www.boyink.com/images/blog/chapter_14_services_list.txt">chapter_14_services_list.txt</a></li>
<li><a href="http://www.boyink.com/images/blog/chapter_14_services_detail.txt">chapter_14_services_detail.txt</a></li>
</ul>
<p>
<b>New Post in Miscellaneous Content Weblog</b>
<br />
OK - with those three templates in place the code is now looking for a Section Intro to pull with a url_title of &#8220;services&#8221;.&nbsp; Since that doesn&#8217;t exist, we need to publish that into the Miscellaneous Content weblog.
</p>
<p>
Once that&#8217;s published and saved, if you refresh any of your Services templates they should load the new intro.
</p>
<p>
<b>Updating Main Navigation</b>
<br />
Our main nav still isn&#8217;t highlighting the Services section as active - and it&#8217;s not hooked up to the new templates.&nbsp; Let&#8217;s fix that. In your main_nav embedded template you&#8217;ll need to to update the li for the Services section from:
<br />
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a href</span><span style="color: #007700">=</span><span style="color: #DD0000">"#" </span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Services</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</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">li</span><span style="color: #007700">&gt;</span>
</code></div><p>
</p>
<p>
to:
</p>
<p>
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">li</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">a&#123;if </span><span style="color: #DD0000">'&#123;embed:my_location&#125;'</span><span style="color: #007700">==</span><span style="color: #DD0000">"services"</span><span style="color: #0000BB">&#125; </span><span style="color: #007700">class=</span><span style="color: #DD0000">"selected"</span><span style="color: #0000BB">&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">if&#125; href</span><span style="color: #007700">=</span><span style="color: #DD0000">"/splaat/building_series/chapter_14_services/"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">span</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Services</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">span</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">li</span><span style="color: #007700">&gt;</span>
</code></div><p>
</p>
<p>
You can download the entire updated template here: <a href="http://www.boyink.com/images/blog/chapter_14_main_nav.txt">chapter_14_main_nav.txt</a>
</p>
<p>
With that change saved you should be able to refresh your site and get the main nav to light up, and be connected.
</p>
<p>
Here is the link to my copy of the updated project site: <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fbuilding_series%2Fchapter_14_services%2F">Chapter 14 Services</a>.
</p>
<p>
Next up&#8212;we&#8217;ll modify the Products section to show related services for each product category.
</p>
<p>
Back to <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fcomments%2Fbuilding-an-expressionengine-site-chapter-13%2F%2F">Chapter 13</a>
<br />
On to <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fcomments%2Fbuilding-an-expressionengine-site-chapter-15%2F%2F">Chapter 15</a>
</p>]]></description>
      <dc:subject>building&#45;an&#45;expression&#45;engine&#45;site, expression&#45;engine</dc:subject>
      <dc:date>2007-11-28T14:41:00-05:00</dc:date>
    </item>

    <item>
      <title>Building an ExpressionEngine Site &#45; Chapter 13</title>
      <link>http://www.boyink.com/splaat/comments/building-an-expressionengine-site-chapter-13/</link>
      <guid>http://www.boyink.com/splaat/comments/building-an-expressionengine-site-chapter-13/#When:17:03:00Z</guid>
      <description><![CDATA[<p>Using a a plethora of plugins to make content management easier.
</p><p>In this chapter of the Building an <a href="http://www.expressionengine.com/index.php?affiliate=boyink">ExpressionEngine</a> Site series, we will develop the right-column listing of &#8220;Latest Products&#8221;.&nbsp; This is a spot where using a couple plugins will help negate the need for additional content fields for site admins to enter and maintain.
</p><p>OK - so way back in <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fcomments%2Fbuilding-an-expressionengine-site-chapter-2%2F">Chapter 2</a> of this series we created an embedded template for the right-column listing of &#8220;Latest Products&#8221;, and it&#8217;s just been sitting there with static placeholder content in it.&nbsp; Now that we have our Products section implemented all the necessary content is in place, we just need to re-coded that embedded template to now pull content from the &#8220;bees_products&#8221; weblog dynamically.&nbsp; Once it&#8217;s working, the product content will immediately appear on all of our content pages because all of them have that template embedded&#8212;definitely one of those moments where using a embedded templates will shine.
</p>
<p>
<b>Template Requirements</b>
<br />
So let&#8217;s take a look at what&#8217;s going on in that Latest Products section (view the site from <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.boyink.com%2Fsplaat%2Fbuilding_series%2Fchapter_12_index%2F">Chapter 12</a>).&nbsp; For each product there is a small thumbnail and a blurb of text.&nbsp; Well, cool - we have both of those already in the Products weblog as product_thumbnail and product_description fields.
</p>
<p>
Hold on though.&nbsp; 
</p>
<p>
Our thumbnails are all currently 150px by 112px - quite a bit larger than the 59px x 54px thumbnails currently specified in the Latest Products code.&nbsp; And - our descriptions are quite a bit longer than we really want in this right-column space as well.
</p>
<p>
What to do?
</p>
<p>
One option would be to create two additional fields in the &#8220;bees_products&#8221; custom field group - one for a smaller thumbnail and another for a short description.&nbsp; Those fields could then be used in the Latest Products embedded template.
</p>
<p>
Workable, but that approach would increase the content required for each entry.&nbsp; You would also have to train a content admin to know what fields show where on the site, and rely on them to create the thumbnails in each size correctly.&nbsp; Overall - not an elegant solution - especially when the necessary content is already in ExpressionEngine, just not quite formatted to our liking.
</p>
<p>
The second option?
</p>
<p>
<b>Plugins to the Rescue</b>
<br />
Yes - it&#8217;s a good spot to use some plugins to extend the functionality of &#8220;out of the box&#8221; ExpressionEngine.&nbsp; If you haven&#8217;t yet browsed the <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdownloads%2Faddons%2Fcategory%2Fplugins%2F">EE Plugin Library</a> now is a good time to do so.&nbsp; For our purposes today we&#8217;ll need two plugins from the library:<ul>
<li><a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdownloads%2Fdetails%2Fword_limiter%2F">Word Limiter</a></li>
<li><a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdownloads%2Fdetails%2Fhtml_strip%2F">HTML Strip</a></li>
</ul>
<p>
We&#8217;ll also be using a relatively new plugin that I noted recently in the EE forums - the <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.lumis.com%2Fsite%2Fpage%2Fimgsizer%2F">Image Resizer</a> published by user <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fexpressionengine.com%2Fforums%2Fmember%2F22429%2F">Lumis</a> (Lumis I&#8217;ll gladly credit you by proper name if you want...).
</p>
<p>
<b>Installing Plugins using the Plugin Manager</b>
<br />
There are two basic ways to install plugins - using the <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.expressionengine.com%2Findex.php%3Faffiliate%3Dboyink%26page%3D%2Fdocs%2Fcp%2Fadmin%2Futilities%2Fplugin_manager.html">Plugin Manager</a>, and not using the Plugin Manager.&nbsp; 
</p>
<p>
Since the first two plugs we need are available in the EE library, you should be able to install them via the manager.&nbsp; Note: This assumes you have entered your EE license number in the Control Panel under: CP Home  >  Admin  >  System Preferences  >  General Configuration.&nbsp; If the license has not been entered, the list of available plugins will not appear when you browse to the Plugin Manager at CP Home  >  Admin  >  Utilities  >  Plugin Manager will not appear in the right column. To proceed you can either enter your license number, or install all three plugins via the second method using FTP.
</p>
<p>
OK - if the Plugin Manager shows (and neither the HTML Strip or Word Limit plugin is already installed), simply browse the list of available plugins until you find both of these and click the &#8220;Install&#8221; link.&nbsp; The plugin should install and then appear under the left-column list of installed plugins.
</p>
<p>
<b>Installing Plugins without the Plugin Manager</b>
<br />
Regardless of how you installed the first two plugins, you&#8217;ll need to install the Image Resizer plugin using the approach because it&#8217;s not&#8212;as of this writing - offered via the EE plugin library.&nbsp; To install this plugin:<ul>
<li>Visit the <a href="http://www.boyink.com/splaat?URL=http%3A%2F%2Fwww.lumis.com%2Fsite%2Fpage%2Fimgsizer%2F">author&#8217;s site</a> and download the plugin.</li>
<li>Unzip the archive file to extract the plugin file</li>
<li>Using FTP, upload the plugin file to your site.&nbsp; It needs to go in the plugins folder, which is located in your EE system directory.</li>
<li>The new plugin should now show in the installed list on the Plugin Manager page in your Control Panel</li>
</ul>
<p>
<b>Using Plugins</b>
<br />
OK, now what?
</p>
<p>
By installing plugins, you now have some additional tags you can use in your templates.&nbsp; You can usually get details of the plugins-specific tags and parameters by clicking it&#8217;s title in the Plugin Manager page.&nbsp; I&#8217;ll let you explore the different parameters of these specific plugins on your own, and just show you how I&#8217;ve used them here.
</p>
<p>
<b>Working up the Template</b>
<br />
OK - we could just jump to the finished product, but let&#8217;s take this in steps so can see the logic of using the plugins.
</p>
<p>
First-up - the template with no plugins, using our existing content.
</p>
<p>
Here&#8217;s the code - the weblog:entries tag will stay the same through all of these examples and is pretty straightforward. Limiting to 3 will get us the last 3 products entered, all unnecessary data is disabled for performance, and the dynamic="off" will ensure the last 3 products will appear no matter what page this code is rendered on.
<br />
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Latest Products</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">div </span><span style="color: #007700">class=</span><span style="color: #DD0000">"lcontent"</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 weblog</span><span style="color: #007700">=</span><span style="color: #DD0000">"bees_products" </span><span style="color: #0000BB">limit</span><span style="color: #007700">=</span><span style="color: #DD0000">"3" </span><span style="color: #0000BB">disable</span><span style="color: #007700">=</span><span style="color: #DD0000">"categories|pagination|trackbacks|member_data" </span><span style="color: #0000BB">dynamic</span><span style="color: #007700">=</span><span style="color: #DD0000">"off"</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">p</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 href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;url_title_path=building_series/chapter_13_product_detail&#125;"</span><span style="color: #007700">&gt;&lt;</span><span style="color: #0000BB">img src</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;product_thumbnail&#125;"</span><span style="color: #007700">/&gt;&lt;/</span><span style="color: #0000BB">a</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">strong</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">strong</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#123;product_description&#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 href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;url_title_path=building_series/chapter_13_product_detail&#125;"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">more </span><span style="color: #007700">&gt;&gt;&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">p</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">div</span><span style="color: #007700">&gt;</span>
</code></div><p>
And here&#8217;s the result.&nbsp; It&#8217;s usable, but not as nice as the original template styling:
<br />
<a href="http://www.boyink.com/images/blog/latest_products_1_thumb.jpg" onclick="window.open('http://www.boyink.com/images/blog/latest_products_1.jpg','popup','width=230,height=1059,scrollbars=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.boyink.com/images/blog/latest_products_1_thumb.jpg" width="41" height="200" /></a>
<br />
<div style="clear:both;"><p></div>
</p>
<p>
OK - let&#8217;s tackle that thumbnail size first.&nbsp; Here&#8217;s the code modified to use the image sizer plugin.&nbsp; You can see I&#8217;ve specified a fixed height of 54px, and the plugin will resize the image to the correct width dynamically:
<br />
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Latest Products</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">div </span><span style="color: #007700">class=</span><span style="color: #DD0000">"lcontent"</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 weblog</span><span style="color: #007700">=</span><span style="color: #DD0000">"bees_products" </span><span style="color: #0000BB">limit</span><span style="color: #007700">=</span><span style="color: #DD0000">"3" </span><span style="color: #0000BB">disable</span><span style="color: #007700">=</span><span style="color: #DD0000">"categories|pagination|trackbacks|member_data" </span><span style="color: #0000BB">dynamic</span><span style="color: #007700">=</span><span style="color: #DD0000">"off"</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">p</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 href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;url_title_path=building_series/chapter_13_product_detail&#125;"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#123;exp</span><span style="color: #007700">:</span><span style="color: #0000BB">imgsizer</span><span style="color: #007700">:</span><span style="color: #0000BB">size src</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;product_thumbnail&#125;" </span><span style="color: #0000BB">height</span><span style="color: #007700">=</span><span style="color: #DD0000">"54" </span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;title&#125;"</span><span style="color: #0000BB">&#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;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">strong</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">strong</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#123;product_description&#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 href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;url_title_path=building_series/chapter_13_product_detail&#125;"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">more </span><span style="color: #007700">&gt;&gt;&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">p</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">div</span><span style="color: #007700">&gt;</span>
</code></div><p>
</p>
<p>
And here&#8217;s the result.&nbsp; Our images look better, but our text spacing is still off:
<br />
<a href="http://www.boyink.com/images/blog/latest_products_2_thumb.jpg" onclick="window.open('http://www.boyink.com/images/blog/latest_products_2.jpg','popup','width=229,height=757,scrollbars=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.boyink.com/images/blog/latest_products_2_thumb.jpg" width="57" height="200" /></a>
<br />
<div style="clear:both;"></p></div>

<p>
If you do a view/source and look at the rendered code, you&#8217;ll see that our main culprit is paragraph tags.&nbsp; The product_description field is set to be formatted as XHTML - so that returns one set of P tags.&nbsp; The template is also providing P tags - wanting to wrap each product&#8217;s image and text in one paragraph.&nbsp; So let&#8217;s use the HTML Strip plug-in to remove the P tags from the product description field for round three:
</p>
<p>
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Latest Products</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">div </span><span style="color: #007700">class=</span><span style="color: #DD0000">"lcontent"</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 weblog</span><span style="color: #007700">=</span><span style="color: #DD0000">"bees_products" </span><span style="color: #0000BB">limit</span><span style="color: #007700">=</span><span style="color: #DD0000">"3" </span><span style="color: #0000BB">disable</span><span style="color: #007700">=</span><span style="color: #DD0000">"categories|pagination|trackbacks|member_data" </span><span style="color: #0000BB">dynamic</span><span style="color: #007700">=</span><span style="color: #DD0000">"off"</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">p</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 href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;url_title_path=building_series/chapter_13_product_detail&#125;"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#123;exp</span><span style="color: #007700">:</span><span style="color: #0000BB">imgsizer</span><span style="color: #007700">:</span><span style="color: #0000BB">size src</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;product_thumbnail&#125;" </span><span style="color: #0000BB">height</span><span style="color: #007700">=</span><span style="color: #DD0000">"54" </span><span style="color: #0000BB">alt</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;title&#125;"</span><span style="color: #0000BB">&#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;&nbsp;&nbsp;&nbsp;&nbsp;&lt;</span><span style="color: #0000BB">strong</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">strong</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">&#123;exp</span><span style="color: #007700">:</span><span style="color: #0000BB">html_strip&#125;&#123;product_description&#125;&#123;</span><span style="color: #007700">/</span><span style="color: #0000BB">exp</span><span style="color: #007700">:</span><span style="color: #0000BB">html_strip&#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 href</span><span style="color: #007700">=</span><span style="color: #DD0000">"&#123;url_title_path=building_series/chapter_13_product_detail&#125;"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">more </span><span style="color: #007700">&gt;&gt;&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">p</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">div</span><span style="color: #007700">&gt;</span>
</code></div><p>
</p>
<p>
And here&#8217;s the result:
<br />
<a href="http://www.boyink.com/images/blog/latest_products_3_thumb.jpg" onclick="window.open('http://www.boyink.com/images/blog/latest_products_3.jpg','popup','width=230,height=721,scrollbars=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"><img src="http://www.boyink.com/images/blog/latest_products_3_thumb.jpg" width="60" height="200" /></a>
<br />
<div style="clear:both;"></div>
</p>
<p>
Much better - no nested P tags coming out now.&nbsp; But - some of those descriptions are long for that space. Let&#8217;s use the the word_limit plugin to truncate those down.&nbsp; Here&#8217;s the new code - note that you can nest plugins for the desired results:
</p>
<p>
</p><div class="codeblock"><code>
<span style="color: #007700">&lt;</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Latest Products</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">h3</span><span style="color: #007700">&gt;<br />&lt;</span><span style="color: #0000BB">div </span><span style="color: #007700">class=</span><span style="color: #DD0000">"lcontent"</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&#