<?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>Clayton McIlrath &#187; Technology</title> <atom:link href="http://thinkclay.com/category/technology/feed" rel="self" type="application/rss+xml" /><link>http://thinkclay.com</link> <description>Creative Media Design, Powered by Wordpress</description> <lastBuildDate>Tue, 10 Apr 2012 01:24:47 +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>Tip of the Day: CSS Formatting</title><link>http://thinkclay.com/technology/tip-of-the-day-css-formatting</link> <comments>http://thinkclay.com/technology/tip-of-the-day-css-formatting#comments</comments> <pubDate>Wed, 07 Sep 2011 04:56:31 +0000</pubDate> <dc:creator>Clay McIlrath</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[best practices]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[front-end]]></category> <category><![CDATA[Tip of the Day]]></category> <category><![CDATA[web standards]]></category> <guid
isPermaLink="false">http://thinkclay.com/?p=1526</guid> <description><![CDATA[One thing I really hate about agile front-end dev is the lack of formatting standards between devs. Some developers block their rules, others keep everything on one line. Some indent their rules, others don&#8217;t. The list goes on and on. I have a list of formatting rules that my team has adopted and all the [...]]]></description> <content:encoded><![CDATA[<p>One thing I really hate about agile front-end dev is the lack of formatting standards between devs. Some developers block their rules, others keep everything on one line. Some indent their rules, others don&#8217;t. The list goes on and on. I have a list of formatting rules that my team has adopted and all the front-end devs that I respect also follow, so if you care about improving your code and agile development, please adopt a standard of some sort and stand firm by it:</p><h3>Block vs Single Line</h3><p>Default to single line, because many rules will only contain one or two styles and its a waste and pain to scroll vertically through code. Most editors support the 80 column rule, so if your styles get longer than that, convert to block (easy to set a macro to do it for you in most IDE&#8217;s and editors).</p><div
class="wp_syntax"><div
class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.foo</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.bar</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">29px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">7px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">16.2%</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">26px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div><h3>Indentation</h3><p>It&#8217;s so much easier to read code that is indented to show hierarchy and white space that separates or groups similar or related objects together. This is a standard I see most front-end developers following, but if you&#8217;re not, smack yourself now and get with the program.</p><div
class="wp_syntax"><div
class="code"><pre class="css" style="font-family:monospace;">ul <span style="color: #00AA00;">&#123;</span> <span style="color: #00AA00;">&#125;</span>
	li <span style="color: #00AA00;">&#123;</span> <span style="color: #00AA00;">&#125;</span>
		li a <span style="color: #00AA00;">&#123;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.foo</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span>
	<span style="color: #6666ff;">.bar</span> <span style="color: #00AA00;">&#123;</span><span style="color: #00AA00;">&#125;</span></pre></div></div><p>That&#8217;s all on formatting for now. Adopt these standards and read on, because I&#8217;m sure I&#8217;ll be back on this rant before too long.</p> ]]></content:encoded> <wfw:commentRss>http://thinkclay.com/technology/tip-of-the-day-css-formatting/feed</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Tip of the Day: Mobile Touch Events</title><link>http://thinkclay.com/technology/tip-of-the-day-mobile-touch-events</link> <comments>http://thinkclay.com/technology/tip-of-the-day-mobile-touch-events#comments</comments> <pubDate>Tue, 30 Aug 2011 00:17:54 +0000</pubDate> <dc:creator>Clay McIlrath</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[best practices]]></category> <category><![CDATA[front-end]]></category> <category><![CDATA[iOS]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[JS]]></category> <category><![CDATA[Mobile]]></category> <category><![CDATA[Tip of the Day]]></category> <category><![CDATA[web browser]]></category> <guid
isPermaLink="false">http://thinkclay.com/?p=1521</guid> <description><![CDATA[I recently got into a project that was a bit over my head. I had to build out a map that will work on desktop, mobile and tablets the same, but I quickly ran into issues tracking touch events in mobile Safari. All of the testing I was doing in iOS5 (beta) was working the [...]]]></description> <content:encoded><![CDATA[<p>I recently got into a project that was a bit over my head. I had to build out a map that will work on desktop, mobile and tablets the same, but I quickly ran into issues tracking touch events in mobile Safari. All of the testing I was doing in iOS5 (beta) was working the exact same way as the browser, where I could monitor a click and drag (touchmove) event and get the properties <em>pageX</em> and <em>pageY</em> directly from the event. However, on other mobile browsers (specifically iOS4 and older) this property was returning 0 everytime. I then found that multi-touch events store each finger press so I had to get the array of fingers and return the page coordinates. Long story short, here is the code I ended up implementing:</p><div
class="wp_syntax"><div
class="code"><pre class="javascript" style="font-family:monospace;">document.<span style="color: #660066;">ontouchstart</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">touches</span>.<span style="color: #660066;">length</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// Only deal with one finger</span>
		<span style="color: #003366; font-weight: bold;">var</span> touch <span style="color: #339933;">=</span> e.<span style="color: #660066;">touches</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// Get information for finger #1</span>
		    x <span style="color: #339933;">=</span> touch.<span style="color: #660066;">pageX</span><span style="color: #339933;">,</span>
		    y <span style="color: #339933;">=</span> touch.<span style="color: #660066;">pageY</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><h3>Further Reading on Mobile Touch Events in Javascript</h3><ul><li><a
