<?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>Midstride Solutions &#187; Web Design</title>
	<atom:link href="http://blog.midstride.com/category/webdesign/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.midstride.com</link>
	<description>Powerful, simple &#38; easy to use.</description>
	<lastBuildDate>Sat, 18 Apr 2009 20:21:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>5 tips and tools to optimize your php application &#8211; Part 1 simple</title>
		<link>http://blog.midstride.com/2008/12/01/5-tips-and-tools-to-optimize-your-php-application-part-1-simple/</link>
		<comments>http://blog.midstride.com/2008/12/01/5-tips-and-tools-to-optimize-your-php-application-part-1-simple/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 06:41:26 +0000</pubDate>
		<dc:creator>andre</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[minify]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[yslow]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://blog.midstride.com/?p=33</guid>
		<description><![CDATA[With php becoming a more mature language and frameworks becoming a standard practice, it&#8217;s increasingly important to analyze your code and test the performance where possible.
Frameworks and libraries can speed up the development time and make code maintenance simpler, but it&#8217;s important you understand how they work.  It&#8217;s not just the framework itself but the [...]]]></description>
			<content:encoded><![CDATA[<p>With php becoming a more mature language and frameworks becoming a standard practice, it&#8217;s increasingly important to analyze your code and test the performance where possible.</p>
<p>Frameworks and libraries can speed up the development time and make code maintenance simpler, but it&#8217;s important you understand how they work.  It&#8217;s not just the framework itself but the entire footprint your application leaves when a user visits a specific page.  Ask yourself what&#8217;s involved from the database, to the code/framework, and then to the client through http requests.<br />
<span id="more-33"></span><br />
After experiencing some issues with an application running the Zend Framework, I realized there were a lot of things I was not doing to optimize my application.  There are simple and more complex actions you can take to speed up your application.  Since time is precious, and developers with an expertise on optimization are not always available, I&#8217;ve split this post into two sections (simple and more advanced).  This post focuses on the simple part.</p>
<p><strong>Simple tips and tools<br />
</strong></p>
<ol>
<li><strong>Use Firebug with YSlow<br />
</strong>Firebug and YSlow are powerful tools to analyze the front end of your site.  Run the most common request on your site and see what YSlow says.  Expect a low grade, probably a D or lower.  If you can reach a level C or greater you&#8217;re doing really well as some of the requirements are not practical for most applications.</p>
<blockquote><p>How-to:<br />
<strong>Net</strong>: How many calls are there?  Try to minize these calls and definitely remove any 404 calls as they can eat up server resources.</p>
<p><strong>Console</strong>:  Do you have a lot of POST calls?  Some libraries, like dojo&#8217;s javascript framework, can make a lot of POST requests.  Reduce these if possible.</p>
<p><strong>YSlow</strong>: Rules I would pay attention to:<br />
1. Make fewer HTTP Requests<br />
3. Add an Expires Header<br />
4. Gzip components (server related)<br />
5. Put CSS at the top<br />
6. Put JS at the bottom (not always possible)<br />
7. Avoid CSS expressions<br />
10. Minify JS</p></blockquote>
<p>Resources:<br />
<a href="http://getfirebug.com/">http://getfirebug.com/</a><br />
<a href="http://developer.yahoo.com/yslow/">http://developer.yahoo.com/yslow/</a><br />
<a href="http://developer.yahoo.com/performance/rules.html ">http://developer.yahoo.com/performance/rules.html </a></li>
<li><strong>Minify Javascript and CSS<br />
</strong>Minification is the process of compacting your scripts by removing extraneous content such as white space.   In addition, minification can make attempts at refactoring the code to remove redunancies.  If you want to play it safe, only remove white space to ensure your code is still running. The Yahoo compressor is one of the best minifiers out there and reduces both Javascript and CSS by a significant percentage.</p>
<blockquote><p>How-to:<br />
<strong>java -jar yuicompressor-x.y.z.jar -o style_minified.css style.css</strong></p>
<p>add the &#8220;&#8211;nomunge&#8221; to only do whitespace compressions.</p></blockquote>
<p>Resources:<br />
<a href="http://developer.yahoo.com/yui/compressor/">http://developer.yahoo.com/yui/compressor/</a><br />
<a href="http://dojotoolkit.org/docs/shrinksafe">http://dojotoolkit.org/docs/shrinksafe</a><br />
<a href="http://dean.edwards.name/packer/ ">http://dean.edwards.name/packer/ </a></li>
<li><strong>Merge css and js http requests</strong>- manually or automated<br />
Reduce the amount of calls you make to various CSS and JS files by merging them to one URL.  This is more work but will reduce the overhead.</p>
<blockquote><p>How-to &#8211; manually:<br />
This is really easy, take your css and copy and paste them together into one file.  Make sure your preserve the order of your css.  The same applies to your Javascript files.</p>
<p>How-to &#8211; Automated &#8211; google or your own custom:<br />
Google has a php script which can take various sources and return them as one.</p></blockquote>
<p>Resources:<br />
<a href="http://code.google.com/p/minify/">http://code.google.com/p/minify/</a><br />
<a href="http://reinholdweber.com/?p=37">http://reinholdweber.com/?p=37</a></li>
<li><strong>CSS Background Images are bad &#8211; usually</strong><br />
Using a div for all of your images with a background image is not that great for performance as it requires more calls.  I&#8217;ll be the first to admit it&#8217;s my favourite way to design, but you should try to avoid them where possible.  In addition, for hover states try using one large image with background-position calls to show specific parts.</p>
<blockquote><p>How to:<br />
Use <em><strong><code><span style="color: #000000;">background-position </span></code></strong></em>to select which portion of the large image you want to show.  There isn&#8217;t much more to explain.</p></blockquote>
</li>
<li><strong>GZip<br />
</strong>Gzipping files on the server side will reduce the amount of overhead significantly.  It adds a bit more on the server side, but generally the pay off should be well worth it.</p>
<blockquote><p>How to:<br />
It depends on your server situation, but here&#8217;s a snippet:<br />
mod_gzip_on Yes<br />
mod_gzip_item_include mime ^application/x-javascript$</p>
<p>Refer to <a href="http://snipplr.com/view/9017/gzip-your-components/">http://snipplr.com/view/9017/gzip-your-components/</a> for details</p></blockquote>
<p>Resources:<br />
<a href="http://developer.yahoo.com/performance/rules.html#gzip" target="_blank">http://developer.yahoo.com/performance/rules.html#gzip</a><br />
<a href="http://snipplr.com/view/9017/gzip-your-components/">http://snipplr.com/view/9017/gzip-your-components/</a></li>
</ol>
<p><strong>Conclusion<br />
</strong>That wraps up the simple part of this tutorial&#8230; really, that&#8217;s it!  The focus of these posts is to keep them simple and easy to use.  You may be surprised at how much faster your application runs when you apply these techniques.  I hope you found these useful or at least agree that these are good practices to apply.  In the next part I will examine more advanced methods of optimizing your application.</p>
<p><strong>Feedback<br />
</strong>Your feedback is always appreciated.  In addition to commenting, if you have more resources, please add them to my growing list of links through this buncholink</p>
<p><script src="http://www.buncholinks.com/widget/script/i/162/k/8b5f477e74ec6ed2ad68064aec4034c0" type="text/javascript"></script></p>
<p>It&#8217;s a simple way to organize a group of links together.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Midstride%20Solutions&amp;siteurl=http%3A%2F%2Fblog.midstride.com%2F&amp;linkname=5%20tips%20and%20tools%20to%20optimize%20your%20php%20application%20%E2%80%93%20Part%201%20simple&amp;linkurl=http%3A%2F%2Fblog.midstride.com%2F2008%2F12%2F01%2F5-tips-and-tools-to-optimize-your-php-application-part-1-simple%2F"><img src="http://blog.midstride.com/wp-content/plugins/add-to-any/share_save_120_16.gif" width="120" height="16" alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="5 tips and tools to optimize your php application – Part 1 simple";
		a2a_linkurl="http://blog.midstride.com/2008/12/01/5-tips-and-tools-to-optimize-your-php-application-part-1-simple/";
						    </script>
    <script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script>

	</p>]]></content:encoded>
			<wfw:commentRss>http://blog.midstride.com/2008/12/01/5-tips-and-tools-to-optimize-your-php-application-part-1-simple/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>How to Select an Open Source Publishing Platform &#8211; Step 3: Determine Your Capacity for Internal Design</title>
		<link>http://blog.midstride.com/2008/09/10/how-to-select-an-open-source-publishing-platform-step-3-determine-your-capacity-for-internal-design/</link>
		<comments>http://blog.midstride.com/2008/09/10/how-to-select-an-open-source-publishing-platform-step-3-determine-your-capacity-for-internal-design/#comments</comments>
		<pubDate>Thu, 11 Sep 2008 06:36:55 +0000</pubDate>
		<dc:creator>adrian</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Strategy]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[open source design]]></category>
		<category><![CDATA[smarty]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.midstride.com/?p=9</guid>
		<description><![CDATA[A couple weeks ago we took a look at some of the first steps to take when selecting an open source publishing platform. The next step we're going to cover will touch on design. What should you consider when it comes to designing a new look and feel for your open source tool?]]></description>
			<content:encoded><![CDATA[<p>A couple weeks ago we took a look at some of the first steps to take when selecting an open source publishing platform. From starting off with <a title="How to Select an Open Source Publishing Platform - Step 1: Research Your Market - Midstride" href="http://blog.midstride.com/2008/08/24/how-to-select-an-open-source-publishing-platform-step-1/">doing some guerilla market research</a> and viewing source code to figure out what tools others are using, moving on to trying to <a title="How to Select an Open Source Publishing Platform - Step 2: Determine Your capacity for Internal Development Work - Midstride" href="http://blog.midstride.com/2008/08/28/how-to-select-an-open-source-publishing-platform-step-2-determine-your-capacity-for-internal-development-work/">gauge your internal capacity for carrying out the web development work</a> required to set up and extend your installation, the next step we&#8217;re going to cover is how to assess your internal capacity to carry out the design work needed to create the web user experience you&#8217;re looking for out of your open source site.<br />
<span id="more-9"></span></p>
<p><a href="http://blog.midstride.com/wp-content/uploads/2008/09/design_ninja.png"><img class="alignleft size-medium wp-image-24" title="design_ninja" src="http://blog.midstride.com/wp-content/uploads/2008/09/design_ninja.png" alt="Gotta Design Ninja?" width="250" height="250" /></a>Without a doubt there are at least two faces to any open source publishing platform. There is the elegance of the code, and then elegance in the visual design. Sometimes it&#8217;s this difference between the ease of working with the source code vs. the ease of designing a visual interface that will account for why one boutique shop will roll out websites with online-community-type features in, say, <a title="Joomla" href="http://www.joomla.org/">Joomla</a>, while another will roll out websites that do more or less the same things, but in another tool, say, <a title="Drupal" href="http://www.drupal.org">Drupal</a>.</p>
<p>Coming up with a sharp new design for a website is one thing, and implementing it into a working website is another &#8211; this is particularly true when it comes to taking a Photoshop mock-up and splicing it up to fit the markup and code generated by open source software. And unfortunately, there is no good way to get a good feel for this other than getting your hands dirty yourself, or talking to someone else who has (and whose skill level you know and trust).</p>
<p>When it comes to the design aspect of open source software, not all products were created equal &#8211; some open source products are easier to design for than others.</p>
<p><a title="Drupal" href="http://www.drupal.org">Drupal</a>, for example, is infamous for offering incredibly powerful programming possibilities, but sometimes to the point where designing beautiful interfaces becomes a real challenge for even the best designers. Now that being said, there are some amazing sites out there that are driven by Drupal.</p>
<p>The other alternative that will be available to you is to turn back to the &#8220;source&#8221; and make use of some community-created templates (for example: <a title="Drupal Themes" href="http://drupal.org/project/themes">Drupal Themes</a>, or <a title="WordPress Themes" href="http://wordpress.org/extend/themes/">WordPress Themes</a>). This is an excellent alternative, especially if you&#8217;re really under the gun to churn out a hot-looking site pronto. This can also be an incredibly helpful way to learn more about what&#8217;s involved in customizing the designs for the open source tool.</p>
<h2>Key Design Skills for Customizing Themes and Templates</h2>
<p>There are a few key skills that you&#8217;ll absolutely need to have &#8220;in-house&#8221; if you&#8217;re going to tackle any design work that touches the source code:</p>
<h3>1. Expert Knowledge of CSS</h3>
<p>Any open source software you download worth its lick will have templates that rely heavily on CSS for its overall look and feel. Knowing how to edit someone else&#8217;s CSS can sometimes be trickier than starting from a blank slate and creating a completely fresh stylesheet. Either way, you&#8217;ll need to have someone on your team who knows their CSS.</p>
<h3>2. Familiarity with Templating engines</h3>
<p>By &#8220;templating engines&#8221; I&#8217;m referring to things like <a title="Smarty Template Engine" href="http://www.smarty.net/">Smarty</a> or the overall framework for how <a title="Drupal Themes" href="http://drupal.org/project/Themes">Drupal</a> or <a title="WordPress Tag Templates" href="http://codex.wordpress.org/Tag_Templates">WordPress</a> pieces together what becomes the template of your site. While it would be ideal to have the in-house knowledge of the exact platform you&#8217;re using, the reality is that different platforms have their own methods for creating the overall look and feel of their sites, so you&#8217;ll be just as well off with a generalist who is able to figure out how a particular platform pieces together the programming logic, markup, and styles. Just because you know one, doesn&#8217;t mean you&#8217;ll automatically know them all. But if you get the gist of how a template engine/system works, you should be able to adapt to figure out the others.</p>
<h3>3. Past Experience Customizing a Design</h3>
<p>Ok, this one&#8217;s admittedly a vicious circle &#8211; how do you leverage past experience if you don&#8217;t have any? Well this is where it comes back to how the only way you&#8217;ll REALLY learn what&#8217;s involved in customizing the design of an open source platform is to get your hands dirty and start trying it.</p>
<p>The point here, though, is that if, for example, you already have one or two people with past experience modifying a WordPress template whereas no one has yet tackled a Drupal theme, this should really weigh in on your overall decision-making process of what tool to use. It&#8217;s nice if you have the time to learn the new tools, but if you&#8217;re pressed for time and need to roll out what you can by the deadline, go with what you know.</p>
<h3>4. Past Experience Implementing &amp; Modifying Extended Themes/Templates/Plugins</h3>
<p>There are a lot of really good &#8211; and freely available &#8211; templates that others in the community have created and shared. And what you may quickly find out is that your time will be better spent taking one of these extensions of the core templates, and then making the customizations on these rather than the original default templates.</p>
<p>This, again, is an area where past experience will do you well &#8211; you really won&#8217;t know (and can&#8217;t appreciate) how hard or easy it will be to implement and then modify an extended theme or template until you&#8217;ve gone ahead and tried it.</p>
<p>Similar to how you should <a title="How to Select an Open Source Publishing Platform - Step 2" href="http://blog.midstride.com/2008/08/28/how-to-select-an-open-source-publishing-platform-step-2-determine-your-capacity-for-internal-development-work/">be selective of which plugins and modules to use</a>, you can apply the same measures to help you be selective of the themes and templates you set up for your site &#8211; how active is the template designer? What sorts of questions are being asked by others who are using the template? Is the original template creator still using the template themselves?</p>
<p>These are just some thoughts, tips, suggestions. What do you think? What else would you be looking for in a designer? What would you want to know before diving into redesigning an open source template?</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Midstride%20Solutions&amp;siteurl=http%3A%2F%2Fblog.midstride.com%2F&amp;linkname=How%20to%20Select%20an%20Open%20Source%20Publishing%20Platform%20%E2%80%93%20Step%203%3A%20Determine%20Your%20Capacity%20for%20Internal%20Design&amp;linkurl=http%3A%2F%2Fblog.midstride.com%2F2008%2F09%2F10%2Fhow-to-select-an-open-source-publishing-platform-step-3-determine-your-capacity-for-internal-design%2F"><img src="http://blog.midstride.com/wp-content/plugins/add-to-any/share_save_120_16.gif" width="120" height="16" alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="How to Select an Open Source Publishing Platform – Step 3: Determine Your Capacity for Internal Design";
		a2a_linkurl="http://blog.midstride.com/2008/09/10/how-to-select-an-open-source-publishing-platform-step-3-determine-your-capacity-for-internal-design/";
						    </script>
    <script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script>

	</p>]]></content:encoded>
			<wfw:commentRss>http://blog.midstride.com/2008/09/10/how-to-select-an-open-source-publishing-platform-step-3-determine-your-capacity-for-internal-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Web Statistics to Make Informed Design Decisions</title>
		<link>http://blog.midstride.com/2008/09/02/using-web-statistics-to-make-informed-design-decisions/</link>
		<comments>http://blog.midstride.com/2008/09/02/using-web-statistics-to-make-informed-design-decisions/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 01:11:36 +0000</pubDate>
		<dc:creator>adrian</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Strategy]]></category>
		<category><![CDATA[analytics]]></category>
		<category><![CDATA[web statistics]]></category>

		<guid isPermaLink="false">http://blog.midstride.com/?p=10</guid>
		<description><![CDATA[One of your worst nightmares as a web designer is getting caught up in a conversation where you're trying to defend a design decision, and what you're battling isn't a rationed and informed perspective based on...]]></description>
			<content:encoded><![CDATA[<p>One of your worst nightmares as a web designer is getting caught up in a conversation where you&#8217;re trying to defend a design decision, and what you&#8217;re battling isn&#8217;t a rationed and informed perspective based on sound design principles of ratios, colour theory or typography, but rather the personal opinion of the loudest voice at the table.</p>
<p>&#8220;<em>I think the page is too narrow. I hate it when I have to scroll through pages and pages of content</em>,&#8221; says one person.</p>
<p>&#8220;<em>Hmm. Yeah, but, I don&#8217;t know&#8230;I don&#8217;t like it when the page is too wide&#8230;.makes it too hard for me to scan the text</em>,&#8221; says the other.</p>
<p><span id="more-10"></span></p>
<p>&#8220;<em>Well, yeah, sure, but well. I just think it looks better when it&#8217;s a little wider.</em>&#8221;</p>
<p>&#8220;<em>Well how wide do you think it should be? It&#8217;s actually filling my whole browser window right now.</em>&#8221;</p>
<p>&#8220;<em>Oh really? I&#8217;m looking at it on my laptop and it&#8217;s not.</em>&#8221;</p>
<p>&#8220;<em>Well it&#8217;s filling it on mine.</em>&#8221;</p>
<p>And on it goes&#8230;</p>
<p>It can catch you off guard, and it can be delicate to tip-toe around what you really want to say: &#8220;<strong><em>What you yourself personally think doesn&#8217;t really matter! (unless you have something more to base that opinion on).</em></strong>&#8221;</p>
<p>So what can you do to better prepare yourself for the design presentation? How can you arm yourself with the right tools to walk into a meeting confident that you can politely, and yet assertively, re-affirm the decisions you made with coming up with your design?<br />
One of the best ways to confront &#8211; and also pro-actively deal with &#8211; the rise of personal opinions in a design discussion is to arm yourself with some good solid data, and web statistics are one of the best ways to do this.</p>
<h2>Opinion vs. The Informed Web Design Decision</h2>
<p>Web statistics are helpful for making informed decisions about the design, development, and on-going maintenance of your website.</p>
<p>Rather than relying on personal preferences or anecdotal observations, statistics provide a broader and more objective context for helping you make decisions that will best accommodate the needs of your online audience.</p>
<p>Web statistics can help you decide:</p>
<ul>
<li>how wide (or narrow) to make your web template</li>
<li>when to separate content into separate pages or when to use anchor links in a single page to make sure content isn&#8217;t lost &#8220;below the fold&#8221;</li>
<li>when to change your page layout or add new design elements to aid with navigation</li>
<li>what tools and technologies you can reliably expect your audience to be able to use (e.g. Flash)</li>
<li>what time of year/month/week/day to complete major site-wide changes</li>
</ul>
<p>Statistics will not make decisions for you &#8211; but what they do is provide you with information that you can then make a judgment on.</p>
<p>For example, if you find out that only 3% of your web visitors are using browsers with a resolution of 800&#215;600 pixels or less, you could now consider the impact of creating a fixed-width template at 1024 pixels wide (giving you a controlled and relatively large page to work with) vs. a fluid-width template (giving you a less-controlled but more flexible and adaptable page).</p>
<p>For any design decision, there are always pros and cons. But with web statistics, you will at least be able to make informed decisions on what the benefits and trade-offs are rather than relying one person&#8217;s opinion.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Midstride%20Solutions&amp;siteurl=http%3A%2F%2Fblog.midstride.com%2F&amp;linkname=Using%20Web%20Statistics%20to%20Make%20Informed%20Design%20Decisions&amp;linkurl=http%3A%2F%2Fblog.midstride.com%2F2008%2F09%2F02%2Fusing-web-statistics-to-make-informed-design-decisions%2F"><img src="http://blog.midstride.com/wp-content/plugins/add-to-any/share_save_120_16.gif" width="120" height="16" alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="Using Web Statistics to Make Informed Design Decisions";
		a2a_linkurl="http://blog.midstride.com/2008/09/02/using-web-statistics-to-make-informed-design-decisions/";
						    </script>
    <script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script>

	</p>]]></content:encoded>
			<wfw:commentRss>http://blog.midstride.com/2008/09/02/using-web-statistics-to-make-informed-design-decisions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating custom tooltips by extending Dojo&#8217;s Dijits &#8211; in 8 Steps</title>
		<link>http://blog.midstride.com/2008/08/25/creating-custom-tooltips-by-extending-dojos-dijits-in-8-steps/</link>
		<comments>http://blog.midstride.com/2008/08/25/creating-custom-tooltips-by-extending-dojos-dijits-in-8-steps/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 20:15:07 +0000</pubDate>
		<dc:creator>andre</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[dijittooltip]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[tooltip]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://blog.midstride.com/?p=5</guid>
		<description><![CDATA[Tooltips are nice small additions that can improve the user experience. They are so common that Dojo and other javascript frameworks provide precanned ways of creating them.]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p><img class="alignleft" style="float: left;" src="http://blog.midstride.com/wp-admin/resources/tooltip2.png" alt="dojo tooltip" />Tooltips are nice small additions that can improve the user experience.  They are so common that <a title="dojotoolkit" href="http://dojotoolkit.org/" target="_blank">Dojo</a> and other javascript frameworks provide precanned ways of creating them.  In dojo, they provide <a title="dojo dijit" href="http://dojotoolkit.org/projects/dijit" target="_blank">dijits</a> (their widgets) that can do some amazing things on the user interaction side.  That being said, when you want to customize them in any way, you can run into many walls.<br />
<span id="more-5"></span></p>
<p><strong>Dojo tooltip</strong><br />
<img src="http://blog.midstride.com/wp-admin/resources/tooltip.png" alt="dojo tooltip" width="90" height="30" /></p>
<h3>Problem &amp; Goal of this Article</h3>
<p>The main goal of this article is to show you how to stylize the tooltips so that you can create your own type of tooltip.  This article will go through the css required and how to structure your code so that you can create more than one tooltip.</p>
<p>To extend the style of dojo&#8217;s dijit, it&#8217;s best to copy one of the existing themes and create your own custom theme.  In this tutorial, I&#8217;ve copied the &#8220;tundra&#8221; theme so all the following css code will use the &#8220;tundra&#8221; selector.  You could replace the tundra selectors with your own custom name, but it may be more work than it&#8217;s worth.</p>
<h3>Prerequisites &#8211; tools you&#8217;ll need setup:</h3>
<ul>
<li> <a title="Firefox" href="http://www.firefox.com" target="_blank">Firefox</a><br />
<em>You should have this</em></li>
<li>IE 6 or <a href="http://www.my-debugbar.com/wiki/IETester/HomePage" target="_blank">IETester</a><br />
<em>You&#8217;ll want to make it IE6 compliant right?  Or maybe not&#8230; <img src='http://blog.midstride.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </em></li>
<li><a href="http://getfirebug.com/">Firebug</a><br />
<em> Every developer and especially UI developer should have this.</em></li>
<li><a title="dojo framework" href="http://dojotoolkit.org/" target="_blank">Dojo framework setup</a><br />
<em> Follow their <a href="http://sitepen.com/labs/guides/?guide=DojoQuickStart">documentation </a>on setting up the includes</em></li>
</ul>
<h3>The Steps</h3>
<p><strong>1. Setup a new theme</strong><br />
-Open up the dojo dijit theme folder<br />
-dojo-release-1.1.1dijitthemes<br />
<strong>2. Create a copy of the &#8220;tundra&#8221; folder.</strong><br />
<strong>3. Rename it to the name of your theme.  (e.g. &#8211;  &#8220;tundraextended&#8221;)</strong><br />
<strong>4. Include the dojo style and your extended theme in your header code:</strong></p>
<blockquote><p>&lt;style type=&#8221;text/css&#8221;&gt;<br />
@import &#8220;pathtodojo/dojo-release-1.1.1/dijit/themes/tundraextended/tundra.css&#8221;;<br />
@import &#8220;pathtodojo/dojo-release-1.1.1/dojo/resources/dojo.css&#8221;<br />
&lt;/style&gt;</p></blockquote>
<p><strong>5.  Include the tool tip dijit:</strong></p>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
dojo.require(&#8221;dojo.parser&#8221;);<br />
dojo.require(&#8221;dijit.Tooltip&#8221;);<br />
&lt;/script&gt;</p></blockquote>
<p><strong>6. Add the tool tip code</strong></p>
<blockquote><p>&lt;body class=&#8221;tundra&#8221;&gt; &lt;!&#8211; you need to set the body to load the dijit styles &#8211;&gt;</p>
<p>&lt;a id=&#8221;theId&#8221; href=&#8221;#&#8221;&gt;Hover over this&lt;/a&gt;</p>
<p>&lt;div dojoType=&#8221;dijit.Tooltip&#8221; style=&#8221;display:none&#8221; position=&#8221;left&#8221; connectId=&#8221;theId&#8221;&gt;<br />
&lt;div class=&#8221;custom_tooltip&#8221;&gt;tool tip content&lt;/div&gt;<br />
&lt;/div&gt;</p></blockquote>
<p><em>Note the attribute &#8220;position=left&#8221;.  This should remain the same for all tooltips that are defined by the inner class &#8220;custom_tooltip&#8221;.  I don&#8217;t really use the position attribute and rely on css position.<br />
</em><br />
At this point you should have a simple tool tip hover when the mouse goes over the link.  If you don&#8217;t, then open up firebug and see if you have any errors.  If you do, then you most likely didn&#8217;t setup dojo properly.</p>
<p>If all is good now, then you have a nice basic tooltip.  Now, the hard part is how to extend the look:<br />
<strong>7. Create a new css file &#8211; dojoextended.css</strong><br />
This style sheet should be included last.  As its name suggests, it extends (overrides and resets) the dojo stylesheet.</p>
<blockquote><p>&lt;style type=&#8221;text/css&#8221;&gt;<br />
@import &#8220;pathtodojo/dojo-release-1.1.1/dijit/themes/tundraextended/tundra.css&#8221;;<br />
@import &#8220;pathtodojo/dojo-release-1.1.1/dojo/resources/dojo.css&#8221;<br />
<strong>@import &#8220;pathtocss/dojoextended.css&#8221;</strong><br />
&lt;/style&gt;</p></blockquote>
<p><strong>8. Add the following css to the extended css file</strong></p>
<blockquote><p>/*Reset the generic tooltip container */<br />
.tundra .dijitTooltipContainer<br />
{<br />
background:none;<br />
padding:0;<br />
margin:0;<br />
border:none;<br />
height:auto;<br />
width:auto;<br />
}</p>
<p>/*defines the div inside the tooltip &#8211; your custom tooltip*/<br />
.custom_tooltip<br />
{<br />
/*this defines your tooltip*/<br />
position:relative;<br />
left:5px; /*use left and top to position it */<br />
top:15px;<br />
width:125px;<br />
height:100px;<br />
background-image:url(&#8221;yourimage.png&#8221;);<br />
}</p>
<p>/*if your tooltip uses transparency, define a ie6 specific one below */<br />
.dj_ie6 .tundra  .custom_tooltip<br />
{<br />
background-image:url(&#8221;yourimage_ie6.png&#8221;); /*an 8-bit png*/<br />
}</p>
<p>/*hide the connector &#8211; an arrow that connects the tooltip to the hovered item */</p>
<p>.tundra  .dijitTooltipAbove .dijitTooltipConnector  { background:none; }<br />
.tundra .dijitTooltipLeft .dijitTooltipConnector { background:none; }<br />
.tundra .dijitTooltipBelow .dijitTooltipConnector { background:none; }<br />
.tundra .dijitTooltipRight .dijitTooltipConnector { background:none; }</p></blockquote>
<h3>You&#8217;re done!</h3>
<p>You can now create as many styles for your tooltips as you need by defining a specific div and a new style (e.g. &#8211; custom_tooltip2).  You will likely have to do a lot of tweaking on the positioning image, but it&#8217;s pretty straightforward when you look at it.  The longest part is determining which css selectors you need to use, if you look at the tundra.css class you&#8217;ll notice there are more selectors I didn&#8217;t look at.</p>
<h3>Pros</h3>
<p>-Quick to code.<br />
-Easy to understand, there&#8217;s only one div to deal with.<br />
-IE6 compliant.  It&#8217;s always a bonus <img src='http://blog.midstride.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .<br />
-Extendability.  You can now create as many tooltips as you want for one project.  With the standard tooltip, you would be stuck with one tooltip for an entire project.</p>
<h3>Cons</h3>
<p>-Inefficient: Resetting styles is cumbersome and requires more data to be loaded.<br />
-Upgrading dojo could break the custom tooltips if they change the way the tooltip are rendered.<br />
-Tooltipconnector: I didn&#8217;t use the tooltipconnector which allows you to position the tooltip in various positions easily.</p>
<p><strong>Conclusion<br />
</strong>That wraps up the first tutorial on dojo.   I hope you found it useful, and I appreciate all feedback.  If you have a better way, I would like to know about it.  My next article will look at how to combine dojo&#8217;s ajax with the zend framework.</p>
<p class="addtoany_share_save_container">
    <a class="a2a_dd addtoany_share_save" onmouseover="a2a_show_dropdown(this)" onmouseout="a2a_onMouseOut_delay()" href="http://www.addtoany.com/share_save?sitename=Midstride%20Solutions&amp;siteurl=http%3A%2F%2Fblog.midstride.com%2F&amp;linkname=Creating%20custom%20tooltips%20by%20extending%20Dojo%E2%80%99s%20Dijits%20%E2%80%93%20in%208%20Steps&amp;linkurl=http%3A%2F%2Fblog.midstride.com%2F2008%2F08%2F25%2Fcreating-custom-tooltips-by-extending-dojos-dijits-in-8-steps%2F"><img src="http://blog.midstride.com/wp-content/plugins/add-to-any/share_save_120_16.gif" width="120" height="16" alt="Share/Save/Bookmark"/></a>
    <script type="text/javascript">
		a2a_linkname="Creating custom tooltips by extending Dojo’s Dijits – in 8 Steps";
		a2a_linkurl="http://blog.midstride.com/2008/08/25/creating-custom-tooltips-by-extending-dojos-dijits-in-8-steps/";
						    </script>
    <script type="text/javascript" src="http://static.addtoany.com/menu/page.js"></script>

	</p>]]></content:encoded>
			<wfw:commentRss>http://blog.midstride.com/2008/08/25/creating-custom-tooltips-by-extending-dojos-dijits-in-8-steps/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
