<?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>Jack McDade &#187; Development</title>
	<atom:link href="http://jackmcdade.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://jackmcdade.com</link>
	<description>Designer, Coder &#38; Strategerizer</description>
	<lastBuildDate>Thu, 03 Jun 2010 13:50:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Quickie ExpressionEngine Plugin: URI Prettify</title>
		<link>http://jackmcdade.com/quickie-expressionengine-plugin-uri-prettify/</link>
		<comments>http://jackmcdade.com/quickie-expressionengine-plugin-uri-prettify/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 17:23:12 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ExpressionEngine]]></category>
		<category><![CDATA[addons]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://jackmcdade.com/?p=299</guid>
		<description><![CDATA[wrote a plugin to take any string, such as {segment_3}, and strip out the "_" or "-" delimiters and set words to title case. Parameters exist to uncapitalize words such as "and", "for" and "the". Give it a try, it just might come in handy in a pinch.]]></description>
			<content:encoded><![CDATA[<p>I really don&#8217;t have a good place to post this stuff right now as a blog is hardly ideal for storing ExpressionEngine addons, but until I get my real site up, this will have to do.</p>
<p>I whipped up this little plugin because I kept getting pinned into a corner when using Categories. For example, if an entry is part of more than 1 category, Blue and Red as subgroups of a Colors parent group for instance, and you&#8217;d like to list all entries in the Red subcategory&#8230; well good luck.</p>
<pre class="html">
{categories limit=<span class="htmlAttributeValue">&quot;1&quot;</span>}{category_name}{/categories}</pre>
<p>This will give you &#8220;Colors&#8221;. Not what we&#8217;re going for. </p>
<pre class="html">
{categories limit=<span class="htmlAttributeValue">&quot;2&quot;</span> backspace=<span class="htmlAttributeValue">&#039;2&#039;</span>}{category_name} -{/categories}
</pre>
<p>Will give you &#8220;<strong>Colors &#8211; Red</strong>&#8220;, which will work, unless one of your entries is also in Blue. Since the categories are listed alphabetically, you end up with &#8220;<strong>Colors &#8211; Blue</strong>&#8221; even though your url is http://site.com/section/category/red&#8221;.</p>
<p>Well, why not just take the URI segment and case modify it to say &#8220;Red&#8221;? Easy enough, as long as your URI segments match the name. So I wrote a plugin to take any string, such as <strong>{segment_3}</strong>, and strip out the &#8220;_&#8221; or &#8220;-&#8221; delimiters and set words to title case. Parameters exist to uncapitalize words such as &#8220;and&#8221;, &#8220;for&#8221; and &#8220;the&#8221;. Give it a try, it just might come in handy in a pinch. Full documentation is in the plugin&#8217;s &#8220;Usage&#8221; area, which you can see in the Plugin Manager of your ExpressionEngine Control Panel, but here&#8217;s a quick example usage:</p>
<pre class="html">
<span class="htmlOtherTag">&lt;title&gt;</span>{site_name} | {exp:uri_prettify uncap_keywords=<span class="htmlAttributeValue">&quot;yes&quot;</span> keywords=<span class="htmlAttributeValue">&quot;and|to|the|milk&quot;</span>}{segment_1}{if segment_2} | {segment_2}{/if} {/exp:uri_prettify}<span class="htmlOtherTag">&lt;/title&gt;</span>
</pre>
<p>Download <a href="http://jackmcdade.com/addons/pi.uri_prettify_100.zip" target="_blank" onClick="pageTracker._trackEvent('Download', 'Addon', 'URI Prettify');">URI Prettify v1.0</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jackmcdade.com/quickie-expressionengine-plugin-uri-prettify/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Dealing with WYSIWYGs &#8211; Taming TinyMCE</title>
		<link>http://jackmcdade.com/dealing-with-wysiwygs-taming-tinymce/</link>
		<comments>http://jackmcdade.com/dealing-with-wysiwygs-taming-tinymce/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 04:06:55 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ExpressionEngine]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[TinyMCE]]></category>
		<category><![CDATA[wysiwyg]]></category>

		<guid isPermaLink="false">http://jackmcdade.com/?p=223</guid>
		<description><![CDATA[There are 2 main problems with the default install of TinyMCE. The first: it's ugly, bloated and unintuitive. The second: the code that might come out of it when clients take control. Let's get to work:]]></description>
			<content:encoded><![CDATA[<h2><em>&#8220;I hate most WYSIWYG editors. Why can&#8217;t they all be more like WordPress&#8217;s?&#8221;</em></h2>
<p>I&#8217;ve heard this, or something similar, many times. I&#8217;ve both thought it myself and said it aloud. It shouldn&#8217;t be hard, right? While designing and developing ExpressionEngine websites, i try to avoid implementing them at all costs. However, I&#8217;ve eventually had to spend enough time taming them that maybe we can be friends. Or at least not enemies. Oh and newsflash. WordPress uses TinyMCE. They also have over 650 lines of javascript customizing it, but hey, nothing is keeping you from making your own tweaks.</p>
<p>There are two big players on the WYSIWYG scene. FCKeditor and TinyMCE. I&#8217;ll be focusing in on the later in this article. If anyone else has insights on FCKeditor, please post them in the comments. There are plenty other small ones, including jWYSIWYG (which <a href="http://expressionengine.com/forums/viewthread/114787/" target="_blank">i ported to ExpressionEngine</a>, but i digress&#8230; it has it&#8217;s own issues). Also worth noting, there are two main ways of implementing TinyMCE in ExpressionEngine. <a href="http://leevigraham.com/cms-customisation/expressionengine/lg-tinymce/" target="_blank">Leevi Graham&#8217;s Extension</a>, and the <a href="http://expressionengine.com/downloads/details/tinymce/" target="_blank">1st party extension</a>.</p>
<h2>The Problem</h2>
<p>There are 2 main problems with the default install of TinyMCE. The first: it&#8217;s ugly, bloated and unintuitive. The second: the code that might come out of it when clients take control. Let&#8217;s get to work:</p>
<p>The first step is customizing which buttons and features (including plugins) are on loaded. How this is done can depend on where the javascript is loaded (the tinyMCE.init() function), but the method is the same regardless. Parameters can be added inside the function which control what&#8217;s being loaded. I&#8217;ll show you what i use myself and then I can walk through what&#8217;s going on:</p>
<h2>Where We&#8217;re Going:</h2>
<div id="attachment_251" class="wp-caption alignnone" style="width: 310px"><a href="http://jackmcdade.com/wp-content/uploads/2009/06/clean_mce.jpg" rel="shadowbox[post-223];player=img;"><img class="size-medium wp-image-251" title="clean_mce" src="http://jackmcdade.com/wp-content/uploads/2009/06/clean_mce-300x130.jpg" alt="clean_mce" width="300" height="130" /></a><p class="wp-caption-text">Clean TinyMCE</p></div>
<pre class="html">mode : &quot;textareas&quot;,
theme : &quot;advanced&quot;,
skin  : &quot;thebigreason&quot;,
plugins : &quot;fullscreen&quot;,
theme_advanced_toolbar_location : &quot;top&quot;,
theme_advanced_toolbar_align : &quot;left&quot;,
theme_advanced_buttons1 : &quot;formatselect,fontselect,fontsizeselect,separator,bold,italic,underline,separator,justifyleft,justifycenter,justifyright,bullist,numlist,separator,link,unlink,image,separator,code,separator,undo,redo,fullscreen&quot;,
theme_advanced_buttons2 : &quot;&quot;,
theme_advanced_buttons3 : &quot;&quot;</pre>
<h2>Customizing Appearance and Theme: Parameters</h2>
<ul>
<li><strong>mode: </strong>This tells TinyMCE where to apply itself. If set to &#8220;textareas&#8221;&#8230; i think you get the idea. If you set it to &#8220;exact&#8221; you can target specific ids with the additional parameter -&gt; elements: &#8220;first_id, second_id&#8221;</li>
<li><strong>theme:</strong> If you want to get custom, set this to &#8220;advanced&#8221;. It&#8217;s as easy as that. There&#8217;s a &#8220;simple&#8221;, but you lose a lot of functionality.</li>
<li><strong>skin:</strong> Skins can be be created or downloaded by others that have done the same. They usually consist of a few css files, some images, and a bit of javascript. They&#8217;ll go in the /tiny_mce/themes/advanced/skins/ directory. I really like <a title="TheBigReason TinyMCE Skin" href="http://thebigreason.com/blog/2008/09/29/thebigreason-tinymce-skin" target="_blank">TheBigReason&#8217;s skin</a> &#8212; it&#8217;s clean and easy, utlizing the <a title="famfamfam silk icon set" href="http://www.famfamfam.com/lab/icons/silk/" target="_blank">famfamfam silk icon set</a>. Check it out</li>
<li><strong>plugins:</strong> There are number of cool functions to throw in here, from spellcheck and emoticons, to print and preview. <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Control_reference">Take a look at the whole list of plugins</a>.</li>
<li><strong>theme_advanced_toolbar_location:</strong> Position the toolbar at the top of the textarea. Self explanitory.</li>
<li><strong>theme_advanced_toolbar_align:</strong> Left or right. Pick left. It&#8217;s better.</li>
<li><strong>theme_advanced_buttons1/2/3:</strong> The advanced theme, by default, has three rows of buttons. I myself prefer only one row, so I put all the buttons i want in the buttons1 parameter and leave 2 &amp; 3 empty to prevent the defaults from sneaking back in. <a title="TinyMCE buttons" href="http://wiki.moxiecode.com/index.php/TinyMCE:Control_reference" target="_blank">See the full list of TinyMCE buttons</a>. can be found here. Just separate them by commas and use &#8220;separator&#8221; if you want to break the icons up. Feel free to drop in my list and see if that works for you.</li>
</ul>
<h2>Cleaning Up The Rendered Code</h2>
<p>There are a few parameters here that can help you get more for less:</p>
<ul>
<li><strong>fix_list_elements : true </strong>&#8211; This option enables you to specify that list elements UL/OL is to be converted to valid XHTML. This option is disabled by default.</li>
<li><strong>f</strong><strong>orced_root_block : false</strong> &#8212; This keeps block level elements, such as &lt;strong&gt; from being wrapped with &lt;p&gt; tags, if you need to prevent that.</li>
<li><strong>invalid_elements : &#8220;b,i,span&#8221;</strong> &#8212; Set any html elements you want to prevent being written. Not a bad idea at all. Conversely, there is a &#8220;valid_elements&#8221; parameter. <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/valid_elements" target="_blank">Look at the defaults</a> to see if you need to squash anything</li>
<li><strong>convert_fonts_to_spans : false</strong> &#8212; if you allow the user to set fonts, i would recommend this one, which prevents the depreciated font tag: &lt;font size=&#8221;3&#8243; face=&#8221;Comic Sans MS&#8221;&gt;. USE THIS.</li>
</ul>
<p>There are plenty&#8211;too many in fact&#8211;other parameters, but hopefully this will get you going in the right direction. <a href="http://wiki.moxiecode.com/index.php/TinyMCE:Configuration" target="_blank">Check out the full list if need be.</a></p>
<p>You can also customize the visual appearance of the redered in-editor code via the content.css file. You can find it here: tiny_mce/themes/advanced/skins/&lt;your skin name&gt;/content.css. Not a bad way to have your clients see a rough guess of what they&#8217;ll see on the site.</p>
<p>I plan on playing with creating my own theme(s) in the near future. We&#8217;ll see how that goes. If you&#8217;re ambitious, <a href="http://http://wiki.moxiecode.com/index.php/TinyMCE:Creating_Theme" target="_blank">check out the documentation</a> on that whole bag of apples.</p>
<p>Let me know if there is anything you&#8217;re trying to do in TinyMCE and maybe I can help you, and others, out. Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://jackmcdade.com/dealing-with-wysiwygs-taming-tinymce/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Optimizing ExpressionEngine Sites for Minimum Load Times [Part 1]</title>
		<link>http://jackmcdade.com/optimizing-expressionengine-sites-for-minimum-load-times-part-1/</link>
		<comments>http://jackmcdade.com/optimizing-expressionengine-sites-for-minimum-load-times-part-1/#comments</comments>
		<pubDate>Tue, 05 May 2009 03:49:30 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ExpressionEngine]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://jackmcdade.com/?p=203</guid>
		<description><![CDATA[Load Optimization is a lot of little things added together for the greater good. When combined, page weight can be cut in half, or even more, with no change in functionality. Start with the lowest hanging fruit and move up to the more complex and more gritty as needed.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m going to focus on <a title="ExpressionEngine" href="http://expressionengine.com" target="_blank">ExpressionEngine</a> sites here, but most of these techniques can really be applied to nearly any website. While writing this i realized i should really break it into two parts. This first part will be most of the low-hanging fruit on into some mid-range optimization, while in part two i&#8217;ll get into more complex query caching, expires headings, content delivery networks, and Entity Tags (Etags).</p>
<p>Load Optimization is a lot of little things added together for the greater good. When combined, page weight can be cut in half, or even more, with no change in functionality. Start with the lowest hanging fruit and move up to the more complex and more gritty as needed. I&#8217;ve found that 2 or 3 &#8220;out-of-the-norm&#8221; techniques will get you 80% of the way to a superfast loading site. Standard 80/20 rule.</p>
<h3>I&#8217;ll break the modifications down into 3 categories:</h3>
<ol>
<li>Requests</li>
<li>Sizes</li>
<li>Queries</li>
</ol>
<p>Before I get into the gritty details, I&#8217;d first recommend a tool to benchmark and compare performance as you work through these tips. My favorite tool is <a title="YSlow" href="http://developer.yahoo.com/yslow/" target="_blank">YSlow</a>, a Firebug Addon for Firefox. It breaks your site down into a number of elements and grades you on a set of (mildly) arbitrary benchmarks. Great place to start. Compare your progress as you move forward. Find what gives you the best boost and try to replicate those changes on every site.</p>
<h2><strong>1. Requests</strong></h2>
<p>The more files you request (HTTP Requests), the slower your site load. In addition, the ORDER in which you request them and WHEN you request them can play a factor as well</p>
<ul>
<li><strong>Combine as many javascript functions/libraries/plugins as you can in a single include.</strong> I&#8217;m a huge offender in this category, sometimes with 8 to 15 javascript includes. Sites have to load these 1 at a time, in sequence. Try and keep it to 5 or 6 at max. Less is more.</li>
<li>If you can&#8217;t combine javascript, <strong>try loading them right before your closing &lt;/body&gt; tag</strong>. If they&#8217;re not needed for onLoad effects, at least your visitors won&#8217;t have to wait for the visuals</li>
<li><strong>CSS Sprites. </strong>Background images are a load-speed culprit . If possible, sprite (a technique where you combine a number of elements into one image and position them as needed) as many elements as you can. It takes a little while but it&#8217;s worth it. Check out YouTube&#8217;s <a title="Master Sprite" href="http://s.ytimg.com/yt/img/master-vfl93996.png" rel="shadowbox[post-203];player=img;" target="_blank">master sprite</a>. THAT&#8217;S optmization. There are many tutorials online for this technique, just Google &#8220;CSS Sprite&#8221; or &#8220;How to CSS Sprite.&#8221; You&#8217;ll survive.</li>
<li>I know a lot of people like to separate their CSS (style.css, layout.css, text.css, reset.css, ie6.css, ie7.css, etc&#8230;.) for organization&#8217;s purpose, but every request adds just a little bit to your load time. I<strong>t&#8217;s best to simply roll it into 1 to 2 main files</strong> (i like keeping a reset.css and 960.css combined for those applicable when using the grid, plus my main css sheet).</li>
<li><strong>Try using Google hosted <a title="Google Hosted jQuery" href="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js" target="_blank">jQuery</a>/<a title="Google Hosted MooTools" href="http://ajax.googleapis.com/ajax/libs/mootools/1.2.2/mootools-yui-compressed.js" target="_blank">MooTools</a>/<a title="Google Hosted Prototype" href="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js" target="_blank">Prototype</a> includes. </strong>Chances are people will have these cached from visiting another site and will save a request. At least it will save you bandwidth</li>
<li><strong>Caching. </strong>There are a number of different levels you can approach here. First and most straightforward is ExpressionEngine template caching. Once your site is out of development, turn caching on for all major templates that don&#8217;t change at a moment&#8217;s notice. My general rule of thumb is <strong>5 minutes for major templates</strong> (home page, first level landing pages, nav includes, etc) and <strong>60 minutes for less used templates</strong> (contact form, sitemap, etc). Secondly, if you have templates that just change too often, maybe you have {exp:weblog:entries} tags that don&#8217;t change often, such as an intro paragraph to a news section or something similar. <strong>You can actually cache your tags.</strong> Example:
<pre class="html">cache=<span class="htmlAttributeValue">&quot;yes&quot;</span> refresh=<span class="htmlAttributeValue">&quot;30&quot;</span></pre>
</li>
</ul>
<h2><strong>2. Sizes</strong></h2>
<p>I&#8217;m going to assume you&#8217;ve already optimized all your images. You wouldn&#8217;t be here if you were looking for that tip. (Save-for-web @ 100% <img src='http://jackmcdade.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<ul>
<li><strong>Minimify your javascript.</strong> This gets rid of any extra markup, whitespace, etc&#8230; to save precious kb. Check out the YUI Compressor (http://developer.yahoo.com/yui/compressor/) to get those bad boys down in size.</li>
<li><em><strong>Gzip your javascript files.</strong></em> This gives me awesome results everytime. Once i tried this i never went back. It can change depending on your server, but as long as you&#8217;re on a LAMP stack, this should get you close. You&#8217;ll need to have mod_deflate loaded in PHP for starters. Behond that, it&#8217;s really a simple .htaccess update. I prefer to set it up to gzip everything and exclude the files i don&#8217;t want compressed (images, zip and rar files, gz, etc&#8230;). This usually cuts my js file sizes in HALF. The following .htaccess info should be able to be dropped right in your site.</li>
</ul>
<pre class="xml"># Gzip Our Scripts
######################################################
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \
\.(?:exe|t?gz|zip|b<span class="xmlNumber">z2|</span>sit|rar)$ \
no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
# Just in case some noob is using an old browser...
######################################################
BrowserMatch ^Mozilla<span class="xmlNumber">/4 </span>gzip-only-text/html
BrowserMatch ^Mozilla<span class="xmlNumber">/4\</span><span class="xmlNumber">.0[</span><span class="xmlNumber">678</span>] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html</pre>
<h2><strong>3. Queries</strong></h2>
<p>Hopefully you&#8217;re doing this already, but disabling any parameter you don&#8217;t need in a {exp:weblog:entries} tag will help to speed up the query process and thus your site.</p>
<ul>
<li> <strong>My standard disable string</strong> is disable=&#8221;member_data|categories|trackbacks|pagination&#8221;.<br />
I usually leave category_fields and (of course) custom_fields out of there.</li>
</ul>
<p>I try to do all these tweaks on all my sites. So far, i&#8217;ve cut average load times from 4 seconds to under 1.3 seconds across the board. Simply by using these techniques. Give it a shot.</p>
<p>That&#8217;s it for part one! If anyting doesn&#8217;t work or you&#8217;d like to add your tips, feel free to comment and i&#8217;ll add your tips in (and give you credit of course). I hope it helps you.</p>
]]></content:encoded>
			<wfw:commentRss>http://jackmcdade.com/optimizing-expressionengine-sites-for-minimum-load-times-part-1/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