href="http://www.sitepen.com/blog/2008/07/10/touching-and-gesturing-on-the-iphone/">iPhone Gesturing Explained</a></li></ul> ]]></content:encoded> <wfw:commentRss>http://thinkclay.com/technology/tip-of-the-day-mobile-touch-events/feed</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>The Best, Free WordPress 3.1 Plugins</title><link>http://thinkclay.com/technology/best-free-wordpress-plugins</link> <comments>http://thinkclay.com/technology/best-free-wordpress-plugins#comments</comments> <pubDate>Sat, 09 Apr 2011 04:26:06 +0000</pubDate> <dc:creator>Clay McIlrath</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[automate]]></category> <category><![CDATA[blogging]]></category> <category><![CDATA[resources]]></category> <category><![CDATA[seo]]></category> <category><![CDATA[wordpress]]></category> <guid
isPermaLink="false">http://thinkclay.com/?p=1488</guid> <description><![CDATA[There are thousands of WordPress Plugins out there, but it takes a lot of time and trial to find the ones that are truly exceptional. After years of building custom websites, I&#8217;ve decided to refine and publish my master list of plugins (for the user, not the dev) that are awesome or essential to nearly [...]]]></description> <content:encoded><![CDATA[<p>There are thousands of WordPress Plugins out there, but it takes a lot of time and trial to find the ones that are truly exceptional. After years of building custom websites, I&#8217;ve decided to refine and publish my master list of plugins (for the user, not the dev) that are awesome or essential to nearly every site I have launched!</p><h3>Galleries</h3><p>WordPress is getting more robust with every release, yet for some reason, there&#8217;s still no great way to do Galleries natively. Fear not, we have found that Nextgen and CataBlog will do the job well enough!</p><h3>Worpress and Search Engine Optimization</h3><p>When it comes to SEO, there are absolutely no open source platforms that I&#8217;ve seen that do as superb of a job providing tools and automating the process. Keys to wordpress SEO include meta control, monitoring, links and social networking. Here are the best tools for the job:</p><h4><a
href="http://wordpress.org/extend/plugins/wp-stats-dashboard/">WordPress Stats Plugin</a></h4><p>The <a
href="http://wordpress.org/extend/plugins/wp-stats-dashboard/">WP Stats</a> is actually two essential plugins, one by the creators of WP and the other as a dashboard tool to take analytics through the roof. The WP stats plugin lets you monitor social traffic, alexa, compete, and far more — all enabled and monitored without leaving your admin!</p><h4><a
href="http://yoast.com/wordpress/seo/">WordPress SEO by Yoast</a></h4><p>For years, i used the All in one SEO plugin, and even gave headspace a shot but Yoast knocked them both out of the water for me. The yoast plugin boasts some great tools to help you generate meta content, plus looks and works the way a good WP plugin should.</p><h4><a
href="http://wordpress.org/extend/plugins/seo-automatic-links/">SEO Smart Links</a></h4><p>Internal site links are a huge usability and SEO boost, and nothing helps you build these links better than this plugin. I usually dump in a keyword list that I&#8217;ve built with Google&#8217;s Keyword tool and over time I aim to write articles and link them to those keywords.</p><h4>Worpress SEO requires a <a
href="http://wordpress.org/extend/plugins/google-sitemap-generator/">Sitemap</a></h4><p>Don&#8217;t let the name fool you, Google SEO sitemap covers all the major search engines and notifies them automatically whenever you publish new content. Don&#8217;t skip this one, a sitemap is a must in helping a search engine index your site, and is even more crucial for frequent bloggers.</p><h4>Faster page loads in WordPress</h4><p>We all want more cache don&#8217;t we? <a
href="http://www.wordpress.org/extend/plugins/wp-super-cache/">WP Super Cache</a> speeds up your site significantly making your pages load faster, which is favorable for both man and machine! Follow that with <a
href="http://wordpress.org/extend/plugins/wp-smushit/">Smush.it</a>, <a
href="http://wordpress.org/extend/plugins/wp-optimize/stats/">Database Optimization</a> and <a
href="http://wordpress.org/extend/plugins/wp-minify/">Minification</a> and you&#8217;re looking at a 20-30% faster site on average (estimated from personal use and client sites).</p><h3>Get Social with WordPress</h3><p>Social networking is huge and most blogs completely fail to engage their audience (guilty), part of the problem is obviously content but the other part is often the tools and approach. If your website is large and well known (or has the capacity to be) why not extend WordPress with <a
href="http://buddypress.com">BuddyPress</a> and launch your own social network? Or keep it simple and drop in <a
href="http://wordpress.org/extend/plugins/socialize/">Socialize</a> widgets and <a
href="http://wordpress.org/extend/plugins/disqus-comment-system/">Disqus Comments</a> so that your users can engage using existing social platforms.</p><h3>WordPress Utilities you can&#8217;t Live Without</h3><p>There are a TON of utilities that I would love to talk about, but for brevity I will only mention <a
href="http://wordpress.org/extend/plugins/scissors-continued/">Scissors</a> and <a
href="http://wordpress.org/extend/plugins/wp-db-backup/">WP DB Backup</a>. Scissors lets you crop and rotate media which is something I hope wordpress will include in its core. WP Backup makes a data backup for you automatically and emails it to you, allowing you to have a backup outside of your host.</p><p>I hope these plugins help, and if you feel I missed one that HAS to be on the list, just mention it in the comments below and I&#8217;ll argue about it a bit <img
src='http://thinkclay.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://thinkclay.com/technology/best-free-wordpress-plugins/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Get Static Block in Magento</title><link>http://thinkclay.com/technology/get-static-block-in-magento</link> <comments>http://thinkclay.com/technology/get-static-block-in-magento#comments</comments> <pubDate>Wed, 19 Jan 2011 09:00:05 +0000</pubDate> <dc:creator>Clay McIlrath</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[magento]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Snippet]]></category> <guid
isPermaLink="false">http://thinkclay.com/?p=1418</guid> <description><![CDATA[Magento has made it really easy to get Static Content from within a CMS page with the use of widgets, but say you're developing a custom theme, you may want to call a <strong>static block programmatically</strong> in a <strong>Magento theme</strong> in which case there are a few methods of doing so...]]></description> <content:encoded><![CDATA[<p>Magento has made it really easy to get Static Content from within a CMS page with the use of widgets, but say you&#8217;re developing a custom theme, you may want to call a <strong>static block programmatically</strong> in a <strong>Magento theme</strong> in which case there are a few methods of doing so&#8230;</p><p>The first is quick and easy to drop into a Magento theme, but only gets the <strong>static block content</strong>:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getLayout</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createBlock</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'cms/block'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setBlockId</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'indentifer'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">toHtml</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p>Where, by calling the <strong>static block model</strong>, you can then get all fields associated with that block such as the <strong>static block title</strong></p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$block</span> <span style="color: #339933;">=</span> Mage<span style="color: #339933;">::</span><span style="color: #004000;">getModel</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'cms/block'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'identifier'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$block</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getTitle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$block</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getContent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p>Hope this helps you with <strong>static blocks</strong> in your <strong>custom magento theme</strong>. Happy coding!</p> ]]></content:encoded> <wfw:commentRss>http://thinkclay.com/technology/get-static-block-in-magento/feed</wfw:commentRss> <slash:comments>11</slash:comments> </item> <item><title>Must-have Magento Extensions</title><link>http://thinkclay.com/technology/must-have-magento-extensions</link> <comments>http://thinkclay.com/technology/must-have-magento-extensions#comments</comments> <pubDate>Sun, 13 Jun 2010 19:14:45 +0000</pubDate> <dc:creator>Clay McIlrath</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[developer tools]]></category> <category><![CDATA[magento]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[resources]]></category> <category><![CDATA[zend]]></category> <guid
isPermaLink="false">http://thinkclay.com/?p=1232</guid> <description><![CDATA[As Magento grows, so does it&#8217;s base for extensions and contributions. I often find myself browsing the collection of them, and try to experiment with a new extension on every site that I build. This is my list of must-haves and favorite magento extensions thus far, and hopefully I&#8217;ll add to this list as time [...]]]></description> <content:encoded><![CDATA[<p>As Magento grows, so does it&#8217;s base for extensions and contributions. I often find myself browsing the collection of them, and try to experiment with a new extension on every site that I build. This is my list of must-haves and favorite magento extensions thus far, and hopefully I&#8217;ll add to this list as time goes on.</p><h3>Developer Extensions</h3><p>Developer toolbar:</p><p>http://www.magentocommerce.com/extension/2271/developer-toolbar</p><p>Blueprint Theme:</p><p>http://www.magentocommerce.com/extension/2245</p><h3>Free Magento Extensions</h3><p>Product Image lightbox:</p><p>http://www.magentocommerce.com/extension/1487/magento-easy-lightbox</p><p>Product Detail tabbing:</p><p>http://www.magentocommerce.com/extension/1725/magento-easytabs</p><p>Teaser Box:</p><p>http://www.magentocommerce.com/extension/1778/teaserbox</p><h3>Free Magento Themes</h3><p>Absolute Magento Theme</p><p>http://www.magentocommerce.com/extension/2031/magento-absolute-theme</p><h3>Paid Magento Extensions</h3><p>Abandoned Cart Alerts</p><p>http://adjustware.com/shop/magentomods_abandoned_carts_alerts.html</p><p>Quickview</p><p>http://www.magentocommerce.com/extension/574/quickview-1.1</p> ]]></content:encoded> <wfw:commentRss>http://thinkclay.com/technology/must-have-magento-extensions/feed</wfw:commentRss> <slash:comments>9</slash:comments> </item> <item><title>Magento: Add New CMS Page Layout</title><link>http://thinkclay.com/technology/magento-add-new-cms-page-layout</link> <comments>http://thinkclay.com/technology/magento-add-new-cms-page-layout#comments</comments> <pubDate>Sun, 06 Jun 2010 15:16:32 +0000</pubDate> <dc:creator>Clay McIlrath</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[magento]]></category> <guid
isPermaLink="false">http://thinkclay.com/?p=1221</guid> <description><![CDATA[Want to take your Magento Themes to the next level? Have multiple layouts? If you're looking to <strong>add a new page layout in Magento</strong>, <strong>create a custom layout</strong> or <strong>create a new theme layout</strong> then this solution is probably for you.]]></description> <content:encoded><![CDATA[<p>Want to take your Magento Themes to the next level? Have multiple layouts? If you&#8217;re looking to <strong>add a new page layout in Magento</strong>, <strong>create a custom layout</strong> or <strong>create a new theme layout</strong> then this solution is probably for you.</p><p><img
src="http://thinkclay.com/wp-content/uploads/2009/12/Screen-shot-2009-12-14-at-8.05.52-AM.png" alt="Add a new CMS Page Layout" title="Add a new CMS Page Layout" width="476" height="268" /></p><p>First we have to create a module. Create file: <em>app/etc/modules/Mage_Page.xml</em></p><div
class="wp_syntax"><div
class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;modules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Mage_Page<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;active<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/active<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;codePool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>local<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/codePool<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Mage_Page<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/modules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div><p>Then copy this whole folder: <em>app/code/core/Mage/Page</em> to <em>app/code/local/Mage</em></p><p>What we&#8217;ve done is taken a core module and copied it into our local module. This lets us override any core functionality without have to worry about it breaking in future update (or undoing if you mess up).</p><p>Now we need to edit: <em>app/code/core/Mage/Page/etc/config.xml</em> and look around line 46 and you can define your own layout, I&#8217;m going to call mine &#8220;home&#8221;</p><div
class="wp_syntax"><div
class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;layouts<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;home</span> <span style="color: #000066;">module</span>=<span style="color: #ff0000;">&quot;page&quot;</span> <span style="color: #000066;">translate</span>=<span style="color: #ff0000;">&quot;label&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Home<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>page/home.phtml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;layout_handle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>page_home<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/layout_handle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/home<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;empty</span> <span style="color: #000066;">module</span>=<span style="color: #ff0000;">&quot;page&quot;</span> <span style="color: #000066;">translate</span>=<span style="color: #ff0000;">&quot;label&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Empty<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>page/one-column.phtml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;layout_handle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>page_empty<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/layout_handle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/empty<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;one_column</span> <span style="color: #000066;">module</span>=<span style="color: #ff0000;">&quot;page&quot;</span> <span style="color: #000066;">translate</span>=<span style="color: #ff0000;">&quot;label&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1 column<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>page/1column.phtml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;layout_handle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>page_one_column<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/layout_handle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/one_column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;two_columns_left</span> <span style="color: #000066;">module</span>=<span style="color: #ff0000;">&quot;page&quot;</span> <span style="color: #000066;">translate</span>=<span style="color: #ff0000;">&quot;label&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2 columns with left bar<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>page/2columns-left.phtml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;layout_handle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>page_two_columns_left<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/layout_handle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/two_columns_left<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;two_columns_right</span> <span style="color: #000066;">module</span>=<span style="color: #ff0000;">&quot;page&quot;</span> <span style="color: #000066;">translate</span>=<span style="color: #ff0000;">&quot;label&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2 columns with right bar<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>page/2columns-right.phtml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;layout_handle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>page_two_columns_right<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/layout_handle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/two_columns_right<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;three_columns</span> <span style="color: #000066;">module</span>=<span style="color: #ff0000;">&quot;page&quot;</span> <span style="color: #000066;">translate</span>=<span style="color: #ff0000;">&quot;label&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>3 columns<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>page/3columns.phtml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;layout_handle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>page_three_columns<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/layout_handle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/three_columns<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/layouts<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div><p>Now all you have to do is make a template for this page. Navigate to your theme directory: <em>app/design/frontend/YOUR_THEME/YOUR_THEME/template/page/</em> and create a new template called <em>home.phtml</em>. I suggest using another existing template as a starting point, such as <em>3columns.phtml</em> so that you know what variables to work around. This will <strong>enable a custom layout option for CMS pages</strong> once you&#8217;re finished. I&#8217;ve tested this with 1.3 series but nothing previous or after that. If you have any comments or questions feel free to post them here or read the <a
href="http://www.magentocommerce.com/boards/viewthread/1406/P30/">forum</a> on Magento&#8217;s site for more details.</p> ]]></content:encoded> <wfw:commentRss>http://thinkclay.com/technology/magento-add-new-cms-page-layout/feed</wfw:commentRss> <slash:comments>45</slash:comments> </item> <item><title>Compatible Operating Systems for Web Hosting</title><link>http://thinkclay.com/technology/compatible-operating-systems-for-web-hosting</link> <comments>http://thinkclay.com/technology/compatible-operating-systems-for-web-hosting#comments</comments> <pubDate>Tue, 18 May 2010 14:43:28 +0000</pubDate> <dc:creator>Clay McIlrath</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[developer tools]]></category> <category><![CDATA[ubuntu]]></category> <guid
isPermaLink="false">http://thinkclay.com/?p=1348</guid> <description><![CDATA[Best compatible operating system for web hosting When you are choosing web hosting, one of the first things you need to choose is the operating system. If you are a techie, this is probably an easy choice, but if you don&#8217;t have technical background, then the very question &#8220;Operating system?! What is this?&#8221; will pop [...]]]></description> <content:encoded><![CDATA[<h3>Best compatible operating system for web hosting</h3><p>When you are <a
href="http://www.webhostingsearch.com/">choosing web hosting</a>, one of the first things you need to choose is the operating system. If you are a techie, this is probably an easy choice, but if you don&#8217;t have technical background, then the very question &#8220;Operating system?! What is this?&#8221; will pop up in your head.</p><h3>What is an Operating System?</h3><p>There are many definitions of what an operating system is but since you are not a techie, you will hardly be willing to delve into the technical details. To put it into layman&#8217;s terms, an operating system is a piece of software you need in order to install applications and to access the underlying hardware.</p><p>Hardware is nothing without software to manage it and this is why you need software (i.e. the operating system) to tell the hardware what to do. On the other hand, an operating system doesn&#8217;t perform tasks an application can and this is why you need to install applications within the operating system in order to perform tasks such as browsing the Net, logging into your web host, etc. It is true that most operating systems come bundled with applications but still applications are separate from the operating  system.</p><h3>Popular Web Hosting  Operating Systems?</h3><p>There are hundreds of operating systems in use but the most popular ones are Windows and Linux. As an end-user, you are probably already familiar with Windows because you are probably using it on your computer. As far as web hosting is concerned, <a
href="http://www.webhostingsearch.com/windows-web-hosting.php">Windows hosting</a> doesn&#8217;t use exactly the same version of Windows that you may be running on your computer; but still both versions are very similar.</p><p>The second popular web hosting operating system is Linux. You  might have heard about it but probably you have never used it. Unlike Windows, Linux is primarily a server operating system (though there are many Linux distributions that are intended as a desktop operating system). In addition to Windows and Linux, there are other web hosting operating systems, such as </span><a
href="http://en.wikipedia.org/wiki/UNIX">UNIX=</a>, <a
href="http://apple.com">MAC</a>, HP  varieties, or Solaris, but we won&#8217;t discuss those here.</p><h3>Is Linux Hosting or Windows Hosting Best?</h3><p>Usually when you have to choose the operating system for your web hosting, the choice is between Windows hosting and Linux hosting. Both Windows hosting and <a
href="http://www.webhostingsearch.com/linux-web-hosting.php">linux hosting</a> have their advantages and  disadvantages and it is not possible to recommend one of them as the  better option. In some situations Linux hosting is the way to go, while in others Windows hosting is the better alternative.</p><p>For a novice, who is familiar with neither Linux hosting, nor Windows hosting, Linux hosting could be a bit more difficult to master. However, once you pass the initial stages, you will see that Linux administration is not terribly difficult.</p><p>Actually, the biggest deciding factor between Linux hosting versus Windows hosting are your applications. There are applications, which can be run only under Windows/Linux and if your applications fall into this group,  you have no choice but to go for Linux hosting/Windows hosting.</p> ]]></content:encoded> <wfw:commentRss>http://thinkclay.com/technology/compatible-operating-systems-for-web-hosting/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Setup SVN in Hostmonster Shared Hosting</title><link>http://thinkclay.com/technology/setup-svn-in-hostmonster-shared-hosting</link> <comments>http://thinkclay.com/technology/setup-svn-in-hostmonster-shared-hosting#comments</comments> <pubDate>Tue, 27 Apr 2010 06:09:26 +0000</pubDate> <dc:creator>Clay McIlrath</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[Tutorial]]></category> <category><![CDATA[best practices]]></category> <category><![CDATA[developer tools]]></category> <category><![CDATA[personal]]></category> <category><![CDATA[resources]]></category> <category><![CDATA[Shell]]></category> <category><![CDATA[SVN]]></category> <category><![CDATA[Terminal]]></category> <category><![CDATA[Versioning]]></category> <guid
isPermaLink="false">http://thinkclay.com/?p=1335</guid> <description><![CDATA[<a
href="http://thinkclay.com/technology/setup-svn-in-hostmonster-shared-hosting"><img
src="http://thinkclay.com/wp-content/uploads/2010/04/svn-hostmonster.jpg" alt="" title="svn-hostmonster" width="300" height="200" class="alignleft" /></a> I've had my fair share of installs in <strong>shared hosting</strong>, but sometimes simple things like <strong>SVN</strong> can get very tricky with providers like <strong>Hostmonster</strong> or <strong>BlueHost</strong>. I hope that this shell will work as well for you as it has for me. Just copy the code and paste into a file on your server <em>svninstall.sh</em> and then to run just execute <em>. .svninstall.sh</em> and you're off! Comment here if you get and errors and I'd be glad to help.]]></description> <content:encoded><![CDATA[<p>I&#8217;ve had my fair share of installs in <strong>shared hosting</strong>, but sometimes simple things like <strong>SVN</strong> can get very tricky with <strong>hosting providers</strong> like <strong>Hostmonster</strong> or <strong>BlueHost</strong>. I hope that this shell will work as well for you as it has for me. Just copy the code and paste into a file on your server (i called mine <em>svninstall.sh</em>) and then to run just execute <em>. .svninstall.sh</em> and you&#8217;re off! Comment here if you get and errors and I&#8217;d be glad to help. Also if you get stuck, take into consideration that there are other <a
href="http://www.hostingobserver.com">inexpensive web hosting</a> and <a
href="http://www.peer1.com/hosting/cloud-services.php">cloud server hosting</a> companies that you can work with, so before smashing your head against the wall, look around for a better solution.</p><div
class="wp_syntax"><div
class="code"><pre class="shell" style="font-family:monospace;">#!/bin/sh
&nbsp;
export svn=1.6.9
export ipath=$HOME/tools64/
export dev=$HOME/dev/svn
&nbsp;
mkdir -p $ipath
mkdir -p $dev
cd $dev
&nbsp;
if [ ! -f $dev/subversion-deps-$svn/__download ] ; then
	rm subversion-deps-$svn.tar.bz2*
	wget http://subversion.tigris.org/downloads/subversion-deps-$svn.tar.bz2 &amp;amp;&amp;amp; \
		tar -xjf subversion-deps-$svn.tar.bz2 &amp;amp;&amp;amp; \
		mv subversion-$svn subversion-deps-$svn &amp;amp;&amp;amp; \
		touch  subversion-deps-$svn/__download
	rm subversion-deps-$svn.tar.bz2.*
