<?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>Toolbox Digital Services &#187; Design</title>
	<atom:link href="http://toolboxdigital.com/tag/design/feed/" rel="self" type="application/rss+xml" />
	<link>http://toolboxdigital.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 05 Aug 2010 09:15:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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[Joomla&#8217;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.  ...]]></description>
			<content:encoded><![CDATA[<p>Joomla&#8217;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.  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>
<span id="more-411"></span>
<p><img src="http://toolboxdigital.com/wp-content/uploads/2010/01/menusystem.jpg" alt="menusystem" title="menusystem" width="774" height="283" class="alignnone size-full wp-image-487" /></p>
<h3>Method 1: Modifying the mod_breadcrumb Module Code</h3>
<p>The mod_breadcrumb module is native to Joomla, and by it&#8217;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&#8217;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&#8217;s more code-heavy than method 2, but provides an easier-to-understand output that works in exactly the same way.</p>
<p>Let&#8217;s first examine the original code:</p>
<pre class="brush:php">
defined('_JEXEC') or die('Restricted access');

class modBreadCrumbsHelper
{
	function getList(&#038;$params)
	{
		global $mainframe;

		// Get the PathWay object from the application
		$pathway =&#038; $mainframe->getPathway();
		$items   = $pathway->getPathWay();

		$count = count($items);
		for ($i = 0; $i &lt; $count; $i ++)
		{
			$items[$i]->name = stripslashes(htmlspecialchars($items[$i]->name));
			$items[$i]->link = JRoute::_($items[$i]->link);
		}

		if ($params->get('showHome', 1))
		{
			$item = new stdClass();
			$item->name = $params->get('homeText', JText::_('Home'));
			$item->link = JURI::base();
			array_unshift($items, $item);
		}

		return $items;
	}
	
	function setSeparator($custom = null)
	{
		global $mainframe;

		$lang =&#038; JFactory::getLanguage();

		if ($custom == null) {
			if($lang->isRTL()){
				$_separator = JHTML::_('image.site', 'arrow_rtl.png');
			}
			else{
				$_separator = JHTML::_('image.site', 'arrow.png');
			}
		} else {
			$_separator = $custom;
		}
		return $_separator;
	}
}
</pre>
<p>We can immediately remove the second part of the code that sets the separator, since we don&#8217;t need that.  Also, since we only need to return the parent item&#8217;s text, we don&#8217;t need the loop in place.  We shall also use the <em>Application Object</em> since <strong><br />$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 = &#038;JFactory::getApplication();
</pre>
<p>Which gives us the completed code below:</p>
<pre class="brush:php">
class getParentMenuTitle {
	function getList() {
		$getParent = &#038;JFactory::getApplication();
		// Get the PathWay object
		$pathway =&#038; $getParent->getPathway();
		$items = $pathway->getPathWay();
	return $items;
	}
}
$list = getParentMenuTitle::getList();
$count = count($list);
if ($count !== 0) :
	$parentmenu = $list[0]->name;
	$parentmenu = ereg_replace(" ", "-", $parentmenu); // replace spaces with a dash
	$parentmenu = ereg_replace("[^+A-Za-z0-9-]", "", $parentmenu); // strip special characters
	$parentmenu = strtolower($parentmenu); //set name to lowercase
else :
	$parentmenu = "home"; // Set parentmenu to "home" 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&#8217;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="&lt;?php echo $parentmenu; ?>">
</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&#8217;s by far the recommended method of the two.  It uses the Jsite object to obtain the parent menu&#8217;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()->getActive()->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="menuID-&lt;?php echo $parentmenu; ?>">
</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>
<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. 
]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2010/03/advanced-techniques-the-joomla-parent-menu-itemid/feed/</wfw:commentRss>
		<slash:comments>6</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&#8217;ve compiled a list of our most used development-centric applications for Mac, from coding to design tools &#8211; here are our ten favourites!
Panic Coda
Web: panic.com/coda &#124; License: Commercial, $99

All the ...]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve compiled a list of our most used development-centric applications for Mac, from coding to design tools &#8211; here are our ten favourites!</p><span id="more-490"></span>
<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 src="http://toolboxdigital.com/wp-content/uploads/2010/01/coda-ss.jpg" alt="Coda" title="coda-ss" width="774" height="431" class="noborder" /></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 src="http://toolboxdigital.com/wp-content/uploads/2010/01/filezilla-ss.jpg" alt="filezilla" title="filezilla-ss" width="774" height="431" class="noborder" /></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 src="http://toolboxdigital.com/wp-content/uploads/2010/01/fireworks-ss.jpg" alt="fireworks" title="fireworks-ss" width="774" height="437" class="alignnone size-full wp-image-499" /></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&#8217;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 src="http://toolboxdigital.com/wp-content/uploads/2010/01/vmware-ss.jpg" alt="vmware fusion" title="vmware-ss" width="774" height="435" class="alignnone size-full wp-image-500" /></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: £39)</strong></p>
<p><img src="http://toolboxdigital.com/wp-content/uploads/2010/01/mamp-ss.jpg" alt="mamp" title="mamp-ss" width="491" height="394" class="noborder" /></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 src="http://toolboxdigital.com/wp-content/uploads/2010/01/quicksilver-ss.jpg" alt="quicksilver" title="quicksilver-ss" width="268" height="109" class="noborder" /></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 src="http://toolboxdigital.com/wp-content/uploads/2010/01/timemachine-ss.jpg" alt="time machine" title="timemachine-ss" width="774" height="484" class="alignnone size-full wp-image-504" /></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 src="http://toolboxdigital.com/wp-content/uploads/2010/01/betterzip-ss.jpg" alt="betterzip" title="betterzip-ss" width="774" height="281" class="noborder" /></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 src="http://toolboxdigital.com/wp-content/uploads/2010/01/skype.jpg" alt="skype" title="skype" width="400" height="183" class="noborder" /></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 src="http://toolboxdigital.com/wp-content/uploads/2010/01/process-ss.jpg" alt="process" title="process-ss" width="653" height="382" class="alignnone size-full wp-image-507" /></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>0</slash:comments>
		</item>
	</channel>
</rss>
