<?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>larryaronson.com &#187; UI Tools</title>
	<atom:link href="http://larryaronson.com/tag/ui-tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://larryaronson.com</link>
	<description>Systems Psychoanalyst</description>
	<lastBuildDate>Tue, 14 Aug 2012 15:23:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>Adding more content with less clutter</title>
		<link>http://larryaronson.com/2009/adding-more-content-with-less-clutter/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://larryaronson.com/2009/adding-more-content-with-less-clutter/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 21:46:47 +0000</pubDate>
		<dc:creator>Larry Aronson</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[Advanced Tooltips]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[random quotes]]></category>
		<category><![CDATA[UI Tools]]></category>

		<guid isPermaLink="false">http://larryaronson.com/?p=990</guid>
		<description><![CDATA[<a href="adding-more-content-with-less-clutter"><img width="75" height="75" src="http://larryaronson.com/wp-content/uploads/Kate-Nasser.png" alt="" class="alignleft wp-image-1047" /></a>For my client Kate Nasser's website, I made a number of changes to add more features &#38; content, reduce clutter and improve search engine optimization (SEO). This article shows how to use advanced tooltips to make suplimental information invisible until needed. ]]></description>
				<content:encoded><![CDATA[<p>There&#8217;s a fundamental conflict in web page design between content and clutter. We want more content to make our pages findable &amp; provide value to visitors while maintaining visually clear layouts so as not to frighten away seekers of simple truths. The key to solving this conundrum is to stop thinking of web pages as printed page emulators. A printed page is a fixed matrix of tiny colored dots (pixels) on a two-dimensional surface. A web page is a dynamic document object composed of multiple layers of interactive elements.</p>
<p><img id="kn1" class="alignright" src="http://katenasser.com/wp-content/themes/katenasser/screenshot.jpg" alt="" width="200" height="213" title="Kate Nasser's front page as of November, 2009" />My client, Kate Nasser – the people skills coach, has grown her consulting business by consistently adding content to her blog/website and by using <a href="http://twitter.com/katenasser">Twitter</a>, <a href="http://linkedin.com">LinkedIn</a> and <a href="http://www.youtube.com/user/KateNasser">youTube</a> to draw traffic. A recent SEO/SEM assessment of her site recommended adding more keyword-rich content and reducing some of front page&#8217;s  clutter.  This is what the page looked liked.</p>
<h3>Advanced Tooltips.</h3>
<p>We had a box on the right side of the content area listing a dozen &#8220;Needs&#8221; linked to different site pages or posts. With each need there was an associated comment (technically, a definition list.) We decided to move the box to the left side of the page (ahead of the straight text content,) placing the comment parts in tooltip boxes that appear as you mouse over the topic part. Kate was free to add more content to the hidden (only from humans) comment parts.</p>
<p>Tooltips are the little yellow boxes that appear when your mouse hovers over a link. The content of the tooltip box is taken from the title attribute of the HTML tag that creates the link. But ordinary tooltips are boring with fixed style and color; yellow wasn&#8217;t the best choice given the site&#8217;s aqua tones.</p>
<p>So, I installed <a href="http://flowplayer.org/tools/" target="_blank">JQuery Tools from Flowplayer.org</a> which has an easy to use, advanced tooltip tool. JQuery is a library of Javascript functions that make it easy to add dynamic behavior to Web page elements without having to worry about cross-browser incompatibilities. JQuery Tools is a free, lightweight tool collection that provides basic behaviors to attach to any page element. The Advanced Tooltip tool replaces the browser&#8217;s builtin tooltip and can be attached to any page element, not just links.</p>
<p>To make Advanced Tooltips work, you have to provide a page element with a unique id to hold the content. It doesn&#8217;t matter where it&#8217;s placed. The element, typically a division, is dynamically positioned near the moused-over element. The element is re-useable; you only need one holder element for all tooltips of a given style on a page. The tooltip is styled using Normal CSS so I was able to match the colors and typography of that section of the site&#8217;s front page.</p>
<h4 id="kn2" title="Click &lt;em&gt;expand&lt;/em&gt; to display the technical details of using advanced tooltips.  The &lt;em&gt;close&lt;/em&gt; link is at the end of the section.">Technical Details <small>(<a onclick="$('#TechDetails').slideDown();" href="javascript:void(0);#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Expand</a>)</small></h4>
<div id="TechDetails" style="display:none; color:#666; font-size: 90%;">
<p>On KateNasser.com&#8217;s front page (id=2,) tooltips will be activated for all links that are inside level 3 headings in the css class, <em>need-title</em>. This bit of <span style="color: #993300;">HTML</span>, <span style="color: #008000;">PHP</span> and <span style="color: #0000ff;">jQuery</span> coding was added to the document head in the header template.</p>
<pre id="line21" class="SmallCode"><span style="color: #993300;">&lt;script src="http://cdn.jquerytools.org/1.1.2/jquery.tools.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;</span><span style="color: #008000;">
&lt;?php if (is_page("2")) { ?&gt;</span>
<span style="color: #0000ff;">    $(document).ready(function() {
        $("h3.need-title a").tooltip({ tip: "#TipBox",
                                       offset: [-25, 150],
                                       effect: 'fade' });
    });</span><span style="color: #008000;">
&lt;?php } ?&gt;</span>
<span style="color: #993300;">&lt;/script&gt;</span></pre>
<p>The first line brings in the jQuerytools library, including the latest version of jQuery. Flowplayer.org encourages developers to directly link to their high-performance server to get the latest version. However, you can also download the library and install in on your own site for more control.</p>
<p>The <span style="color: #008000;">PHP</span> code makes sure that the tooltip code is executed only on the page we want it to. And, the <span style="color: #0000ff;">jQuery</span> code attaches the tooltips to their triggers and provides some options. JQuery does this after the document is fully defined and &#8220;ready&#8221;. This is typical of jQuery usage.</p>
<p>The holding container is defined in <span style="color: #993300;">HTML</span> at the end of content using the WordPress editor. All it contains is a non-breaking space. Note how the jQuery code above refers to this element using a CSS selector syntax.</p>
<pre id="line314" class="SmallCode"><span style="color: #993300;">&lt;div id="TipBox" class="needs-tips"&gt;&amp;nbsp;&lt;/div&gt;</span></pre>
<p>Finally, in the template style sheet, <em>styles.php</em>, the following <span style="color: #800080;">CSS</span> style rules are used:</p>
<pre class="SmallCode"><span style="color: #800080;">#TipBox {
 display:none;
 width: 200px;
}</span></pre>
<pre class="SmallCode"><span style="color: #800080;">.needs-tips {
 text-align: left;
 background-color: #fafcfb;
 border: 2px solid #009ea0;
 font: italic 10pt comic sans ms;
 color: #000;
 padding: 3px 8px;
}
</span></pre>
<p align="right" id="kn3" title="This expand/collapse behavior is another example of jQuery UI tools.">(<a onclick="$('#TechDetails').slideUp();" href="javascript:void(0);#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Close</a>)</p>
<hr size="1" /></div>
<h3>Random Quotes</h3>
<p>Kate has a bunch of her own quotes and was updating her front page every few days with a new quote from the collection. She asked if there were some way to automate the process. I browsed the various code and plugin collections and found noting simple or suitable. I decided to write my own.</p>
<p><a href="http://katenasser.com"><img id="kn4" title="This is Kate Nasser's new front page with more content and less clutter." src="http://larryaronson.com/wp-content/uploads/Kate-Nasser.png" alt="" title="Kate Nasser" width="200" height="220" class="alignleft size-full wp-image-1047" /></a>I copied her front page as a new draft page and cloned the default page template and assigned it to the new page. Thus, I was able to work on and test the new features without endangering the site&#8217;s current front page.  The cloned template would contain custom code to randomly pick a quote and place it at the beginning of the content area. The quotes themselves would be stored (and editable) as custom fields for that page with the key, &#8220;quote&#8221;.</p>
<pre class="SmallCode"><span style="color: #008000;">&lt;?php
    $todaysquote = '';
    $quotes = get_post_meta('2', 'quote');
    if (!empty($quotes)) {
        $todaysquote = $quotes[rand(0, sizeof($quotes) - 1)];
    }
?&gt;
</span><span style="color: #993300;">&lt;div class="dailyquote"&gt;&amp;ldquo;</span><span style="color: #008000;">&lt;?php _e($todaysquote); ?&gt;</span><span style="color: #993300;">&amp;rdquo;
&lt;span&gt;&amp;mdash;</span>Kate Nasser<span style="color: #993300;">&lt;/span&gt;&lt;/div&gt;</span></pre>
<p>First, a <span style="color: #008000;">PHP</span> variable, <em>$todaysquote</em>, is initialized. Then the WordPress function, <em>get_post_meta()</em>, gets all custom fields from post number 2 (that&#8217;s the front page) with key = &#8216;quote&#8217;. The values are returned as an array of strings and assigned to the variable, <em>$quotes</em>. If it&#8217;s not empty, the built-in, PHP random number generator picks one of its array items. Finally, the last two lines define the <span style="color: #800000;">HTML</span> division element that will hold the quote,  enclosing it in smart quote marks and adding Kate&#8217;s signature. Note the use of the special echo function,  <em>_e($todaysquote)</em>,  to encode any HTML characters that might be in the quote string.</p>
<p>One of the upsides of this technique is that a new front page is seen in most every visit to the front page including those by search engine robots. Over time, this can expand the number of keywords associated with the page. Unfortunately, there&#8217;s no easy way to measure which quotes work best. If you do add random content like this to a page, you should check to see if you have a caching plug-in active. You might want to exclude that page from the cache.</p>
<p>I added this feature as a template hack because my client only wanted it on one page which already had a customized template. It could be easily generalized and added as a filter to the theme&#8217;s functions file, for example, to append a random quote to post content when generating a single-post view.</p>
<div id="knTips" style="width:30%; border: 2px solid #900; background-color: #f6f6fc; color: #306; margin: 1em; padding: 1em; font-size: 90%;">&nbsp;</div>
<p><script type="text/javascript">$("#kn1,#kn2,#kn3,#kn4").tooltip({ tip: "#knTips", offset: [-25, -75] });</script></p>
]]></content:encoded>
			<wfw:commentRss>http://larryaronson.com/2009/adding-more-content-with-less-clutter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