fi
if [ ! -f $dev/subversion-$svn/__download ] ; then
	rm subversion-$svn.tar.bz2*
	wget http://subversion.tigris.org/downloads/subversion-$svn.tar.bz2 &amp;amp;&amp;amp; \
		tar -xjf subversion-$svn.tar.bz2 &amp;amp;&amp;amp; \
		touch  subversion-$svn/__download
	rm subversion-$svn.tar.bz2*
fi
&nbsp;
export o=&quot; --prefix=$ipath LDFLAGS=&quot;-L$ipath/lib&quot; CPPFLAGS=&quot;-I$ipath/include&quot; CFLAGS=&quot;-I$ipath/include&quot; &quot;
export oapr=&quot; --with-apr=$ipath/bin/apr-1-config &quot;
export oapu=&quot; --with-apr-util=$ipath/bin/apu-1-config &quot;
&nbsp;
export pdep=$dev/subversion-deps-$svn
export psvn=$dev/subversion-$svn
&nbsp;
export PATH=$ipath/bin:$PATH
&nbsp;
#compile zlib
cd $pdep/zlib
export CFLAGS='-fPIC'
if [ ! -f _done ] ; then
	make clean
	./configure --prefix=$ipath
	make &amp;amp;&amp;amp; touch _done
fi
make install
&nbsp;
# compile APR
cd $pdep/apr
if [ ! -f _done ] ; then
	make clean
	./configure $o
	make &amp;amp;&amp;amp; touch _done
