<?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> &#187; Development</title>
	<atom:link href="http://toolboxdigital.com/tag/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://toolboxdigital.com</link>
	<description></description>
	<lastBuildDate>Fri, 24 Feb 2012 15:53:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Making Responsive Web Design Optional</title>
		<link>http://toolboxdigital.com/2011/06/making-responsive-web-design-optional/</link>
		<comments>http://toolboxdigital.com/2011/06/making-responsive-web-design-optional/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 22:04:07 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[effects]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=765</guid>
		<description><![CDATA[Discover how to add a Media Queries toggle button to your site using jQuery.]]></description>
			<content:encoded><![CDATA[<h4>Following up on some provoking thoughts from *that* <a href="http://www.lukejones.me/post/6651505197/responsive-web-design" target="_blank">blog post</a> from <a href="https://twitter.com/lukejonesme">Luke Jones</a>, I decided to add some additional functionality to my experimental <a href="http://toolboxdigital.com/geekkarting/" target="_blank">Twitter aggregator</a>.</h4>
<p>For simple sites like this one, Media Queries are a no-brainer &#8211; simple to add, and the basic layout allows for easy positional modifications to improve the layout on devices with smaller viewports. The target audience for the aggregator also made a compelling reason to create a responsive layout for the site &#8211; after all, there&#39;s a high probability an above average number of users will be viewing on an iOS or other mobile device.</p>
<p><span id="more-765"></span></p>
<p><img alt="" class="alignnone size-full wp-image-766" src="http://toolboxdigital.com/wp-content/uploads/2011/06/rwd.jpg" title="The Geek Karting Twitter Aggregator" /></p>
<p>Besides, I enjoy playing around with the technology, and there&#39;s no better place to do that than one of your own sites.</p>
<p>I have to be honest though, I&#39;ve never really considered the downsides to Media Queries/RWD until Luke&#39;s opinion exploded all over Twitter today &#8211; that is, applying RWD techniques in a desktop environment &#8211; forcing users to view what is essentially supposed to be the mobile &quot;version&quot; of the site, with no other viewing choices available to them.</p>
<p>There are certainly cases where this would be undesirable to the user. Now, you could just adjust the media queries so that don&#39;t apply to the desktop environment (using <strong>max-device-width</strong>, for example), but what about those users who do in fact <em>want</em> the RWD environment on their desktop?</p>
<p>My solution is to offer a simple Javascript toggle function to the site to allow users to choose the experience they want. So, the RWD layout is active by default, but if the user resizes their browser and doesn&#39;t like the layout changes, they can simply disable the effects &#8211; basically toggling media queries on and off &#8211; not unlike the style switchers that were commonplace a few years ago.</p>
<p>My code is written for jQuery, but is so simple that I&#39;m sure it could be easily ported to other libraries (and of course just plain old JS) by those more experienced with Javascript than I am. If you have another solution then please do let me know in the comments section below.</p>
<pre>$(document).ready(function () {
    $(&quot;#togglerwd&quot;).click(function (e) {
        e.preventDefault();
        $(&#39;body&#39;).toggleClass(&quot;rwd&quot;);
    });
});</pre>
<h3>How It Works</h3>
<pre>$(&quot;#togglerwd&quot;).click(function (e) {</pre>
<p>This first line sets up the click event for an element with the &quot;togglerwd&quot; ID. You will need to add a link in your HTML which will essentially be your toggle &quot;button&quot;/text link:</p>
<pre>&lt;a href=&quot;#&quot; id=&quot;togglerwd&quot;&gt;Toggle Responsive Layout&lt;/a&gt;</pre>
<p>Next, we <a href="http://fuelyourcoding.com/jquery-events-stop-misusing-return-false/" target="_blank">disable the browser&#39;s default onclick behavior</a> for the &quot;#&quot; link (which will stop the page from jumping to the top):</p>
<pre>e.preventDefault();</pre>
<p>Before finally toggling a class for the element:</p>
<pre>$(&#39;body&#39;).toggleClass(&quot;rwd&quot;);</pre>
<p>Remember to give your a class of &quot;rwd&quot; (or whatever hook you use) by default, which will make sure the responsive layout is enabled by default.</p>
<p>We now have a class we can apply to our media query rules which will allow the toggle to work. All we need to do is write the media query rules as normal, prefixing each with &quot;.rwd&quot; so they only apply when the responsive layout is active:</p>
<pre>@media only screen and (max-width: 480px) {
    .rwd #wrapper {background-image:none;padding:0 10px 10px 10px;}
}</pre>
<p>Don&#39;t forget you should use the same class prefix to style up the toggle button to give visual feedback to the user as to whether &quot;RWD mode&quot; is active or not.</p>
<h3>Saving the Preference</h3>
<p>So, our toggle feature is all working well &#8211; but what about on a more complex site with different pages? Or what if the user doesn&#39;t ever want to see the site in &quot;mobile mode&quot; every time he or she revisits the site?</p>
<p>To do this, we need to store the user&#39;s preference in a cookie which will be updated each time the toggle button is pressed.</p>
<p>Thanks to jQuery, and a plugin called <a href="http://plugins.jquery.com/project/Cookie" target="_blank">Cookie</a>, this is really simple to implement &#8211; just a few lines of code (the plugin can be packed pretty small) and a few changes to our script, and we&#39;re all set:</p>
<pre>$(document).ready(function () {
    var rwdcookie = $.cookie(&#39;rwdcookie&#39;);
    if (rwdcookie == &#39;rwdoff&#39;) {
        $(&#39;body&#39;).removeClass(&quot;rwd&quot;);
    }
    $(&quot;#togglerwd&quot;).click(function (e) {
        e.preventDefault();
        $(&#39;body&#39;).toggleClass(&quot;rwd&quot;);
        if ($(&#39;body&#39;).is(&#39;.rwd&#39;)) {
            $.cookie(&#39;rwdcookie&#39;, &#39;rwdon&#39;);
        } else {
            $.cookie(&#39;rwdcookie&#39;, &#39;rwdoff&#39;);
        }
    });
});</pre>
<p>Our new code first checks for the status of the cookie &#8211; if it&#39;s available and RWD has previously been disabled, then it will immediately remove the .rwd class from the layout, setting the user&#39;s preference.</p>
<p>Next, if the click/toggle event is fired, we first check to see if the body class now has &quot;.rwd&quot; applied to it. If so, then we write the &quot;on&quot; preference, otherwise we set the preference to &quot;off&quot;. There&#39;s probably a cleaner way to do this, but I&#39;m no JS guru, and this did what I needed it to do. I&#39;m always interested in cleaner solutions though &#8211; so please let me know if you have an alternative method!</p>
<p>And that&#39;s it &#8211; one Reponsive Web Design layout toggler with cookie storage all ready to go. Try it out for yourself at <a href="http://toolboxdigital.com/geekkarting" target="_blank">toolboxdigital.com/geekkarting</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2011/06/making-responsive-web-design-optional/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fixing &quot;Unable to allocate memory for pool&quot; PHP error in Magento</title>
		<link>http://toolboxdigital.com/2011/05/fixing-unable-to-allocate-memory-for-pool-php-error-in-magento/</link>
		<comments>http://toolboxdigital.com/2011/05/fixing-unable-to-allocate-memory-for-pool-php-error-in-magento/#comments</comments>
		<pubDate>Wed, 25 May 2011 15:03:30 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Magento]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=762</guid>
		<description><![CDATA[Having Magento problems? This solution may help get you up and running again!]]></description>
			<content:encoded><![CDATA[<h4>I recently took a look at a Magento website that was having frequently recurring periods of inaccessibility.</h4>
<p>During the initial discussions it was determined that the &quot;outages&quot; were in fact PHP script errors, which in some server configurations are disabled by default, displaying a rather useless blank white screen instead.</p>
<p><span id="more-762"></span></p>
<p><img alt="" class="alignnone size-full wp-image-763" src="http://toolboxdigital.com/wp-content/uploads/2011/05/magento-closed.jpg" title="Magento - Sorry, We're Closed" /></p>
<p>You can easily enable error reporting by using a local PHP override either in a php.ini file or, if that won&#39;t work, setting PHP flags inside your .htaccess file:</p>
<pre>php_flag display_errors on</pre>
<p>As soon as the errors were being displayed, the problem was indeed revealed as a PHP script error:</p>
<pre>Warning: include_once() [function.include-once]: Unable to allocate memory for pool. in /var/www/vhosts/httpdocs/app/Mage.php on line 49</pre>
<p>Whilst not immediately useful, it does at least provide some food for Google in order to begin a search for potential solutions. During this research phase, I actually turned up very little relating to Magento specifically, but there was quite a lot of information in relation to PHP. In many cases, an Apache module known as &quot;APC&quot; kept cropping up. Apache APC (<a href="http://php.net/manual/en/book.apc.php" target="_blank">&quot;Alternative PHP Cache&quot;</a>) is &quot;a free and open opcode cache for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code.&quot;.</p>
<p>A quick check of server options using phpinfo(); confirmed that APC was indeed running on the server.</p>
<h3>The Solution: Disable APC</h3>
<p>I find the Magento&#39;s cache system quite comprehensive, and set-up correctly should provide an adequate caching system/performance boost for your Magento site. If you have alternative thoughts or can offer more information on how APC can benefit a site, I&#39;d welcome your comments.</p>
<p>So, in this case, I decided to disable the APC module for this particular virtual host on the server (this way it&#39;s still available for other sites running on the server). Disabling the module is very simple, and easy enough to re-enable if you need to do so in the future. It requires another line added to your .htaccess file:</p>
<pre>php_flag apc.cache_by_default Off</pre>
<p>You can re-run phpinfo(); again to confirm the APC is disabled correctly &#8211; and of course, test the live site to see if it fixes your problem!</p>
]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2011/05/fixing-unable-to-allocate-memory-for-pool-php-error-in-magento/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>CSS3 Experiments #2: Polaroids</title>
		<link>http://toolboxdigital.com/2011/03/css3-experiments-2-polaroids/</link>
		<comments>http://toolboxdigital.com/2011/03/css3-experiments-2-polaroids/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 10:44:49 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[effects]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=756</guid>
		<description><![CDATA[Learn how to make Polaroid-style images complete with 3D shadows using only CSS.]]></description>
			<content:encoded><![CDATA[<h4>The second in my series of CSS3 experiments takes the brilliant <a href="http://www.matthamm.com/box-shadow-curl.html" target="_blank">Page Curl Effect code from Matt Hamm</a> and uses it to display a couple of images in a Polaroid style, using CSS3 box-shadow and transforms (skew,rotate).</h4>
<p>It&#39;s just another example of how you can do cool stuff in CSS3 where you&#39;d normally have no choice but to rely on images.</p>
<p>The other cool thing here is that we have loads more flexibility since we&#39;re just using ordinary images which are manipulated by the CSS &#8211; so we could use dynamic images, or slideshows quite easily inside the polaroid design, and the CSS takes care of all the tricky bits for us.</p>
<p><span id="more-756"></span></p>
<p><a href="http://toolboxdigital.com/experiments/polaroids/index.html" target="_blank"><img alt="CSS3 Polaroids" class="alignnone size-full wp-image-757" src="http://toolboxdigital.com/wp-content/uploads/2011/03/polaroids.jpg" title="CSS3 Polaroids" /></a></p>
<p><strong><a href="http://toolboxdigital.com/experiments/polaroids/index.html" target="_blank">View the Live Demo here.</a></strong></p>
<h3>First Things First</h3>
<p>As before, we&rsquo;re using CSS3 here so you&rsquo;ll need to view the demo in a browser that supports the effects (namely gradients and box-shadow). I recommend the latest versions of Firefox, Safari or Chrome &ndash; I&rsquo;m afraid I&rsquo;ve not tested beyond these browsers, but as long as yours supports the properties above then there should be no problem.</p>
<h3>The Code</h3>
<p>Here&#39;s the HTML we&#39;ll be using for this experiment:</p>
<pre class="brush:php">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;CSS Test&lt;/title&gt;
	&lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; type=&quot;text/css&quot; /&gt;
&lt;/head&gt;

&lt;body&gt;
	&lt;div class=&quot;canvas&quot;&gt;
		&lt;ul class=&quot;box left&quot;&gt;
  			&lt;li&gt;
  				&lt;img src=&quot;flower.jpg&quot; width=&quot;300&quot; height=&quot;380&quot; alt=&quot;&quot; /&gt;
  			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;ul class=&quot;box right&quot;&gt;
  			&lt;li&gt;
  				&lt;img src=&quot;shells.jpg&quot; width=&quot;300&quot; height=&quot;380&quot; alt=&quot;&quot; /&gt;
  			&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>You can replace the IMG files with your own images of course. Remember to size them according to the dimensions set-out in the CSS, minus the top, bottom, left and right borders (all 10px each).</p>
<p>Here&#39;s the CSS to work the magic:</p>
<pre class="brush:css">.canvas {
	position:relative;
	margin:50px auto 0 auto;
	width:540px
}

ul.box {
	top:25px;
	position:absolute;
	margin: 0;
	padding: 0;
	clear: both;
	-webkit-transform: rotate(-20deg);
	-moz-transform: rotate(-20deg);
	z-index:1;
}

ul.right {
	-webkit-transform: rotate(10deg);
	-moz-transform: rotate(10deg);
	left:240px;
	top:0;
	z-index:2;
}

ul.left:hover {z-index:3;}

ul.box li {
	list-style-type: none;
	margin: 0 30px 30px 0;
	padding: 0;
	width: 320px;
	height: 400px;
	border: 1px solid #efefef;
	position: relative;
	float: left;
	background: #ffffff; /* old browsers */
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
	-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.1) inset;
	-moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
}

ul.box li:after {
	z-index: -1;
	position: absolute;
	background: transparent;
	width: 70%;
	height: 55%;
	content: &#39;&#39;;
	right: 19px;
	bottom: 10px;
	transform: skew(15deg) rotate(6deg);
	-webkit-transform: skew(15deg) rotate(6deg);
	-moz-transform: skew(15deg) rotate(6deg);
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
	-webkit-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
	-moz-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6); }

ul.box li:before {
	z-index: -2;
	position: absolute;
	background: transparent;
	width: 70%;
	height: 55%;
	content: &#39;&#39;;
	left: 19px;
	bottom: 10px;
	transform: skew(-15deg) rotate(-6deg);
	-webkit-transform: skew(-15deg) rotate(-6deg);
	-moz-transform: skew(-15deg) rotate(-6deg);
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
	-webkit-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
	-moz-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6); }

ul.box img {
	border:10px solid #fff;
	width:300px;
	height:380px;
}
</pre>
<p><strong><a href="http://toolboxdigital.com/experiments/polaroids/index.html" target="_blank">View the Demo.</a></strong></p>
<p>Feel free to experiment with different dimensions for the boxes; remember you&#39;ll probably need to adjust the <strong>left</strong>,<strong>right</strong> and <strong>bottom</strong> position values for the shadows (which are created in the <strong>li:before</strong> and <strong>li:after</strong> definitions), or else they may not sit properly in your corners.</p>
<p>You can also adjust the shape and intensity of the shadows by tweaking the transform and RGBa opacity values in the same properties.</p>
<p>Used this code in your own project or experiment? We&#39;d love to see what you&#39;ve done &#8211; let us know!</p>
]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2011/03/css3-experiments-2-polaroids/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSS3 Experiments #1: 3D Gradient Box</title>
		<link>http://toolboxdigital.com/2011/03/css3-3d-gradient-box/</link>
		<comments>http://toolboxdigital.com/2011/03/css3-3d-gradient-box/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 22:35:55 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[effects]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=753</guid>
		<description><![CDATA[Discover how to make your own 3D box using gradients and shadows with the power of CSS.]]></description>
			<content:encoded><![CDATA[<h4>Feeling inspired by <a href="http://www.stuffandnonsense.co.uk/" target="_blank">Andy Clarke&#39;s</a> truly excellent <a href="http://fivesimplesteps.com/books/hardboiled-web-design" target="_blank"><strong>Hardboiled Web Design</strong></a>, and after seeing some cool CSS3 experiments from <a href="http://alwaystwisted.com/" target="_blank">Stu Robson</a> (a recommended <a href="http://twitter.com/sturobson" target="_blank">Twitter follow</a> if you want to see other CSS3 experiments), I began wondering what effects I could reproduce in pure CSS where I&#39;d normally use graphics.</h4>
<p>One such effect is a box, with an applied gradient to it, and an elliptical shadow. These combined effects give the impression that the box is lifting in the middle, giving a shadow beneath.</p>
<p>Here&#39;s <a href="http://toolboxdigital.com/experiments/3d-gradient-box/" target="_blank">how I did it in CSS</a>.</p>
<p><span id="more-753"></span></p>
<p><img alt="CSS3 Gradient 3d Box" class="alignnone size-full wp-image-755" src="http://toolboxdigital.com/wp-content/uploads/2011/03/css3box.jpg" title="CSS3 Gradient 3d Box" width="774" /></p>
<h3>First Things First</h3>
<p>We&#39;re using CSS3 here so you&#39;ll need to view the <a href="http://toolboxdigital.com/experiments/3d-gradient-box/" target="_blank">demo</a> in a browser that supports the effects (namely gradients and box-shadow). I recommend the latest versions of Firefox, Safari or Chrome &#8211; I&#39;m afraid I&#39;ve not tested beyond these browsers, but as long as yours supports the properties above then there should be no problem.</p>
<p>Of course, there&#39;s nothing to stop you using this effect on projects now, just remember that older browsers won&#39;t be able to see the goodies.</p>
<h3>The Code</h3>
<p>Here&#39;s the HTML we&#39;ll need for our page:</p>
<pre class="brush:php">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;CSS 3D Box Test&lt;/title&gt;
	&lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; type=&quot;text/css&quot; /&gt;
&lt;/head&gt;

&lt;body&gt;
	&lt;div class=&quot;box&quot;&gt;
		&lt;div class=&quot;box-shadow&quot;&gt;&lt;/div&gt;
		&lt;div class=&quot;box-gradient&quot;&gt;
			...some content can go here...
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>And the CSS:</p>
<pre class="brush:css">.box {
	position:relative;
	width:600px;
	height:300px;
	margin:100px auto 0 auto;
}

.box-gradient {
	position:absolute;
	width:100%;
	height:100%;
	border-radius:10px;
	-moz-border-radius:10px;
	-webkit-border-radius:10px;
	background: -moz-linear-gradient(left, #CCCCCC 0%, #EEEEEE 50%, #EEEEEE 50%, #CCCCCC 100%);
	background: -webkit-gradient(linear, left top, right top, color-stop(0%,#CCCCCC),color-stop(50%,#EEEEEE), color-stop(50%,#EEEEEE), color-stop(100%,#CCCCCC));
}

.box-shadow {
	position:absolute;
	left:50%;
	margin:400px 0 0 -290px;
	bottom:10px;
	width:580px;
	height:16px;
	background:#fff;
	border-radius:290px / 8px;
	-moz-border-radius:290px / 8px;
	-webkit-border-radius:290px / 8px;
	box-shadow:0 10px 20px #000;
	-moz-box-shadow:0 10px 20px #000;
	-webkit-box-shadow:0 10px 20px #000;
}</pre>
<p>Don&#39;t forget to <a href="http://toolboxdigital.com/experiments/3d-gradient-box/" target="_blank">check out the live demo</a> to see if working for real in your browser, and examine the source code to see how it all fits together. You can also generate more exaggerated shading effects by altering the gradient values and vertical positioning of the shadow DIV.</p>
<p>Please do share your experiments in the comments, I&#39;d love to see more examples of how CSS can be used to enhance a site&#39;s design without the need for images.</p>
]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2011/03/css3-3d-gradient-box/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Advanced WordPress sub-navigation using wp_list_pages</title>
		<link>http://toolboxdigital.com/2010/11/advanced-wordpress-sub-navigation-using-wp_list_pages/</link>
		<comments>http://toolboxdigital.com/2010/11/advanced-wordpress-sub-navigation-using-wp_list_pages/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 14:37:19 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=710</guid>
		<description><![CDATA[I present a technique for layered navigation/split menus in WordPress.]]></description>
			<content:encoded><![CDATA[<h4>We recently worked on a site development for <a href="http://evolve-od.co.uk">evolveOD</a> which needed a 3-level navigation structure, the top-level being the main navigation menu, with levels 2 and 3 displayed in the sidebar.</h4>
<p>Whilst <strong>wp_nav_menu</strong> allows us to build such complex multi-tiered menus, it unfortunately doesn&#39;t (yet) let us have as much flexibility as we sometimes need &#8211; for building more flexible split-level menus, for example.</p>
<p><span id="more-710"></span></p>
<p><img alt="Evolve OD" class="alignnone size-full wp-image-712"  src="http://toolboxdigital.com/wp-content/uploads/2010/11/eod.jpg" title="Evolve OD" /></p>
<p>For this method we use a combination of careful page-hierarchy assignments and wp_list_pages to render the output in the sidebar.</p>
<h3>Building the Hierarchy</h3>
<p>First, you will need to make sure your pages are correctly assigned for this to work. This is done by simply assigning your sub-navigation pages as child pages of the top-level page (navigation parent).</p>
<p>For example, our navigation structure might be this:</p>
<p>Products<br />
	&nbsp;&nbsp;&nbsp; &#8211; Toy Cars<br />
	&nbsp;&nbsp;&nbsp; &#8211; Lego<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- Technic<br />
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- Atlantis<br />
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- Lego City<br />
&nbsp;&nbsp;&nbsp;&nbsp;- Dolls</p>
<p>Our page hierarchy must then echo this same structure by assigning your pages to the appropriate parent page.</p>
<h3>Pre-requisites</h3>
<p>This code uses the is_subpage() function to determine the parent page ID. To install this, simply copy the code below into your template&#39;s functions.php file:</p>
<pre class="brush:php">function is_subpage() {
global $post;
if ( is_page() &amp;&amp; $post-&gt;post_parent ) {
$parentID = $post-&gt;post_parent;
return $parentID;
} else {
return false;
};
};
</pre>
<h3>The Code</h3>
<p>Here&#39;s the code that generates the sub-navigation (level 2-3). It should be placed in the sidebar, or wherever you want the sub-navigation to appear:</p>
<pre class="brush:php">&lt;?php
$subPage = is_subpage();
$ancestor = $post-&gt;ancestors[1];
if ($subPage) : // we&#39;re on a sub-page:
if ($ancestor) : // we&#39;re a sub-sub nav item...
echo &quot;&lt;ul class=\&quot;page-list\&quot;&gt;&quot;;
wp_list_pages(&quot;title_li=&amp;child_of=$ancestor&amp;sort_column=menu_order&quot;);
echo &quot;&lt;/ul&gt;&quot;;
else :
echo &quot;&lt;ul class=\&quot;page-list\&quot;&gt;&quot;;
wp_list_pages(&quot;title_li=&amp;child_of=$subPage&amp;sort_column=menu_order&quot;);
echo &quot;&lt;/ul&gt;&quot;;
endif;
endif;
?&gt;
</pre>
<p>Don&#39;t forget to style the menu list as you need to via the main stylesheet.</p>
<h3>Alternative Plug-in</h3>
<p>There&#39;s a great little plug-in you might want to try first, called &quot;Gecka Submenu&quot;:</p>
<p><a href="http://gecka-apps.com/wordpress-plugins/gecka-submenu-pro/" target="_blank">http://gecka-apps.com/wordpress-plugins/gecka-submenu-pro/</a></p>
<p>It utilised the wp_nav_menu function to generate split menus, so in some ways is easier to organize and change your navigation. Unfortunately though, what it cannot seem to do is give a persistent split menu on the bottom-level menu &#8211; so if you are browsing the 3rd level menu, since there are no menus in the structure beyond this level, the menu disappears.</p>
<p>Our solution enables the 3rd level to always remain active, which in most cases, is what you need it to do.</p>
<p><strong>Have any ideas or feedback? We&#39;d love to hear from you, so leave us a comment.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2010/11/advanced-wordpress-sub-navigation-using-wp_list_pages/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Disabling Google Analytics for front-end Administrators in Joomla</title>
		<link>http://toolboxdigital.com/2010/03/disabling-google-analytics-for-front-end-administrators-in-joomla/</link>
		<comments>http://toolboxdigital.com/2010/03/disabling-google-analytics-for-front-end-administrators-in-joomla/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 10:26:29 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=610</guid>
		<description><![CDATA[Stop your Joomla site administrators from being tracked in Google Analytics with this simple snippet of code.]]></description>
			<content:encoded><![CDATA[<h4>A good question, raised by <a href="https://twitter.com/jackbremer/status/10015777644">Jack Bremer</a>, prompted the writing of this brief post in case it&#39;s of use to somebody else at some point (including myself).</h4>
<p>The GA plugin in WordPress has this option, which is great for larger sites with loads of front-end admins all working on the site &#8211; you don&#39;t want to be diluting your Analytics with all that noise.</p>
<p>So, how can the same be acheived in Joomla? Well, quite easily actually. Read on to find out how&#8230;</p>
<p><span id="more-610"></span></p>
<p><img alt="Google Analytics" class="alignnone size-full wp-image-627" src="http://toolboxdigital.com/wp-content/uploads/2010/03/ga-shot.jpg" title="Google Analytics" /></p>
<h3>Modify the Template</h3>
<p>For this to work we will need to make a simple logic change in the site&#39;s template index.php file, which you can find in template/your_template directory of your site. First we&#39;ll need to get the $user variable loaded into the template, so, near the top, add the following line of PHP:</p>
<pre class="brush:php">$user =&amp; JFactory::getUser();
</pre>
<p>This will load an array of variables into $user that we can use to determine who&#39;s currently logged-on to the front-end of your website. The particular value we&#39;re looking for is the User ID, contained in $user-&gt;gid (the current user&#39;s Group ID) &#8211; this value is zero (false) if a guest is browsing the site, but will be a specific figure depending on which group they are assigned to when logged-on.</p>
<h3>Add the logic code</h3>
<p>Next step is to locate your GA tracking code, which should be right at the bottom of your index.php file, just before the tag. We need to wrap this in some PHP test code to selectively load the tracking script based on the outcome of our condition, so first locate your tracking code which will look like this:</p>
<pre class="brush:javascript">&lt;script type=&quot;text/javascript&quot;&gt;
var gaJsHost = ((&quot;https:&quot; == document.location.protocol) ? &quot;https://ssl.&quot; : &quot;http://www.&quot;);
document.write(unescape(&quot;%3Cscript src=&#39;&quot; + gaJsHost + &quot;google-analytics.com/ga.js&#39; type=&#39;text/javascript&#39;%3E%3C/script%3E&quot;));

&lt;script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-12345678");
pageTracker._trackPageview();
} catch(err) {}&lt;/script>
</pre>
<p>Then add the PHP test to selectively load the scripts, which looks like this:</p>
<pre class="brush:php">&lt;?php if (!$user-&gt;gid == 25) : ?&gt;

&lt;script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/script>
&lt;script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-12345678");
pageTracker._trackPageview();
} catch(err) {}&lt;/script>

&lt;?php endif; ?&gt;
</pre>
<p>This example above will disable the GA tracking code only for Super Administrators logged-on to the front end. You can add your own test conditions depending on your requirements, by using the list below as a reference for the group to test:</p>
<ul class="chev">
<li>18 &#8211; Registered</li>
<li>19 &#8211; Author</li>
<li>20 &#8211; Editor</li>
<li>21 &#8211; Publisher</li>
<li>23 &#8211; Manager</li>
<li>24 &#8211; Administrator</li>
<li>25 &#8211; Super Administrator</li>
</ul>
<p>&nbsp;</p>
<p><strong>Disable tracking for anyone who isn&#39;t a guest user (not logged-on):</strong></p>
<pre class="brush:php">if (!$user) :
</pre>
<p><strong>Disable tracking for all back-end users:</strong></p>
<pre class="brush:php">if (!$user == 23 || !$user == 24 || !$user == 25) :
</pre>
<p><strong>Disable tracking for all registered users:</strong></p>
<pre class="brush:php">if (!$user == 18) :
</pre>
<p>I&#39;m sure you get the gist!</p>
<p><strong>Got a better idea or know of a plugin that can do this for you? Please share it in the comments, we&#39;d love to hear your ideas!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2010/03/disabling-google-analytics-for-front-end-administrators-in-joomla/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Advanced Techniques: The Joomla Parent Menu ItemID</title>
		<link>http://toolboxdigital.com/2010/03/advanced-techniques-the-joomla-parent-menu-itemid/</link>
		<comments>http://toolboxdigital.com/2010/03/advanced-techniques-the-joomla-parent-menu-itemid/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 22:50:56 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=411</guid>
		<description><![CDATA[Using Joomla's getMenu() function to apply top-level cascading styling for parent menus.]]></description>
			<content:encoded><![CDATA[<h4>Joomla&#39;s ItemID system offers a great way of customizing sites by giving the opportunity to style major parts of a template or page based on the menu links ItemID.</h4>
<p>Every menu link in a Joomla website has one; and they are unique to each and every link on your site.</p>
<p>But what if you need to style entire sections of a site based on a handful of top-level (parent) menu items?</p>
<p>This article explores the methodology of styling sub-level pages respective of their common parent menu links.</p>
<p><span id="more-411"></span></p>
<p><img alt="menusystem" class="alignnone size-full wp-image-487" src="http://toolboxdigital.com/wp-content/uploads/2010/01/menusystem.jpg" title="menusystem" /></p>
<h3>Method 1: Modifying the mod_breadcrumb Module Code</h3>
<p>The mod_breadcrumb module is native to Joomla, and by it&#39;s core function maintains a trail of menu link hierarchy leading to the current page. This code can be utilized in order to obtain the top-level menu&#39;s textual name (rather than an itemID number). This method expands the code further to reformat this text into a usable, readable format which can be used to style a page in an understandable way. It&#39;s more code-heavy than method 2, but provides an easier-to-understand output that works in exactly the same way.</p>
<p>Let&#39;s first examine the original code:</p>
<pre class="brush:php">defined(&#39;_JEXEC&#39;) or die(&#39;Restricted access&#39;);

class modBreadCrumbsHelper
{
	function getList(&amp;$params)
	{
		global $mainframe;

		// Get the PathWay object from the application
		$pathway =&amp; $mainframe-&gt;getPathway();
		$items   = $pathway-&gt;getPathWay();

		$count = count($items);
		for ($i = 0; $i &lt; $count; $i ++)
		{
			$items[$i]-&gt;name = stripslashes(htmlspecialchars($items[$i]-&gt;name));
			$items[$i]-&gt;link = JRoute::_($items[$i]-&gt;link);
		}

		if ($params-&gt;get(&#39;showHome&#39;, 1))
		{
			$item = new stdClass();
			$item-&gt;name = $params-&gt;get(&#39;homeText&#39;, JText::_(&#39;Home&#39;));
			$item-&gt;link = JURI::base();
			array_unshift($items, $item);
		}

		return $items;
	}

	function setSeparator($custom = null)
	{
		global $mainframe;

		$lang =&amp; JFactory::getLanguage();

		if ($custom == null) {
			if($lang-&gt;isRTL()){
				$_separator = JHTML::_(&#39;image.site&#39;, &#39;arrow_rtl.png&#39;);
			}
			else{
				$_separator = JHTML::_(&#39;image.site&#39;, &#39;arrow.png&#39;);
			}
		} else {
			$_separator = $custom;
		}
		return $_separator;
	}
}
</pre>
<p>We can immediately remove the second part of the code that sets the separator, since we don&#39;t need that. Also, since we only need to return the parent item&#39;s text, we don&#39;t need the loop in place. We shall also use the <em>Application Object</em> since<br />
	<strong>$global mainframe</strong> will be removed in Joomla 1.6, so:</p>
<pre class="brush:php">$global mainframe;
</pre>
<p>Becomes:</p>
<pre class="brush:php">$app = &amp;JFactory::getApplication();
</pre>
<p>Which gives us the completed code below:</p>
<pre class="brush:php">class getParentMenuTitle {
	function getList() {
		$getParent = &amp;JFactory::getApplication();
		// Get the PathWay object
		$pathway =&amp; $getParent-&gt;getPathway();
		$items = $pathway-&gt;getPathWay();
	return $items;
	}
}
$list = getParentMenuTitle::getList();
$count = count($list);
if ($count !== 0) :
	$parentmenu = $list[0]-&gt;name;
	$parentmenu = ereg_replace(&quot; &quot;, &quot;-&quot;, $parentmenu); // replace spaces with a dash
	$parentmenu = ereg_replace(&quot;[^+A-Za-z0-9-]&quot;, &quot;&quot;, $parentmenu); // strip special characters
	$parentmenu = strtolower($parentmenu); //set name to lowercase
else :
	$parentmenu = &quot;home&quot;; // Set parentmenu to &quot;home&quot; if there are no items
endif;
</pre>
<h3>How To Use The Code</h3>
<p>This block of code can be inserted directly into your active template&#39;s <strong>index.php</strong> file before the HTML is started. Remember to enclose the code block in PHP tags. Alternatively you can include it from an external file.</p>
<p>Once working in the template, you can apply the variable <strong>$parentmenu</strong> to a top-level container to initiate a CSS hook. Where you add this will depend on what you need to influence in the design, but the further up the hierarchy the more things you will be able to affect in the design &#8211; for example:</p>
<pre class="brush:php">&lt;body id=&quot;&lt;?php echo $parentmenu; ?&gt;&quot;&gt;
</pre>
<p>&#8230;will allow you to influence the design across the whole template, such as:</p>
<pre class="brush:css">body#menu-link-name a {color:red;}
</pre>
<p>&#8230;which will change all links on the page to red for that particular top-level menu link.</p>
<h3>Method 2: Using the Jsite Object</h3>
<p>This method is by far the simplist of the two methods, and unless you need a more human-readable format for the menu class/ids then it&#39;s by far the recommended method of the two. It uses the Jsite object to obtain the parent menu&#39;s ItemID and stores it in a variable which can then be applied to any class/id in the template:</p>
<pre class="brush:php">$parentmenu = JSite::getMenu()-&gt;getActive()-&gt;tree[0];
</pre>
<p>You can obtain the ItemID of any menu links in the pathway by altering the value of <strong>tree[0]</strong>.</p>
<h3>How To Use The Code</h3>
<p>Again, this code needs to be inserted into the template. The ItemID is stored in the <strong>$parentmenu</strong> variable, just as it was before, so you can use a similar method to above &#8211; but prefix the class/id with something or else you may have problems, for example:</p>
<pre class="brush:php">&lt;body id=&quot;menuID-&lt;?php echo $parentmenu; ?&gt;&quot;&gt;
</pre>
<h3>Why Would You Need To Use Method 1?</h3>
<p>The first method could be useful in instances where you (as the developer) might want to pass more control onto someone who is less technically-minded &#8211; the class/id names which are generated using this method are very easy to predict, whereas method 2 requires the administrator to lookup the itemID for each menu item that requires styling.</p>
<h3>Something to Share?</h3>
<p>Have an alternative technique, or have you used this (or something similar) on a site before? Please do share it in the comments.</p>
<p><span class="small">Many thanks to <a href="http://joomline.org/">Gergő Erdősi</a> and <a href="http://www.alltogetherasawhole.org">Amy Stephen</a> for the code presented in method 2 above.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2010/03/advanced-techniques-the-joomla-parent-menu-itemid/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Ten Useful Mac Apps For Web Development</title>
		<link>http://toolboxdigital.com/2010/01/ten-useful-mac-apps-for-web-development/</link>
		<comments>http://toolboxdigital.com/2010/01/ten-useful-mac-apps-for-web-development/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 14:46:21 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=490</guid>
		<description><![CDATA[We've compiled a list of our most used development-centric applications for Mac - here's our top ten!]]></description>
			<content:encoded><![CDATA[<h4>We&#39;ve compiled a list of our most used development-centric applications for Mac, from coding to design tools &#8211; here are our ten favourites!</h4>
<p><span id="more-490"></span></p>
<h3>Panic Coda</h3>
<p>Web: <strong><a href="http://panic.com/coda">panic.com/coda</a></strong> | License: <strong>Commercial, $99</strong></p>
<p><img alt="Coda" class="size-full" src="http://toolboxdigital.com/wp-content/uploads/2010/01/coda-ss.jpg" title="coda-ss" /></p>
<p>All the coding tools you could need in one place, including syntax-highlighted editing of all major code-types such as PHP, CSS, HTML, Ruby, Javascript, XML and more. I particularly love the excellent Site Manager which stores all of your sites in one place and provide easy access for direct, live editing of the site code using FTP, and the clips manager that serves as a snippets repository for reusable code.</p>
<h3>Filezilla</h3>
<p>Web: <a href="http://filezilla-project.org/"><strong>filezilla-project.org</strong></a> | License: <strong>Free</strong></p>
<p><img alt="filezilla" class="size-full" src="http://toolboxdigital.com/wp-content/uploads/2010/01/filezilla-ss.jpg" title="filezilla-ss" /></p>
<p>Simple to use and packed with great features &#8211; one of the best free FTP clients out there.</p>
<h3>Adobe Fireworks</h3>
<p>Web: <a href="http://www.adobe.com/products/fireworks/"><strong>www.adobe.com/products/fireworks</strong></a> | License: <strong>Commercial, ~$299</strong></p>
<p><img alt="fireworks" class="alignnone size-full wp-image-499" src="http://toolboxdigital.com/wp-content/uploads/2010/01/fireworks-ss.jpg" title="fireworks-ss" /></p>
<p>Easy to use graphics editor with the best support for PNGs for web use. Build rapid designs and slice them up ready to build into a template. Fireworks can also handle (most) Photoshop PSDs with ease, so it&#39;s particularly useful if you work with designers who prefer to work in Photoshop.</p>
<h3>VMware Fusion</h3>
<p>Web: <a href="http://www.vmware.com/products/fusion/"><strong>www.vmware.com/products/fusion</strong></a> | License: <strong>Commercial, $79.99</strong></p>
<p><img alt="vmware fusion" class="alignnone size-full wp-image-500" src="http://toolboxdigital.com/wp-content/uploads/2010/01/vmware-ss.jpg" title="vmware-ss" /></p>
<p>Set-up multiple operating systems which can be run in OS X without needing to reboot. Essential for effective cross-browser testing.</p>
<h3>MAMP</h3>
<p>Web: <a href="http://www.mamp.info"><strong>www.mamp.info</strong></a> | License: <strong>Free (Pro version: &pound;39)</strong></p>
<p><img alt="mamp" class="size-full" src="http://toolboxdigital.com/wp-content/uploads/2010/01/mamp-ss.jpg" title="mamp-ss" /></p>
<p>Localhost server environment to enable fast, live development &#8211; provides a one-click server running Apache, PHP and MySQL.</p>
<h3>Quicksilver</h3>
<p>Web: <a href="http://docs.blacktree.com/quicksilver/quicksilver"><strong>docs.blacktree.com/quicksilver/quicksilver</strong></a> | License: <strong>Free</strong></p>
<p><img alt="quicksilver" class="size-full" src="http://toolboxdigital.com/wp-content/uploads/2010/01/quicksilver-ss.jpg" title="quicksilver-ss" /></p>
<p>Quickly access all of your applications at the touch of a button &#8211; no more searching around in your Apps folder!</p>
<h3>Apple Time Machine</h3>
<p>Web: <a href="http://www.apple.com/macosx/what-is-macosx/time-machine.html"><strong>www.apple.com/macosx/what-is-macosx/time-machine.html</strong></a> | License: <strong>Free (ships with Mac OS X)</strong></p>
<p><img alt="time machine" class="alignnone size-full wp-image-504" src="http://toolboxdigital.com/wp-content/uploads/2010/01/timemachine-ss.jpg" title="timemachine-ss" /></p>
<p>The perfect incremental backup solution &#8211; and best of all, ships with OS X and is seamlessly integrated. Just add an external disk drive!</p>
<h3>Betterzip</h3>
<p>Web: <a href="http://macitbetter.com/"><strong>macitbetter.com</strong></a> | License: <strong>Shareware, $19.95</strong></p>
<p><img alt="betterzip" class="size-full" src="http://toolboxdigital.com/wp-content/uploads/2010/01/betterzip-ss.jpg" title="betterzip-ss" /></p>
<p>Brilliant archive utility offering a variety of formats and and easy-to-use interface.</p>
<h3>Skype</h3>
<p>Web: <a href="http://www.skype.com"><strong>www.skype.com</strong></a> | License: <strong>Free</strong></p>
<p><img alt="skype" class="size-full" src="http://toolboxdigital.com/wp-content/uploads/2010/01/skype.jpg" title="skype" /></p>
<p>Communicate with worldwide clients for free, or add a real phone number without needing a physical phone line.</p>
<h3>Process</h3>
<p>Web: <a href="http://www.jumsoft.com/process/"><strong>www.jumsoft.com/process</strong></a> | License: <strong>Shareware, $39</strong></p>
<p><img alt="process" class="alignnone size-full wp-image-507" src="http://toolboxdigital.com/wp-content/uploads/2010/01/process-ss.jpg" title="process-ss" /></p>
<p>Useful task-list and project tracking.</p>
]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2010/01/ten-useful-mac-apps-for-web-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Advanced Techniques: Mass Settings Changes In Joomla!</title>
		<link>http://toolboxdigital.com/2010/01/advanced-techniques-mass-settings-changes-in-joomla/</link>
		<comments>http://toolboxdigital.com/2010/01/advanced-techniques-mass-settings-changes-in-joomla/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 10:21:08 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=461</guid>
		<description><![CDATA[This article describes how you can perform mass settings changes in Joomla using a simple MySQL query.]]></description>
			<content:encoded><![CDATA[<h4>Ever need to do a bulk settings change to an established site in Joomla? Perhaps you forgot to make the changes as you were building the site?</h4>
<p><span id="more-461"></span></p>
<p>We recently worked on a development which already had a complex hierarchy of menu links set-up on the system (approx. 200 links), but realised later in the development that the &quot;SSL Enabled&quot; flag in the menu settings needed to be set to the &quot;Off&quot; setting in order to force the majority of the site to run in non-SSL mode:</p>
<p><img alt="ssl-off" class="size-full" src="http://toolboxdigital.com/wp-content/uploads/2010/01/ssl-off.jpg" title="ssl-off" /></p>
<p>The obvious solution is to go through each menu item one at a time at set this manually &#8211; but there&#39;s a risk that some may be missed, and of course, the time it would take to do this to 200+ links would be considerable.</p>
<p>So, instead, we set about using simple find &amp; replace commands, we can run a query directly on the database to do this for us in one step. The query we will be using has this structure:</p>
<p><strong>NOTE: Please ensure you make a full backup of your database before proceeding &#8211; if there&#39;s a problem, you will easily be able to restore the database and try again.</strong></p>
<p>update <strong>TABLE_NAME</strong> set <strong>FIELD_NAME</strong> = replace(<strong>FIELD_NAME</strong>, &#39;string to find&#39;, &#39;new string&#39;)</p>
<p>Use a program such as <a href="http://http://www.phpmyadmin.net" target="_blank">PHPMyAdmin</a> to easily make edits to your database. Most hosting providers give easy access to this via your hosting control panel &#8211; this will allow you to find the table/field names and run the query easily.</p>
<p>So, in our case, it&#39;s fairly obvious we&#39;ll find the setting we need to adjust in the <strong>jos_menu</strong> table, so, browse the table, then click the edit icon to open up the contents of one of the rows:</p>
<p><img alt="phpmyadmin" class="size-full" src="http://toolboxdigital.com/wp-content/uploads/2010/01/phpmyadmin.jpg" title="phpmyadmin" /></p>
<p>You&#39;ll see I&#39;ve indicated the bit we need to change on the image above &#8211; it&#39;s in the field named <strong>params</strong>. So, we now know the name of the table, and the field that we need to modify. The text to search for (in this case) will be &quot;secure=0&quot; (so, any menu SSL settings that are set to &quot;ignore&quot;), and the setting we need to change to (like on the diagram) is &quot;secure=-1&quot; (&quot;Off). If you&#39;re in any doubt as to the setting that&#39;s needed, just change it in Joomla and view the string in PHPMyAdmin.</p>
<p>This now allows us to construct the final query that we will run on the database:</p>
<pre class="brush:sql">update jos_menu set params = replace(params, &#39;secure=0&#39;, &#39;secure=-1&#39;)
</pre>
<p>Simple, isn&#39;t it?</p>
<p>To run the query, simply click the &quot;SQL&quot; tab in PHPMyAdmin, paste your query into the box, and click go. Once it&#39;s run successfully, log into the Joomla administrator and check that everything was changed as expected.</p>
]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2010/01/advanced-techniques-mass-settings-changes-in-joomla/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Anatomy of a Newsletter</title>
		<link>http://toolboxdigital.com/2010/01/anatomy-of-a-newsletter/</link>
		<comments>http://toolboxdigital.com/2010/01/anatomy-of-a-newsletter/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 11:12:59 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Newsletters]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=418</guid>
		<description><![CDATA[This article describes the basics for turning your newsletter designs into functional newsletters.]]></description>
			<content:encoded><![CDATA[<h4>Newsletter crafting can be pretty straightforward but cumbersome at times due to the way they must be constructed in order to retain the original designs &#8211; even more so if the designs are quite complex and laden with images.</h4>
<p><span id="more-418"></span></p>
<h3>Getting Started</h3>
<p>First off, work from a design so you know how the final construction will look. This can be a full-blown Photoshop mock-up, or a wireframe&#8230;however you make it, just make sure it&#39;s designed as you&#39;d like the final newsletter to appear.</p>
<p>Once your design is ready, you will need to create the framework of the newsletter, using HTML tables and a combination of carefully defined table-cells. You can save some time here by using a visual (WYSIWYG) editor such as Dreamweaver to visually create the layout; this will save a significant amount of time over hand-coding the table layout. In fact, you can use a visual editor to create the whole thing &#8211; but I personally prefer to see exactly what&#39;s going on, so tend to hand-code once the basic structure is defined.</p>
<p><img alt="table-layout" class="size-full" src="http://toolboxdigital.com/wp-content/uploads/2010/01/table-layout.jpg" title="table-layout" /></p>
<p>Note that the table I&#39;ve used here is quite narrow (600px) and centered &#8211; you can use your own dimensions and alignment here, but this arrangement seems to work best for most email clients and display resolutions.</p>
<p>I&#39;ve also left the border active (<strong>border=&quot;1&quot;</strong>) which will help when I add content to the layout. You can disable this later if you do not wish the borders to be displayed in the final newsletter.</p>
<h3>Adding Content</h3>
<p>Once you have your basic structure in place, you&#39;re ready to start adding content (text and images) to the newsletter. For now, don&#39;t worry about the styling; just add the bulk of the text and any images you have to the layout.</p>
<p>If you don&#39;t have final images, use exact-sized placeholders until the graphics are ready. This will help to get the layout exactly right, and show where any fine adjustments to the table layout is needed.</p>
<p>Images should be added using the absolute path to the server where they are stored:</p>
<pre class="brush:html">&lt;img src=&quot;http://mydomain.com/images/header.jpg&quot; alt=&quot;&quot; /&gt;
</pre>
<p>&#8230;this will ensure the images load correctly into the document. Note that many email clients will require user approval before they fully display embedded images &#8211; it is not possible to override this.</p>
<h3>Adding the Style</h3>
<p>This is where most of the time is consumed &#8211; actually adding the inline CSS to the layout in order to get the look to match the design you&#39;ve made. Inline styling offers the best and most widely compatible method to add styling to the newsletter. If you&#39;re comfortable with hand-coding the styles, this is the best way &#8211; but of course you can always use a visual editor&#8230;just keep an eye on the way the styling is added to the document &#8211; some editors (such as Dreamweaver) may define styles in a stylesheet format which won&#39;t work for the newsletter.</p>
<p>The styles must be applied to each and every element that needs to be altered from the default. You can of course apply a global style to the whole container (the main table definition) to set a standard font size/colour/style to start you off:</p>
<pre class="brush:html">&lt;table width=&#39;600px&#39; border=&#39;1&#39; cellspacing=&#39;0&#39; cellpadding=&#39;5&#39; align=&#39;center&#39; style=&#39;font-family: Georgia, &#39;Times New Roman&#39;, Serif; color: #222222; font-size: 13px&gt;
</pre>
<p>This will give you your text style for any text that does not have it&#39;s own definition. Much of the styling information will be applied to things like headers and links:</p>
<pre class="brush:html">&lt;h2 style=&quot;font-size:18px; font-weight:bold; color:#FF3300&quot;&gt;Here&#39;s My Title&lt;/h3&gt;
&lt;p&gt;Check out the following link:&lt;/p&gt;
&lt;a href=&quot;http://www.mylink.com&quot; style=&quot;color:#3F84BA; text-decoration:underline&quot;&gt;My Link&lt;/a&gt;
</pre>
<p>It is necessary to add all styling information in this way. You should also refrain from using shorthand CSS as some email clients will ignore this method of styling, such as:</p>
<pre class="brush:html">&lt;p style=&quot;font: bold 14px/120% Arial,Sans-Serif&quot;&gt;This is my paragraph.&lt;/p&gt;
</pre>
<h3>Viewing the Newsletter in Other Formats</h3>
<p>If your mass-mail system supports a plain-text version of the newsletter, you should take the time to create this alongside your HTML version so that users who cannot view mail in HTML format can still read the email.</p>
<p>If this is not practical or possible, provide a link to the HTML document on your server at the top of the email, this way readers who cannot properly view the newsletter will at least have the option to view the newsletter in their browser, which has a good chance of being rendered as you intended it.</p>
<p><a href="http://www.wickwarbrewing.co.uk/eflyer/december09e60a95f3f443e37f5a47210d9b340a05.html" target="_blank"><img alt="newsletter-example" class="alignnone size-full wp-image-441" src="http://toolboxdigital.com/wp-content/uploads/2010/01/newsletter-example.jpg" title="newsletter-example" /></a><br />
	<span class="caption">The finished example (click to view the actual document in your browser)</span></p>
]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2010/01/anatomy-of-a-newsletter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

