<?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; CSS</title>
	<atom:link href="http://toolboxdigital.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://toolboxdigital.com</link>
	<description></description>
	<lastBuildDate>Sun, 08 Jan 2012 18:49:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Are Template Clubs Losing The Plot?</title>
		<link>http://toolboxdigital.com/2011/01/are-template-clubs-losing-the-plot/</link>
		<comments>http://toolboxdigital.com/2011/01/are-template-clubs-losing-the-plot/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 16:30:31 +0000</pubDate>
		<dc:creator>Dan Luton</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Templates]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://toolboxdigital.com/?p=751</guid>
		<description><![CDATA[My opinion on the growing trend amongst template clubs of adding too much "bloat" to templates, and why they should be carefully considered.]]></description>
			<content:encoded><![CDATA[<h4>I&#39;ve long been a fan of the cutting-edge design work produced by many of the top template clubs.</h4>
<p>Rich, unique designs are being published every month for keen club members to download and deploy for their own web projects, making it easy to get an amazing looking website up-and-running in relatively little time.</p>
<p>However, what I&#39;m not a fan of is the way many templates are built these days.</p>
<p><span id="more-751"></span></p>
<p><img alt="Downloading" class="alignnone size-full wp-image-752" src="http://toolboxdigital.com/wp-content/uploads/2011/01/downloading.jpg" title="Downloading" /></p>
<p>A good poke around under the hood is enough to make anyone who works with HTML/PHP/CSS frown at what&#39;s going on &#8211; yes, the code is normally nicely structured, but what is rendered in the browser needs to be carefully considered before using a commercial theme.</p>
<h3>Framework = More Work?</h3>
<p>The trend these days is to use a proprietary theme framework &#8211; these are produced by the clubs and normally the core is shared under a GPL license. All of the club template releases are built on this framework, which offers a bewildering amount of flexibility in layout and features. Often they come complete with an entire management system which is used to configure how everything works. This management can even stretch beyond the template and start managing core features of the CMS itself.</p>
<p>However, the learning curve tends to be steep, with the frameworks being massively complex in their implementation, and core changes to the code are far more difficult than they would be for a more traditionally constructed theme.</p>
<p>Many aspects of the layout can be adjusted within the theme&#39;s setup options, so in a lot of cases, code intervention isn&#39;t really needed &#8211; but what if you need to break free of the framework for something? You have to commit to learning how everything works within the framework, and often even small adjustments are hugely complex given the more rigid nature of the frameworks (which are normally based on a CSS grid system).</p>
<h3>More Features = Less Performance</h3>
<p>Ah, HTTP requests. A real hog of performance, and something you want to really keep to a minimum. By using clever techniques such as CSS sprites, JS and CSS combining, you can massively reduce the number of requests thus speeding things up &#8211; a win for your users, a win for your host, and a win for the performance of the site.</p>
<p>Now, I understand the requirement to separate elements up in order to give flexibility to a theme &#8211; but at what cost? Dozens of individual CSS and Javascript files cannot be a good thing.</p>
<p>Take a nice, lean CMS like WordPress for example. I recently was asked to investigate why the breadcrumb trail wasn&#39;t working (turns out the theme&#39;s breadcrumbs file was pretty much useless) and was horrified at the source output that I saw. Take a look at these stats:</p>
<p>section (a &#39;normal&#39; site would be around 20-100 lines) including:</p>
<ul class="bullet">
<li>233 lines of code for the <strong>&lt;head></strong> section (a ‘normal’ site would be around 20-100 lines) including:</li>
<li>46 lines of embedded CSS</li>
<li>16 separate CSS files</li>
<li>12 separate Javascript files</li>
<li>2 Javascript libraries</li>
<li>Almost 1400 lines of code for the home page</li>
</ul>
<p>Which all add up to the following:</p>
<ul class="bullet">
<li>308 total objects</li>
<li>287 images</li>
<li>300Kb of scripts</li>
<li>A 2,700Kb total page size</li>
</ul>
<p>Of course, I understand that sites will vary in content, plus there were a couple of extra plug-ins installed in this case &#8211; but a quick look at the relevant demo sites paints a pretty similar picture. When you consider that template clubs usually run on some pretty beefy server hardware, they can give a false impression of how the template might perform. Once deployed to a more common shared hosting platform, performance will undoubtedly suffer.</p>
<h3>What can we do about it?</h3>
<p>Template clubs and their projects are obviously a great way for novice developers and webmasters to get started, but many will be oblivious to what goes on under the surface of a theme, blinded by the fancy design and effects.</p>
<p>It&#39;s a shame in some ways, as the popularity of these clubs means that a high percentage of CMS websites will be using them, which could portray the whole platform in a negative light if the performance of a platform is judged on these sites.</p>
<p>My advice: take a look at what&#39;s going on under the hood when using a club template, you might be surprised at what you see. All those features aren&#39;t really free, and are costing you dearly in terms of performance. Also, to get some real stats on your site, run it through a performance checker like <a href="http://websiteoptimization.com/services/analyze/" target="_blank">http://websiteoptimization.com/services/analyze/</a> to see how your own projects perform.</p>
<p>Of course, not all theme providers can be tarred with the same brush &#8211; know of a club producing more streamlined templates without all the fluff? Let us know in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://toolboxdigital.com/2011/01/are-template-clubs-losing-the-plot/feed/</wfw:commentRss>
		<slash:comments>5</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>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>