fi
make install
&nbsp;
# compile neon
cd $pdep/neon
if [ ! -f _done ] ; then
	make clean
	./configure $o $oapr
	make &amp;amp;&amp;amp; touch _done
fi
make install
&nbsp;
#compile sqlite
cd $pdep/sqlite-amalgamation
if [ ! -f _done ] ; then
	make clean
	./configure $o $oapr
	make &amp;amp;&amp;amp; touch _done
fi
make install
&nbsp;
# compile Berkeley DB
cd $pdep
if [ ! -f db-5.0.21/__download ] ; then
	rm db-5.0.21.tar.gz*
	wget http://download.oracle.com/berkeley-db/db-5.0.21.tar.gz &amp;amp;&amp;amp; \
		tar -xzf db-5.0.21.tar.gz &amp;amp;&amp;amp; \
		touch  db-5.0.21/__download
	rm db-5.0.21.tar.gz*
fi
cd $pdep/db-5.0.21/build_unix
if [ ! -f _done ] ; then
	make clean
	../dist/configure $o $oapr
	make &amp;amp;&amp;amp; touch _done
fi
make install
&nbsp;
# compile APR-util after Berkeley. This way svn find berkeley automatically
cd $pdep/apr-util
if [ ! -f _done ] ; then
	make clean
	./configure $o $oapr --with-berkeley-db=$ipath/include:$ipath/lib
	make &amp;amp;&amp;amp; touch _done
