<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chris Antoine &#187; Web Development</title>
	<atom:link href="http://www.chrisantoine.com/category/webdevelopment/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chrisantoine.com</link>
	<description>PHP / MySQL / JavaScript / Ajax Development.</description>
	<lastBuildDate>Fri, 13 Nov 2009 03:11:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Prettier Accessible Forms with Zend Form and Zend Config</title>
		<link>http://www.chrisantoine.com/2008/07/15/prettier-accessible-forms-with-zend-form-and-zend-config/</link>
		<comments>http://www.chrisantoine.com/2008/07/15/prettier-accessible-forms-with-zend-form-and-zend-config/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 04:23:10 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Prettier Accessible Forms]]></category>
		<category><![CDATA[Zend Config]]></category>
		<category><![CDATA[Zend Form]]></category>

		<guid isPermaLink="false">http://www.chrisantoine.net/?p=22</guid>
		<description><![CDATA[When I first started working with Zend Framework and showed a designer the output from Zend Form we had a few days of conversations back and forth and researched on whether or not the dl/dt setup was going to be sufficient for what we wanted and also &#8220;correct usage&#8221;. While working through our first project [...]]]></description>
			<content:encoded><![CDATA[<p>When I first started working with <a title="Zend Framework" href="http://framework.zend.com" target="_blank">Zend Framework</a> and showed a designer the output from <a title="Zend Form" href="http://framework.zend.com/manual/en/zend.form.html" target="_blank">Zend Form</a> we had a few days of conversations back and forth and researched on whether or not the dl/dt setup was going to be sufficient for what we wanted and also &#8220;correct usage&#8221;.</p>
<p>While working through our first project we ran into issues with this structure of forms.  I didn&#8217;t run into any problems but in order to stop the complaints from the designers in our office I decided to work on getting <a title="Zend Form" href="http://framework.zend.com/manual/en/zend.form.html" target="_blank">Zend Form</a> to generate forms in the style laid out at <a title="Prettier Accessible Forms" href="http://www.alistapart.com/articles/prettyaccessibleforms" target="_blank">A List Apart.</a></p>
<p>I didn&#8217;t figure this would really be all that difficult because most of the documentation for <a title="Zend Framework" href="http://framework.zend.com" target="_blank">Zend Framework</a> fairly good.  Little did I know that the documentation and examples for <a title="Zend Form" href="http://framework.zend.com/manual/en/zend.form.html" target="_blank">Zend Form</a> with <a title="Zend Config" href="http://framework.zend.com/manual/en/zend.config.html" target="_blank">Zend Config</a> were fairly hard to find.  When I did find documentation the decorators stilled confused me for a while.  Then everything just seemed to click one day and I was successful in getting exactly what I wanted.  Now I don&#8217;t have designers complaining anymore because they have forms structured exactly the way they want(Sorry Rob <img src='http://www.chrisantoine.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ).  In order to get the results I wanted I ended up with a form defined in my ini file like the following:</p>
<pre>[signInForm]
form.id = "signInForm"
form.method = "post"
form.action = "/sign-in/"

; Form Decorators
form.disableLoadDefaultDecorators = true
form.decorators.formElements.decorator = "FormElements"
form.decorators.description.decorator = "Description"
form.decorators.form.decorator = "Form"

; Global Element Decorators
form.elementDecorators.decorator = "ViewHelper"
form.elementDecorators.error.decorator = "Errors"
form.elementDecorators.description.decorator = "Description"
form.elementDecorators.label.decorator = "Label"
form.elementDecorators.formElements.decorator = "HtmlTag"
form.elementDecorators.formElements.options.tag = "li"

; Group Decorators
form.displayGroupDecorators.decorator = "FormElements"
form.displayGroupDecorators.formElements.decorator = "HtmlTag"
form.displayGroupDecorators.formElements.options.tag = "ol"
form.displayGroupDecorators.fieldset.decorator = "Fieldset"

; Form Groups
form.displayGroups.signinGroup.elements.username    = "username"
form.displayGroups.signinGroup.elements.password    = "password"
form.displayGroups.signinGroup.elements.rememberMe  = "rememberMe"

form.displayGroups.submitGroup.elements.submit = "submit"

; username element
form.elements.username.type = "text"
form.elements.username.options.validators.notempty.validator = "NotEmpty"
form.elements.username.options.validators.notempty.breakChainOnFailure = true
form.elements.username.options.validators.strlen.validator = "StringLength"
form.elements.username.options.validators.strlen.options.min = 6
form.elements.username.options.validators.strlen.options.max = 20
form.elements.username.options.required = true
form.elements.username.options.label = "Username:"

; password element
form.elements.password.type ="password"
form.elements.password.options.validators.notempty.validator = "NotEmpty"
form.elements.password.options.validators.notempty.breakChainOnFailure = true
form.elements.password.options.validators.strlen.validator = "StringLength"
form.elements.password.options.validators.strlen.options.min = "6"
form.elements.password.options.required = true
form.elements.password.options.label = "Password:"

; remember me element
form.elements.rememberMe.type = "checkbox"
form.elements.rememberMe.options.label = "Remember Me?"

; login button element
form.elements.submit.type = "button"
form.elements.submit.options.name = "SignIn"
form.elements.submit.options.value = "Sign In"
form.elements.submit.options.label = "Sign In"</pre>
<p>I hope this helps someone else as I could not find a good solid example of how to get this working.  If anyone has any feedback on a better way of handling this let me know in the comments.<br />
Thanks,<br />
Chris</p>
<p>Update<br />
I updated &#8220;FieldSet&#8221; to &#8220;Fieldset&#8221; as that has changed since I wrote this post.  Thanks for the message about the error!<br />
Chris</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisantoine.com/2008/07/15/prettier-accessible-forms-with-zend-form-and-zend-config/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>UniqueField Validate Helper</title>
		<link>http://www.chrisantoine.com/2008/07/14/uniquefield-validate-helper/</link>
		<comments>http://www.chrisantoine.com/2008/07/14/uniquefield-validate-helper/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 03:56:30 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Helpers]]></category>
		<category><![CDATA[Validate Helper]]></category>

		<guid isPermaLink="false">http://www.chrisantoine.net/?p=21</guid>
		<description><![CDATA[The last 4 projects that I have created I have built using Zend Framework. The more I use it the more I find things that make my life easier. My first shot at creating a validator was for checking whether or not a username is unique. . I need this functionality in pretty much every [...]]]></description>
			<content:encoded><![CDATA[<p>The last 4 projects that I have created I have built using Zend Framework.  The more I use it the more I find things that make my life easier.  My first shot at creating a validator was for checking whether or not a username is unique.  .  I need this functionality in pretty much every application I build.  I realized while writing the same code again(more or less a copy and paste but still <img src='http://www.chrisantoine.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ) in the 3 or 4th project that I should take advantage of the custom validators that I had read about but hadn&#8217;t tackled.</p>
<p>The following is probably revision 2 of the original idea.  I realized after writing it the first time I should have made it more generic so I could use it on multiple fields without changing anything except the properties in the config ini for each form field.</p>
<p>To add the validator to a field using Zend Config you would do the following:</p>
<pre>
        form.elements.email.options.validators.uniqueField.validator = "uniqueField"
        form.elements.email.options.validators.uniqueField.options.modelName = "Notification"
        form.elements.email.options.validators.uniqueField.options.fieldname = "notification_email"
</pre>
<pre>
<code class="php">
< ?php
class Robyn_Validate_UniqueField extends Zend_Validate_Abstract
{
    /**
     * @var String
     */
    const NOT_UNIQUE = 'error';

    /**
     * @var String
     */
    protected $_modelName = 'User';

    /**
     * @var String
     */
    protected $_fieldName = 'user_username';

    /**
     * @var array
     */
    protected $_messageTemplates = array(
                                         self::NOT_UNIQUE => 'The data given is not unique.'
                                         );

    /**
     * Sets validator options
     *
     * @param  string $modelName
     * @param  string $fieldName
     * @return void
     */
    public function __construct($modelName = 'User', $fieldName = 'user_username')
    {
        $this->setModelName($modelName);
        $this->setFieldName($fieldName);
    }

    /**
     * Defined by Zend_Validate_Interface
     *
     * Returns true if and only if the email address is found to NOT have a match in the fieldname in the model specified
     *
     * @param Array $value
     * @param Array $request
     * @return boolean
     */
    public function isValid($value, $request = null)
    {
        // Set the value
        $value = (string) $value;
        $this->_setValue($value);

        // Get our model and do a search for that username
        $table = new $this->_modelName();
        $result = $table->fetchAll($table->select()->where($this->_fieldName . ' = ?', $value))->toArray();

        // Check to see if we got any results
        if (count($result) == 0) {
            return true;
        }

        $this->_error(self::NOT_UNIQUE);
        return false;
    }

    /**
     * Set the model name.
     *
     * @param string $modelName
     * @return Zend_Validate_UniqueUsername Provides a fluent interface
     */
    public function setModelName($modelName)
    {
        $this->_modelName = $modelName;

        return $this;
    }

    /**
     * Set the field name.
     *
     * @param string $fieldName
     * @return Zend_Validate_UniqueUsername Provides a fluent interface
     */
    public function setFieldName($fieldName)
    {
        $this->_fieldName = $fieldName;

        return $this;
    }
}
</code>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisantoine.com/2008/07/14/uniquefield-validate-helper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend History Action Helper(Codeutopia)</title>
		<link>http://www.chrisantoine.com/2008/07/14/zend-history-action-helpercodeutopia/</link>
		<comments>http://www.chrisantoine.com/2008/07/14/zend-history-action-helpercodeutopia/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 03:42:31 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.chrisantoine.net/?p=17</guid>
		<description><![CDATA[Back a few weeks ago I came across a very handy Zend Framework Helper for tracking a user’s browsing history(here).  I was needing something very similar for a project I was working on, actually I need it for most projects I work on.  While implementing it I noticed there were some things that I wanted [...]]]></description>
			<content:encoded><![CDATA[<p>Back a few weeks ago I came across a very handy <a title="Zend Framework Helpers" onclick="javascript:pageTracker._trackPageview ('/outbound/framework.zend.com');" href="http://framework.zend.com/manual/en/zend.controller.actionhelpers.html" target="_blank">Zend Framework Helper</a> for tracking a user’s browsing history(<a title="Codeutopia" onclick="javascript:pageTracker._trackPageview ('/outbound/codeutopia.net');" href="http://codeutopia.net/blog/2008/03/07/tracking-the-users-browsing-history-with-php/" target="_blank">here</a>).  I was needing something very similar for a project I was working on, actually I need it for most projects I work on.  While implementing it I noticed there were some things that I wanted to modify in order to get the true functionality I needed.</p>
<p>The modifications were pretty basic in that the code was tracking ALL requests and there are a few requests that I did not want to track(namely Ajax and page reloads).  By not tracking these requests I feel I get a much more accurate representation of the path the user is following through the application.  The one thing I am still yet to conquer is how to find out if a requests is triggering a 404 page and if so to not track it.  I’m not sure that it is even possible because of when the helper is triggered but I haven’t delved very deep either(just something I want to put in at some point but if you know how let me know in the comments).So without further ado the code:</p>
<pre>
<code class="php">
&lt;?php
Zend_Loader::loadClass('Zend_Controller_Action_Helper_Abstract');
Zend_Loader::loadClass('Zend_Controller_Action_HelperBroker');
Zend_Loader::loadClass('Zend_Session_Namespace');
/**
* This helper tracks the user's browsing history
*
* @copyright 2008 Jani Hartikainen &lt;www.codeutopia.net&gt;
* @author Jani Hartikainen &lt;firstname at codeutopia net&gt;
* @author Chris Antoine &lt;chris@spinweb.net&gt;(Modifications)
*/
class SoulOpinion_Action_Helper_History extends Zend_Controller_Action_Helper_Abstract
{
/**
* @var Zend_Session_Namespace
*/
private $_namespace;

/**
* How many history URLs to track?
*
* @var int
*/
private $_trackAmount = 0;

/**
* Track Ajax Requests?
*
* @var int
*/
private $_ajax = 0;

/**
* Current URL
*
* @var string
*/
private $_currentUrl = null;

/**
* @param int $trackAmount [optional] How many history URLs to track
*/
public function __construct($trackAmount = 5)
{
$this-&gt;setTrackAmount($trackAmount);

$this-&gt;_initSession();
}

/**
* Initialize the history from session
*/
private function _initSession()
{
$this-&gt;_namespace = new Zend_Session_Namespace('Zend_Controller_Action_Helper_History');

// Break out if we don't want to track the request
if ($this-&gt;trackableRequest() == false) {
return true;
}

if (!is_array($this-&gt;_namespace-&gt;history)) {
$this-&gt;_namespace-&gt;history = array();

if(!empty($_SERVER['HTTP_REFERER'])) {
array_unshift($this-&gt;_namespace-&gt;history, $_SERVER['HTTP_REFERER']);
}
} else {
array_splice($this-&gt;_namespace-&gt;history, $this-&gt;_trackAmount);
}
}

public function preDispatch()
{
$urlHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('Url');
$this-&gt;_currentUrl = $urlHelper-&gt;url();

// Break out if we don't want to track the request
if ($this-&gt;trackableRequest() == false) {
return true;
}

if (!is_array($this-&gt;_namespace-&gt;history)) {
$this-&gt;_namespace-&gt;history = array();
}

array_unshift($this-&gt;_namespace-&gt;history, $this-&gt;_currentUrl);
}

/**
* Set how many history URLs to track
*
* @param int $trackAmount
*/
public function setTrackAmount($trackAmount)
{
$this-&gt;_trackAmount = $trackAmount;
}

/**
* Redirects the browser back in history
*
* @param int $amount How many URLs to go back
*/
public function goBack($amount = 1)
{
Zend_Controller_Action_HelperBroker::getStaticHelper('Redirector')
-&gt;setPrependBase(false)
-&gt;gotoUrl($this-&gt;_namespace-&gt;history[$amount]);
}

/**
* Returns an URL from history
*
* @param int $amount How many URLs to go back
* @return string
*/
public function getPreviousUrl($amount = 1)
{
return $this-&gt;_namespace-&gt;history[$amount];
}

/**
* Return all previous URLs
*
* @return array
*/
public function getArray()
{
return $this-&gt;_namespace-&gt;history;
}

public function getName()
{
return 'History';
}

/**
* Validate that we want to track the request
*
* @return Boolean
*/
private function trackableRequest()
{
// Decide whether or not we should track Ajax Requests
if ($this-&gt;_ajax == 0) {
Zend_Loader::loadClass('Zend_Controller_Request_Http');
$request = new Zend_Controller_Request_Http();

if ($request-&gt;isXmlHttpRequest()) {
return false;
}
}

// Now we are going to verify the user didn't just reload the page or click the same link.
// No reason to track page reloads.
if ($this-&gt;_currentUrl == $this-&gt;_namespace-&gt;history[0]) {
return false;
}

// Need to come up with a way to check for a 404 error so we don't track bad requests.

return true;
}
}
</code>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisantoine.com/2008/07/14/zend-history-action-helpercodeutopia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Coding Standards</title>
		<link>http://www.chrisantoine.com/2008/05/07/zend-coding-standards/</link>
		<comments>http://www.chrisantoine.com/2008/05/07/zend-coding-standards/#comments</comments>
		<pubDate>Thu, 08 May 2008 01:25:16 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Coding Standards]]></category>
		<category><![CDATA[Zend]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.chrisantoine.net/?p=15</guid>
		<description><![CDATA[I&#8217;ve always adhered to my own &#8220;standards&#8221; when writing code but once I started working more with other developers I realized that we didn&#8217;t agree on what the &#8220;right&#8221; way of writing code was. Most of it was just simple things like does the curly brace go on the same line or on the next [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always adhered to my own &#8220;standards&#8221; when writing code but once I started working more with other developers I realized that we didn&#8217;t agree on what the &#8220;right&#8221; way of writing code was.  Most of it was just simple things like does the curly brace go on the same line or on the next line.  At <a title="SpinWeb, Inc." href="http://www.spinweb.net" target="_blank">SpinWeb</a> we have had coding standards in place for a while.  We all kinda loosely followed the standards because they were in place pretty much before we got there and they didn&#8217;t fit with how each of us felt.</p>
<p>While looking at using the <a title="Zend Framework" href="http://framework.zend.com" target="_blank">Zend Framework</a> for our work at <a title="SpinWeb, Inc." href="http://www.spinweb.net" target="_blank">SpinWeb</a> I came across the coding standards and realized there are a lot of benefits to having someone else set the standards.  Just one example is there are less discussions on the &#8220;right&#8221; way and we can make small modifications if we all agree but otherwise we just live with the <a title="Zend Framework Coding Standards" href="http://framework.zend.com/manual/en/coding-standard.html" target="_blank">standards</a> that Zend has laid out.</p>
<p>What I have come realize is that even while I was always trying to follow my own standards I would always stretch them when I was in a hurry or something else had my attention and since they were my own standards it wasn&#8217;t that big of a deal[for some reason].  I&#8217;ve been doing my best to follow the <a title="Zend Coding Standards" href="http://framework.zend.com/manual/en/coding-standard.html" target="_blank">Zend Coding Standards</a> for a couple months now and everything has really become habit and I find myself really pushing myself more and more to follow the standards.</p>
<p>If you run into the same types of issues or just want more &#8220;official&#8221; standards Zend has a nice start.</p>
<p><a title="Zend Coding Standards" href="http://framework.zend.com/manual/en/coding-standard.html" target="_blank">Zend Coding Standard</a><br />
<a title="Zend Framework" href="http://framework.zend.com" target="_blank">Zend Framework</a><br />
<a title="SpinWeb, Inc." href="http://www.spinweb.net" target="_blank">SpinWeb, Inc.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisantoine.com/2008/05/07/zend-coding-standards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript print_r()</title>
		<link>http://www.chrisantoine.com/2008/05/02/javascript-print_r/</link>
		<comments>http://www.chrisantoine.com/2008/05/02/javascript-print_r/#comments</comments>
		<pubDate>Sat, 03 May 2008 00:23:42 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[print_r]]></category>

		<guid isPermaLink="false">http://www.chrisantoine.net/?p=18</guid>
		<description><![CDATA[If you are anything like me I constantly fight with having an object/array in JS and I want to see what all of its properties are. I ran into this the other day and decided to actually find a solution to the problem of not knowing what properties there are for an event. While doing [...]]]></description>
			<content:encoded><![CDATA[<p>If you are anything like me I constantly fight with having an object/array in JS and I want to see what all of its properties are.  I ran into this the other day and decided to actually find a solution to the problem of not knowing what properties there are for an event.  While doing some searching I came across <a title="brandnewbox.co.uk" href="http://www.brandnewbox.co.uk/logbook/article/a_print_r_equivalent_for_javascript/" target="_blank">this</a> site.  It has been a great solution to what I needed.  The code is as follows:</p>
<pre>   <code class="javascript">
function print_r(theObj){
   if(theObj.constructor == Array || theObj.constructor == Object){
      document.write("&lt;ul&gt;")
      for(var p in theObj){
         if(theObj[p].constructor == Array || theObj[p].constructor == Object){
            document.write("&lt;li&gt;["+p+"] => "+typeof(theObj)+"&lt;/li&gt;");
            document.write("&lt;ul&gt;")
            print_r(theObj[p]);
            document.write("&lt;/ul&gt;")
         } else {
            document.write("&lt;li&gt;["+p+"] => "+theObj[p]+"&lt;/li&gt;");
         }
      }
      document.write("&lt;/ul&gt;")
   }
}
 </code></pre>
<p>Its a pretty simple little snippet of code but was VERY handy for me while troubleshooting an event problem and having to deal with each individual browser as each of them have different event properties.  Hope it helps someone else.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisantoine.com/2008/05/02/javascript-print_r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using WordPress Excerpts &#8211; &#8220;Read More&#8221;</title>
		<link>http://www.chrisantoine.com/2008/04/02/using-wordpress-excerpts-read-more/</link>
		<comments>http://www.chrisantoine.com/2008/04/02/using-wordpress-excerpts-read-more/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 16:52:33 +0000</pubDate>
		<dc:creator>Jeff Rothe</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.chrisantoine.net/?p=6</guid>
		<description><![CDATA[I got asked this question today; I’d like my postings to be condensed with some type of “Read More” link at the bottom to expand them for reading Having an additional link to &#8220;read more&#8221; in your WordPress posting is a great idea for a couple of reasons. The first reason is a matter of [...]]]></description>
			<content:encoded><![CDATA[<p>I got asked this question today;</p>
<blockquote><p>I’d like my postings to be condensed with some type of “Read More” link at the bottom to expand them for reading</p></blockquote>
<p>Having an additional link to &#8220;read more&#8221; in your WordPress posting is a great idea for a couple of reasons.</p>
<p><strong>The first reason is a matter of preference.</strong> By default, WordPress will use the built in function of &#8220;the_content&#8221;, which is located in at least one file in your default theme directory, the homepage file which is the &#8220;index.php&#8221; file.  What this means is that WordPress will show full posts, with the title being a link to the full post in the &#8220;single.php&#8221; where a user can comment on your post and see other additional information.  If you don&#8217;t make any to the default theme, WordPress will show something like 10 posts on your homepage, and depending on your ability to write concisely:) you can have a long scrolling page.  This is a preference, some people don&#8217;t mind this, others really don&#8217;t like it at all.</p>
<p><strong>The second reason, and the more important reason for having &#8220;excerpts&#8221; is for search engine reasons.</strong> Google doesn&#8217;t like duplicate content, within a site, or one website that has plagerized another.  You have the possibility of being black listed for blantant obvious violations.  So, using the power of having an &#8220;excerpt&#8221; allows you to either write a custom hook for your homepage to lure in readers to the article, or you can just insert a tag to use a portion of the already written post as the hook.</p>
<h3>How to change your theme to use excerpts</h3>
<p>Again, in the post gui, you have a &#8220;more&#8221; button that you can insert some text called &#8220;<span id="more-6"></span>&#8221; and this will automatically cut off your post and make an excerpt for you.  But, if you would like to option to not have to remember to add that snippet of code every time you post, and have the excerpts happen automatically, you set that up by modifying your theme. Open up your index.php file in your default theme folder and look at approximately line 14 where you will see this code inside the php tags;</p>
<p><strong>php the_content(&#8216;Read the rest of this entry »&#8217;);</strong></p>
<p>Change that line to read this instead;</p>
<p><strong>php the_excerpt();</strong></p>
<p>More information about this template tag / function / class or whatever you want to call it:) is located in the <a href="http://codex.wordpress.org/Template_Tags/the_excerpt" target="_blank">WordPress codex on the_excerpt</a> (which is a programmers term for code manual).</p>
<h3>How I use excerpts on my blog</h3>
<p>I wasn&#8217;t satisfied with the fuction that the WordPress developers provide.  The problem I had with the_excerpt, is that it strips html.  So your posts will look like a non-formatted, run on mess.  I felt like strongly about being as customizable as possible, and frankly, more professional as a designer.  I don&#8217;t know much about php, so I wouldn&#8217;t be able to hack the core code.  Besides, I wouldn&#8217;t want to, because my changes would have to ported over each time I upgraded my version of WordPress.</p>
<p>So, I found a great little plugin for WordPress that allows me to format my excerpts all I like.  It&#8217;s called <a href="http://robsnotebook.com/the-excerpt-reloaded/" target="_blank">The Excerpt Reloaded</a>, and it let&#8217;s you set a ton of options like excerpt length, the name of your &#8220;read more&#8221; link, the allowed html in the excerpt and more.</p>
<p>Here is a screenshot from Rotheblog showing how I have been able to use both div&#8217;s and images and other formatting in my excerpts to make the hook for the post really appealing;</p>
<div class="centerBorder"><img src="/wp-content/uploads/2009/11/excerptreload_screen.jpg" alt="The Excerpt Reloaded Configured Screen" /></div>
<p>Make sure to use version R1.4, and not R1.1.  Version R1.1 had issues where it wouldn&#8217;t close the allowed tags which would then close a tag in the layout of the site and break the visual look.  Fortunately another developer took over and made those changes, but you will want to look at the <a href="http://guff.szub.net/2005/02/26/the_excerpt-reloaded/" target="_blank">original Excerpt Reloaded page</a> to see all the template tag parameters for setting up your excerpt.</p>
<h5>Questions? Comments?</h5>
<p>Leave a comment.  Has anyone modified the code base for WordPress to leverage the_excerpt template tag to do the same thing as the plugin?  I&#8217;d love to hear about it if you have.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chrisantoine.com/2008/04/02/using-wordpress-excerpts-read-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