fi
make install
&nbsp;
# compile serf
cd $pdep/serf
if [ ! -f _done ] ; then
	make clean
	./configure $o $oapr $oapu
	make &amp;amp;&amp;amp; touch _done
fi
make install
&nbsp;
# finaly, build svn
cd $psvn
if [ ! -f _done ] ; then
	make clean
	./configure $o $oapr
	make &amp;amp;&amp;amp; touch _done
fi
make install</pre></div></div> ]]></content:encoded> <wfw:commentRss>http://thinkclay.com/technology/setup-svn-in-hostmonster-shared-hosting/feed</wfw:commentRss> <slash:comments>13</slash:comments> </item> <item><title>Getting Started with Facebook JS (FBJS)</title><link>http://thinkclay.com/technology/getting-started-with-facebook-js-fbjs</link> <comments>http://thinkclay.com/technology/getting-started-with-facebook-js-fbjs#comments</comments> <pubDate>Thu, 25 Feb 2010 05:16:13 +0000</pubDate> <dc:creator>Clay McIlrath</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[best practices]]></category> <category><![CDATA[Facebook]]></category> <category><![CDATA[FBJS]]></category> <category><![CDATA[front-end]]></category> <category><![CDATA[JS]]></category> <guid
isPermaLink="false">http://thinkclay.com/?p=1314</guid> <description><![CDATA[<a
href="http://thinkclay.com/technology/getting-started-with-facebook-js-fbjs"><img
src="http://thinkclay.com/wp-content/uploads/2010/02/facebook-js-fbjs.jpg" alt="" title="facebook-js-fbjs" width="300" height="200" class="alignleft" /></a> I’ve only recently started developing Facebook Apps and being a strong front-end developer I was confident that I would be able to pickup FBJS quickly. My confidence what short-lived however, once i discovered that Facebook had a very restricting framework and cache system that would make JS programming something quite a bit less desirable than awesome frameworks like jQuery.]]></description> <content:encoded><![CDATA[<p>I&#8217;ve only recently started developing Facebook Apps and being a strong front-end developer I was very confident that I would be able to pickup FBJS quickly like I have with many other Javascript Frameworks. My confidence what short-lived however, once I discovered that Facebook had a very restricting framework and cache system that would make JS programming something quite a bit less desirable than awesome frameworks like jQuery or Prototype</p><h3>What you CAN&#8217;T do in FBJS</h3><p>I learned very quickly, that Facebook JavaScript does not allow some very common native functions such as onload, arrays and alerts as well as access to many properties of the document or window level of the DOM. There are workarounds and alternative methods that you can use instead:</p><h4>window.onload in FBJS</h4><p>Instead of using <em>window.onload</em> to initialize your functions, use <em>setTimeout</em>.</p><div
class="wp_syntax"><div
class="code"><pre class="javascript" style="font-family:monospace;">setTimeout<span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">10</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>Even an empty setTimout at the beginning of your script will kick start your functions which would normally auto init (this seems to work fine in canvas, but not so much in tabs).</p><h4>alert alternative for FBJS</h4><p>Since you can&#8217;t use alert or document.write, use Facebook&#8217;s dialog box:</p><div
class="wp_syntax"><div
class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">new</span> Dialog<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">showMessage</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Dialog'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'This is text'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><h4>document.write alternative for FBJS</h4><p>Since you don&#8217;t have access to the document or window levels of the DOM, you&#8217;ll want to setup a little include for testing. I drop in this code when i want to quickly output:</p><div
class="wp_syntax"><div
class="code"><pre class="html" style="font-family:monospace;">&lt;script&gt;
function logOutput(){
    var text = &quot;This will be inserted into my log div&quot;;
    document.getElementById('log').setTextValue(text);
}
&lt;/script&gt;
&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;</pre></div></div><h4>Trouble with JS Arrays in Facebook</h4><p>For whatever reason, facebook also decided to rip out support for creating objects which also eliminated the way most of us make arrays:</p><div
class="wp_syntax"><div
class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// new Array() is not supported in FBJS</span>
<span style="color: #003366; font-weight: bold;">var</span> myarray <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
myarray<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'stuff'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// or</span>
myarray<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'foo'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'bar'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// or </span>
myarray.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'another example'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>More to come as I wrestle further with Facebook. Any tips or comments are greatly appreciated!</p> ]]></content:encoded> <wfw:commentRss>http://thinkclay.com/technology/getting-started-with-facebook-js-fbjs/feed</wfw:commentRss> <slash:comments>19</slash:comments> </item> <item><title>Installing Zend Framework on MAMP</title><link>http://thinkclay.com/technology/installing-zend-framework-on-mamp</link> <comments>http://thinkclay.com/technology/installing-zend-framework-on-mamp#comments</comments> <pubDate>Wed, 09 Dec 2009 03:23:28 +0000</pubDate> <dc:creator>Clay McIlrath</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[Tutorial]]></category> <category><![CDATA[desktop]]></category> <category><![CDATA[developer tools]]></category> <category><![CDATA[MAC]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[zend]]></category> <guid
isPermaLink="false">http://thinkclay.com/?p=1209</guid> <description><![CDATA[As usual, I'm sharing a solution a problem that I personally encountered and couldn't find a great solution for. So I've been using my laptop more and more as my local development environment in order to keep things private and secure while in the dev stage. Among learning how to fully utilize SVN locally, I've been trying to setup my laptop to be a fully functional server while also being extremely easy to maintain and change my environment on the fly. To do this, I'm running MAMP (Mac Apache MySQL PHP) available for free at <a
href="http://mamp.info">mamp.info</a> as well as the Zend Framework bundled with Zend Tool. ]]></description> <content:encoded><![CDATA[<p>As usual, I&#8217;m sharing a solution a problem that I personally encountered and couldn&#8217;t find a great solution for. So I&#8217;ve been using my laptop more and more as my local development environment in order to keep things private and secure while in the dev stage. Among learning how to fully utilize SVN locally, I&#8217;ve been trying to setup my laptop to be a fully functional server while also being extremely easy to maintain and change my environment on the fly. To do this, I&#8217;m running MAMP (Mac Apache MySQL PHP) available for free at <a
href="http://mamp.info">mamp.info</a> as well as the <strong>Zend Framework</strong> bundled with <strong>Zend Tool</strong>.</p><ol><li>Get MAMP up and running, no special setup is needed here.</li><li>Download <a
href="http://framework.zend.com/download/latest">Zend Framework</a> and place it wherever you&#8217;d like. I actually retrieved my copy via SVN so that I can easily upgrade it later. To do this open up terminal and follow these commands:<pre>
cd /Applications/MAMP/
mkdir svn
cd svn
mkdir zendframework
cd zendframework
svn checkout http://framework.zend.com/svn/framework/standard/trunk
</pre></li><li>Now open your php.ini file located under <em>/Applications/MAMP/conf/php5/php.ini</em></li><li>Search for <strong>include_path</strong> (around line 411 on mine) and add the location of your zend framework:<pre>include_path = ".:/usr/lib/php:/usr/local/lib/php:/Applications/MAMP/svn/zendframework/trunk/library"</pre><p>Make sure to include the <em>library</em> directory otherwise you&#8217;ll <strong>get a blank page in Zend Framework</strong></li><li>Zend Framework also comes with a shell script that will help you with RAD (Rapid Application Deployment), you can create a shortcut to Zend Tools in terminal by adding an alias to your profile under /etc/profile (thanks DS for pointing this out) and make sure to restart terminal after you&#8217;ve done so:<pre>alias zf=/Applications/MAMP/svn/zendframework/trunk/bin/zf.sh</pre></li><li>Test if the Zend Tool is installed correctly by showing the version:<pre>zf show version</pre></li><li>Finally navigate to the directory you&#8217;d like to create your first project in:<pre>cd /Applications/MAMP/htdocs/</pre><p>and with Zend Tool creating a project is simple:</p><pre>zf create project test</pre></li></ol> ]]></content:encoded> <wfw:commentRss>http://thinkclay.com/technology/installing-zend-framework-on-mamp/feed</wfw:commentRss> <slash:comments>49</slash:comments> </item> </channel> </rss>
