<?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>Advanced CSS Design Resources - last-child.com &#187; YUI</title>
	<atom:link href="http://www.last-child.com/category/yui/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.last-child.com</link>
	<description>CSS Toys for Professional Web Developers</description>
	<lastBuildDate>Thu, 08 Jul 2010 16:59:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>YUI 3.0 Gallery now includes modernizr functionality</title>
		<link>http://www.last-child.com/yui-3-0-modernizr-function/</link>
		<comments>http://www.last-child.com/yui-3-0-modernizr-function/#comments</comments>
		<pubDate>Tue, 25 May 2010 22:51:14 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[Yahoo!]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[Modernizr]]></category>
		<category><![CDATA[Yahoo! UI Library]]></category>

		<guid isPermaLink="false">http://www.last-child.com/?p=229</guid>
		<description><![CDATA[Are you working on an HTML5 project and using the latest YUI library from Yahoo? If so, you&#8217;ll be happy to know that you can use the modernizr functionality within the YUI3 code. This extension was added to the YUI Gallery by Pradhap Natarajan: Modernizr (gallery-modernizr). This is a wrapper for Modernizr library that is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://developer.yahoo.com/yui"><img src="http://l.yimg.com/a/i/ydn/icons/yui.png" alt="Yahoo! User Interface Library (YUI)" /></a>Are you working on an <a class="zem_slink" href="http://en.wikipedia.org/wiki/HTML5" title="HTML5" rel="wikipedia">HTML5</a> project and using the latest <a class="zem_slink" href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library" rel="homepage">YUI library</a> from <a class="zem_slink" href="http://www.yahoo.com" title="Yahoo!" rel="homepage">Yahoo</a>? If so, you&#8217;ll be happy to know that you can use the <a href="http://www.modernizr.com/docs/">modernizr</a> functionality within the YUI3 code.</p>
<p>This extension was added to the YUI Gallery  by Pradhap Natarajan: <a href="http://yuilibrary.com/gallery/show/modernizr">Modernizr (gallery-modernizr)</a>. </p>
<blockquote cite="http://yuilibrary.com/gallery/show/modernizr">
<p>This is a wrapper for <a class="zem_slink" href="http://www.modernizr.com/" title="Modernizr" rel="homepage">Modernizr</a> library that is used to detect support for many HTML5 &amp; CSS3 features on a browser. More documentation here &#8211; <a href="http://www.modernizr.com/docs/">http://www.modernizr.com/docs/</a> Please note that the module does not add the Modernizr object to the global namespace. Instead it will be local to the YUI instance.</p>
<p><cite><a href="http://yuilibrary.com/gallery/show/modernizr">Modernizr </a> YUI Library</cite>
</p></blockquote>
<p>Modernizr was created to make HTML5 development consistent. It gives hooks for JS and CSS to support the advanced features.</p>
<h3>Related articles by Zemanta</h3>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.slideshare.net/drprolix/yui3-3812758">YUI 3</a> (slideshare.net)</li>
<li class="zemanta-article-ul-li"><a href="http://www.last-child.com/html5-resource-html5-doctor/">HTML5 Resource: HTML5 Doctor</a> (last-child.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.slideshare.net/rmsguhan/yu-open-forall">YUI open for all !</a> (slideshare.net)</li>
<li class="zemanta-article-ul-li"><a href="http://developer.yahoo.net/blog/archives/2010/03/tech_thursday_smileys_seeing_dogs_and_cameras_yui_modules_videos_and_server_side_javascript.html">Tech Thursday &#8211; Smileys, seeing dogs and cameras, YUI modules, videos and server side JavaScript</a> (developer.yahoo.net)</li>
<li class="zemanta-article-ul-li"><a href="http://developer.yahoo.net/blog/archives/2010/05/look_around_you_fun_with_geolocation_and_wikipedia.html">Look around you &#8211; fun with geolocation and Wikipedia</a> (developer.yahoo.net)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/yui-3-0-modernizr-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How easy is it to build a search engine with Yahoo! Boss?</title>
		<link>http://www.last-child.com/how-easy-is-yahoo-boss/</link>
		<comments>http://www.last-child.com/how-easy-is-yahoo-boss/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 20:25:56 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[YUI]]></category>
		<category><![CDATA[Yahoo!]]></category>
		<category><![CDATA[boss]]></category>
		<category><![CDATA[engine]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.last-child.com/?p=186</guid>
		<description><![CDATA[Even I can do it! Check out the video, I look much less repulsive than I expected]]></description>
			<content:encoded><![CDATA[<p>Even I can do it! <a href="http://developer.yahoo.net/blogs/theater/archives/2009/01/ydn_lightning_talks_ted_drake.html">Check out the video</a>, I look much less repulsive than I expected <img src='http://www.last-child.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><embed src=http://d.yimg.com/cosmos.bcst.yahoo.com/up/fop/embedflv/swf/fop.swf?shareEnable=1&#038;id=11795504&#038;autoStart=0&#038;infoEnable=0&#038;shareEnable=0&#038;prepanelEnable=1&#038;carouselEnable=0&#038;postpanelEnable=1 width=400 height=300 type=application/x-shockwave-flash></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/how-easy-is-yahoo-boss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add Pagination to your Yahoo! BOSS search engine</title>
		<link>http://www.last-child.com/pagination-boss-search-engine/</link>
		<comments>http://www.last-child.com/pagination-boss-search-engine/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 15:07:52 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Unordered List]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[Yahoo!]]></category>
		<category><![CDATA[Application programming interface]]></category>
		<category><![CDATA[Cross Site Scripting]]></category>
		<category><![CDATA[Design pattern]]></category>
		<category><![CDATA[Web search engine]]></category>

		<guid isPermaLink="false">http://www.last-child.com/?p=161</guid>
		<description><![CDATA[Yahoo&#8217;s BOSS search API makes it easy for you to create a customized search engine. Yahoo! also has a Design Pattern lLibrary to save time designing your pages. They&#8217;ve put a lot of effort into creating the best user experience for search pagination. Pagination guidelines Here&#8217;s a sample of the Design Library&#8217;s ideas for search [...]]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://developer.yahoo.com/ypatterns/pattern.php?pattern=searchpagination"><img src="http://developer.yahoo.com/ypatterns/images/ysearch-page7.png" alt="Search pagination example"></a><a href="http://developer.yahoo.com/search/boss">Yahoo&#8217;s BOSS search API</a> makes it easy for you to create a customized search engine. Yahoo! also has a <a href="http://developer.yahoo.com/ypatterns/index.php">Design Pattern lLibrary</a> to save time designing your pages. They&#8217;ve put a lot of effort into creating the best user experience for <a href="http://developer.yahoo.com/ypatterns/pattern.php?pattern=searchpagination">search pagination</a>. </p>
<h3>Pagination guidelines</h3>
<p>Here&#8217;s a sample of the Design Library&#8217;s ideas for search pagination.</p>
<blockquote cite="http://developer.yahoo.com/ypatterns/pattern.php?pattern=searchpagination">
<ul>
<li>Display the navigation controls as a row of links.</li>
<li>Present links in the following order: &#8216;Prev&#8217;, page links, &#8216;Next&#8217;.</li>
<li>Display a left arrow after the label &#8216;Prev&#8217;.</li>
<li>Display a right arrow before the label &#8216;Next&#8217;.</li>
<li>Make the arrow(s) clickable.</li>
<li>The page links should contain a maximum set of 10 page links. If fewer pages of results exist, only show page links for the available pages.</li>
<li>When on pages 1-6, the page links should always start at &#8217;1&#8242;.</li>
</ul>
<p><cite><a href="http://developer.yahoo.com/ypatterns/pattern.php?pattern=searchpagination">Search Pagination</a></cite>
</p></blockquote>
<p>The rationale for these rules is also interesting: </p>
<blockquote>
<ul>
<li>Displaying arrow graphics helps differentiate the links and provides larger click targets.</li>
<li>Disabled controls add little value in this context since
<ul>
<li>These links often appear blow the fold.</li>
<li>The first page of results makes up the vast majority of pageviews. Displaying a disabled &#8220;previous&#8221; control on all of these is of little added value.</li>
<li>Although a &#8220;First&#8221; link has value, it competes with the functionality presented in the random-access links. </li>
<li>The &#8220;Last&#8221; link is of little value as the results are sorted by relevance.  This is is also problematic since the total number of results (and therefore, the last result) may not be known. </li>
</ul>
</li>
</ul>
</blockquote>
<h3>Add this pagination style to your search engine</h3>
<p>See the final result on <a href="http://v3ggie.com/">V3GGIE.com</a>: <a href="http://v3ggie.com/recipes/vegetarian+enchiladas.html">Vegetarian Enchiladas Recipes</a></p>
<p>Most <a href="http://php.net/" title="PHP" rel="homepage" class="zem_slink">PHP</a> pagination tutorials assume you are pulling content from a database. <a href="http://ascaniocolonna.com/en/">Ascanio Colonna</a> created a <a href="http://blog.ascaniocolonna.com/?p=12">good tutorial on building pagination</a> with PHP that is agnostic to the data source. I&#8217;ve taken his code and modified it to match the Yahoo Design Pattern. I&#8217;ve also added the suggested <a href="http://developer.yahoo.com/yui/container/module/index.html">YUI Module markup</a> to stay consistent with the <a href="http://developer.yahoo.com/yui/grids/">YUI Grids</a> and any future YUI javascript.</p>
<p>
The pagination.php file includes a function that creates the module. You&#8217;ll need to call this function from your results page with a series of parameters. These are easy to populate from the BOSS interface. It&#8217;s worth noting that I am ignoring the BOSS next/last page nodes in the web service and prefer to build my own urls.</p>
<h3>The Pagination Code</h3>
<p>
Lets&#8217; start by looking at the code inside your results.php file. This will call the pagination function and pass the desired parameters.</p>
<p><code lang="PHP"><br />
if(!empty($searchQuery))<br />
  {<br />
	require '/include/pagination.php';<br />
  if(isset($_REQUEST['page'])) {<br />
	$page = $_REQUEST['page'];<br />
	} else  {<br />
	$page = '1';<br />
	}<br />
	$limit = $count;<br />
	$targetpage = 'results.php';<br />
	$pagestring = '?page=';<br />
	$summary_name = 'articles';<br />
	$placement = 'summary';<br />
	// start pagination<br />
	  echo getPaginationString($page, $totalhits, $limit,  $targetpage, $pagestring, $summary_name, $placement);<br />
 }<br />
</code></p>
<h4>Here&#8217;s what you are working with:</h4>
<dl>
<dt> require &#8216;/include/pagination.php&#8217;</dt>
<dd>Where does the pagination file sit on your server</dd>
<dt>$page logic</dt>
<dd>First look to see if there is page=x in the url. If so, $page = x, if not, you are on page 1.</dd>
<dt>$limit</dt>
<dd>How many results will appear on the page</dd>
<dt>$targetpage</dt>
<dd>what is the name of your results page? index.php, results.php?</dd>
<dt>$pagestring</dt>
<dd>I tried to minimize this to ?p= but couldn&#8217;t track down why it didn&#8217;t work. I&#8217;ve left it at the default ?page=&#8230;</dd>
<dt>$summary_name</dt>
<dd>This is what appears in the text &#8220;xxx (summary_name) results. This is not used in the Yahoo Design Library</dd>
<dt>$placement</dt>
<dd>You&#8217;ll probably want to use summary. This function also allows &#8220;footer&#8221; for a simplified output</dd>
<dt>echo getPaginationString(&#8230;)</dt>
<dd>Send the information to the function and display the results in the page.</dd>
</dl>
<hr />
<h3>Important Update!</h3>
<p>The original code I posted had a serious security flaw. You should never output user&#8217;s input directly into your page. I had something like this href=&#8221;?query=$_REQUEST['query']&#8220;. This allows all sorts of <a href="http://en.wikipedia.org/wiki/Cross-site_scripting" title="Cross-site scripting" rel="wikipedia" class="zem_slink">Cross Site Scripting</a> attacks. You must urlencode any text that comes from a user. This is safe: urlencode($_REQUEST['query']).</p>
<p>I apologize if anyone has used this code, as I wrote it on their site. They should immediately update the logic. -Ted</p>
<hr />
<h3>The pagination function</h3>
<p>
I have streamlined the original code from Asconio, as he was tying into pre-existing facebook styles. This code is for your unique web site. It&#8217;s also worth noting I use rewrite rules to make my search result page urls more friendly, i.e. /corn.html instead of /result.php?q=corn</p>
<p><code lang="PHP"><br />
<?php </p>
<p>//text strings in strings.php</p>
<p>function getPaginationString($page = 1, $totalitems, $limit = 15, $targetpage = '/', $pagestring = '?page=', $summary_name = 'items', $placement = 'summary',$safeQuery)<br />
{</p>
<p>$countnum = '15';</p>
<p>	// inurl or intitle<br />
	// it should only be three digits long, int, inu, or nox anything else could be a vulnerability<br />
	//int=intitle, inu=inurl, nox=no setting<br />
	if (isset($_REQUEST['inx']) &#038;&#038; strlen($_REQUEST['inx']) == 3){<br />
	$inxv = $_REQUEST['inx'];<br />
	}<br />
	else {<br />
	$inxv = '';<br />
	}</p>
<p>	// type of query<br />
	// request type should only be 2 chars, if not we are dealing with an xss attack<br />
	// type options: rc, lo, ve... these represent recipes, local, buzz for insider sites.<br />
	if (!empty($_REQUEST['t']) &#038;&#038; strlen($_REQUEST['t']) <= 2) {<br />
		$tid = $_REQUEST['t'];<br />
	}<br />
	else{<br />
	$tid = 've';}<br />
// count should only be a number. don't allow text for xss protection<br />
if (!empty($_REQUEST['count'])) {<br />
	$countnum = number($_REQUEST['count']);<br />
	$limit = $countnum;<br />
}<br />
	// DEFAULTS<br />
	$adjacents = 10;<br />
	//$targetpage = .'.html';<br />
	// VARS<br />
	if(substr($pagestring, 0, 1) != '?') $pagestring = '?' . $pagestring; // If query string is lacking start, add it<br />
	if(substr($pagestring, strlen($pagestring) - 5) != 'page=') $pagestring .= '&#038;page='; // If query string is lacking page var, add it<br />
	$prev = $page - 1;<br />
	$next = $page + 1;<br />
	$firstpage = 1;<br />
	$lastpage = ceil($totalitems / $limit);<br />
	$fiop = ($limit * $page) - $limit + 1; //# of first item displayed in current page<br />
	$liop = min($limit * $page, $totalitems); //# of last item displayed in current page<br />
	$searchstring = "&amp;t=$tid&amp;inx=$inxv";<br />
	$nicetotal = number_format($totalitems);</p>
<p>	/*<br />
		DRAW PAGINATOR<br />
	*/</p>
<p>	// Give it the right class (the footer paginator has no summary and the current page has a different gfx)<br />
	if($placement == 'summary')<br />
		$type = 'summary';<br />
	else<br />
		$type = 'footer';</p>
<p>	// Draw summary<br />
	if($placement == 'summary')<br />
		$pagination .= "
<div class=\"summary hd\">
<h4>$string_results_page</h4>
</div>
<p>";</p>
<p>	if($lastpage > 1) // Paginator page selection is drawn only if more than 1 pages are there<br />
	{	</p>
<p>		$pagination .= '
<div class="bd">
<ul>';</p>
<p>		// First page selector<br />
		if ($page > 2) </p>
<p>		// Previous page selector<br />
		if ($page > 1)<br />
			$pagination .= "
<li class=\"prevlink\"><a href=\"$safeQuery.html$pagestring$prev$searchstring\">$string_next</a></li>
<p>";	</p>
<p>		// Page selectors<br />
		if ($page < 4)	//not enough pages to bother<br />
		{<br />
			for ($counter = 1; $counter <= min(5, $lastpage); $counter++)<br />
			{<br />
				if ($counter == $page)<br />
					$pagination .= "
<li class=\"current\"><strong>$counter</strong></li>
<p>";<br />
				else<br />
					$pagination .= "
<li><a href=\"$safeQuery.html$pagestring$counter$searchstring\">$counter</a></li>
<p>";<br />
			}<br />
		}<br />
		elseif ($page > $lastpage - 3)<br />
		{<br />
			for($counter = $lastpage - min(5, $lastpage); $counter <= $lastpage; $counter++)<br />
			{<br />
				if ($counter == $page)<br />
					$pagination .= "
<li class=\"current\"><strong>$counter</strong></li>
<p>";<br />
				else<br />
					$pagination .= "
<li><a href=\"$safeQuery.html$pagestring$counter$searchstring\">$counter</a></li>
<p>";<br />
			}<br />
		}<br />
		else<br />
		{<br />
			for($counter = $page - 2; $counter <= $page + 2; $counter++)<br />
			{<br />
				if ($counter == $page)<br />
					$pagination .= "
<li class=\"current\"><strong>$counter</strong></li>
<p>";<br />
				else<br />
					$pagination .= "
<li><a href=\"$safeQuery.html$pagestring$counter$searchstring\">$counter</a></li>
<p>";<br />
			}<br />
		}</p>
<p>		//next button<br />
		if ($page < $lastpage)<br />
			$pagination .= "
<li class=\"nextlink\"><a href=\"$safeQuery.html$pagestring$next$searchstring\">$string_next</a></li>
<p>";</p>
<p>		//last button<br />
		if ($page < $lastpage - 1) </p>
<p>		$pagination .= '</ul>
</div>
<p>';<br />
	}</p>
<p>	$pagination = "
<div class=\"pagelinks \">$pagination</div>
<p>";</p>
<p>	return $pagination;</p>
<p>} ?></p>
<p><?php</p>
<p>//This allows user to easily try the search with different options</p>
<p>// strings are translated defined in separate file for localization<br />
//$string_try_diff_type   = "Try a different type of search";<br />
//$string_try_diff_header = "Didn't find what you were looking for?";<br />
//$string_try_inx         = "Try searching for $safeQuery only in page titles";</p>
<p>function trySomethingelse($safeQuery, $searchQuery, $inx, $tid,$string_try_diff_header, $string_try_diff_type, $string_try_inx, $string_buzz_tab, $string_local_tab,$string_recipes_tab){<br />
if($inx==''){<br />
$tryinx = "
<li><a href=\"/$safeQuery.html?inx=int\">$string_try_inx</a>";<br />
}<br />
$trydiff='';<br />
switch ($tid){<br />
case "rc":<br />
$trydiff = "</p>
<li>$string_try_diff_type <a href=\"/$safeQuery.html?t=lo\">$string_local_tab</a> or<br />
<a href=\"/$safeQuery.html?t=ve\">$string_buzz_tab</a>";<br />
break;<br />
case "lo":<br />
$trydiff = "</p>
<li>$string_try_diff_type <a href=\"/$safeQuery.html?t=rc\">$string_recipes_tab</a> or<br />
<a href=\"/$safeQuery.html?t=ve\">$string_buzz_tab</a>";<br />
break;<br />
default:<br />
$trydiff = "</p>
<li>$string_try_diff_type <a href=\"/$safeQuery.html?t=rc\">$string_recipes_tab</a> or<br />
<a href=\"/$safeQuery.html?t=lo\">$string_local_tab</a>";<br />
}</p>
<p>?></p>
<div class="different mod">
<div class="hd"><?php print $string_try_diff_header ;?></div>
<div class="bd">
<ul>
<?php<br />
print 	$tryinx;<br />
print  	$trydiff;<br />
?></p>
</ul>
</div>
</div>
<p><?php<br />
}<br />
?></p>
<p></code></p>
<p>
I&#8217;ve added a few classes to the final output. The previous and next links have class&#8221;nextlink&#8221; or class=&#8221;prevlink&#8221;. The current page has the number within a strong tag with class=&#8221;current&#8221;. Finally, the parent module has class=&#8221;pagelinks mod&#8221;. This makes it pretty simple to style</p>
<h4>Pagination CSS</h4>
<p>I&#8217;m using the YUI Sam Skin sprite for the tabbed search box. I&#8217;ve added a couple arrows to this sprite for my search pagination. </p>
<p><code lang="CSS"><br />
.pagelinks {<br />
text-align:center;<br />
border:1px solid #ccc;<br />
padding:5px 0 0 0;<br />
}<br />
.pagelinks ul li {<br />
display:inline;<br />
}<br />
.pagelinks ul a, .pagelinks ul strong {<br />
display;block; padding:3px 5px;<br />
}<br />
.pagelinks ul strong {<br />
background-color:green; color:#fff;<br />
}<br />
.pagelinks li.nextlink a,.pagelinks li.prevlink a  {<br />
padding-right:15px; font-size:120%; font-wieght:bold; background:url(/images/sprite.png) no-repeat 100% -1943px;<br />
}<br />
.pagelinks li.prevlink a {<br />
padding-right:0px; padding-left:15px; background-position:0 -1973px;<br />
}<br />
</code></p>
<p>
I am also not a PHP expert and welcome suggestions on improving the code.</p>
<h3>Download files</h3>
<ul>
<li><a href="http://www.last-child.com/pagination.txt">Pagination functionality for a BOSS site (.txt)</a> &#8211; the php code and sample to insert the pagination.</li>
</ul>
<h3>Related articles by Zemanta</h3>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://chris.pirillo.com/2008/09/11/are-you-tired-of-the-same-old-search-engine/">Are You Tired of the Same Old Search Engine?</a></li>
<li class="zemanta-article-ul-li"><a href="http://lifehacker.com/5046701/buildasearch-combines-multiple-site-seaches-into-one-box">Buildasearch Combines Multiple Site Seaches into One Box [Search]</a></li>
<li class="zemanta-article-ul-li"><a href="http://www.last-child.com/create-search-yahoo-boss/">Create your own Search Engine with Yahoo! BOSS</a></li>
<li class="zemanta-article-ul-li"><a href="http://blog.programmableweb.com/2008/09/11/5-best-practices-for-mashups/">5 Best Practices for Mashups</a></li>
<li class="zemanta-article-ul-li"><a href="http://blog.programmableweb.com/2008/09/11/5-best-practices-for-mashups/">5 Best Practices for Mashups</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/pagination-boss-search-engine/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Create a tabbed search form with YUI</title>
		<link>http://www.last-child.com/tabbed-search-form-yui/</link>
		<comments>http://www.last-child.com/tabbed-search-form-yui/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 14:00:59 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Form]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Link]]></category>
		<category><![CDATA[Online Resource]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[Yahoo!]]></category>
		<category><![CDATA[Cascading Style Sheets]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.last-child.com/?p=159</guid>
		<description><![CDATA[Yahoo! makes it easy to create an accessible, handsome tabbed interface. I used their Tab View library to create the tabbed search form for V3GGIE.com. While Tab View can create the tabbed content dynamically, I&#8217;m using it to hide/show hard-coded individual forms. Update: I&#8217;ve removed the tabbed interface from V3GGIE.com. This particular use of the [...]]]></description>
			<content:encoded><![CDATA[<p>Yahoo! makes it easy to create an accessible, handsome tabbed interface. I used their Tab View library to create the tabbed search form for <a href="http://v3ggie.com">V3GGIE.com</a>. While Tab View can create the tabbed content dynamically, I&#8217;m using it to hide/show hard-coded individual forms.</p>
<p><ins datetime="2008-09-28T16:10:07+00:00"><strong>Update:</strong> I&#8217;ve removed the tabbed interface from V3GGIE.com. This particular use of the tabbed module seemed to have created some confusion in users. The approach is still valid, just not the way I originally implemented it.</ins><a href="http://v3ggie.com"><img src="http://www.last-child.com/wp-content/uploads/2008/09/v3ggie-form-300x45.png" alt="" class="alignnone size-medium wp-image-160" height="45" width="300"> See the tabbed search form on V3GGIE.com </a></p>
<h3>Step 1. Create the basic HTML code.</h3>
<p>The tabbed code is a simple pattern: </p>
<ol>
<li>Start with a parent div and give it an id and class=&#8221;yui-navset&#8221;.<br />
	  <code lang="HTML">
<div class="yui-g yui-navset" id="v3search"></div>
</li>
<p></code></p>
<li>Create an unordered list inside this div with class=&#8221;yui-nav&#8221;.</li>
<li>Each list includes a deep link to a corresponding div that is also a child of the parent div. The link text in an em tag.<br />
	  <code lang="HTML">
<li><a href="#vesearch"><em>V3GGIE Search</em></a></li>
<p></code></li>
<li>Create a div with class=&#8221;yui-content&#8221; and create a set of content containing divs. Each div has an id.<br />
	  <code lang="HTML"></p>
<div class="yui-content">
<div id="vesearch">...</div>
<div id="losearch">...</div>
<div id="rcsearch">...</div>
</p></div>
<p></code>
	</li>
<li>Insert the Tabview CSS at the top of the page, the Tab View JS at the bottom of the page, create a small js that instantiates the tab-view module.</li>
<li>For easier styling, use the sam_skin CSS package and add class=&#8221;yui-skin-sam&#8221; to the body.</li>
</ol>
<h3>Step 2. Use PHP to make it more interesting</h3>
<p>Each page calls this chunk of code to insert the tabbed form, it also sets a variable ($selected),  determining which tab is selected on page load. I&#8217;m also inserting the last search query into the text input to make it easier on the user. This is easily done by grabbing the query from the Request object. </p>
<p>The finished code: </p>
<p>	<code lang="PHP"></p>
<div class="yui-g yui-navset" id="v3search">
<!--<?php print $selected ;?>--></p>
<ul class="yui-nav">
<li> &gt;<a href="#vesearch"><em>V3GGIE Search</em></a></li>
<li> &gt;<a href="#losearch"><em>Local</em></a></li>
<li> &gt;<a href="#rcsearch"><em>Recipes</em></a></li>
<li> &gt;<a href="#nesearch"><em>News</em></a></li>
<li> &gt;<a href="#blsearch"><em>Blogs</em></a></li>
</ul>
<div class="yui-content">
<div id="vesearch">
<form name="b" action="/results.php" method="get">
   <label for="vquery">Search for Vegetarian information</p>
<input id="vquery" size="50" name="query" value="&lt;?php print $inputtext; ?&gt;" type="text"></label></p>
<input class="searchsubmit" value="Search" type="submit">
   </form>
</p></div>
<div id="losearch">
<form name="b" action="/local/results.php" method="get">
   <label for="lquery">Where do you want to eat?</p>
<input size="50" id="lquery" name="query" value="&lt;?php print $inputtext; ?&gt;" type="text"></label></p>
<input class="searchsubmit" value="Search" type="submit">
<p>Try "San Francisco Pho", "Paris Fromage",  or "92104 tofu"</p>
</p></form>
</p></div>
<div id="rcsearch">
<form name="b" action="/recipes/results.php" method="get">
   <label for="rquery">What are you hungry for?</p>
<input size="50" name="query" id="rquery" value="&lt;?php print $inputtext; ?&gt;" type="text"></label></p>
<input class="searchsubmit" value="Search" type="submit">
<p>Try "corn chowder" or "vegan pizza"</p>
</p></form>
</p></div>
<div id="nesearch">
<form name="b" action="/news/results.php" method="get">
   <label for="nquery">Get Vegetarian news?</p>
<input size="50" id="nquery" name="query" value="&lt;?php print $inputtext; ?&gt;" type="text"></label></p>
<input class="searchsubmit" value="Search" type="submit">
<p>Try "Vegetarian Chinese Olympics"</p>
</p></form>
</p></div>
<div id="blsearch">
<form name="b" action="/blogs/results.php" method="get">
   <label for="bquery">What are the blogs saying?</p>
<input size="50" id="bquery" name="query" value="&lt;?php print $inputtext; ?&gt;" type="text"></label></p>
<input class="searchsubmit" value="Search" type="submit">
<p> Try a subject: "PETA", "Tempeh", or "Paris -Hilton Vegetarian"</p>
</p></form>
</p></div>
</p></div>
</p></div>
<p></code></p>
<p><a href="http://v3ggie.com/search-form.txt">View the source as a text file</a></p>
<h3>The Final Product</h3>
<p>We now have a tabbed module that allows the user to find recipes, news, blogs, and local restaurants from any page. This is an easy introduction to the <a href="http://developer.yahoo.com/YUI/">YUI</a> libraries. However,  I came across the following surprises:</p>
<ul>
<li>The order of the tabs must match the order of the target divs. I moved my tabs around and discovered they were toggling the wrong forms.</li>
<li>The links that generate the tabs need to have em tags surrounding the text</li>
<li>You&#8217;ll need to download the entire <a href="http://sourceforge.net/project/downloading.php?group_id=165715&amp;filename=yui_2.5.2.zip">YUI package</a> to gain access to the CSS and sprites needed for the library. The examples on the YUI site assume relative links to files, you will either need to duplicate that file structure or upload the skin&#8217;s sprite and change the CSS accordingly. </li>
</ul>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://woork.blogspot.com/2008/07/navigation-bar-with-tabs-using-css.html">Navigation bar with tabs using CSS and sliding doors effect</a></li>
<li class="zemanta-article-ul-li"><a href="http://ajaxian.com/archives/filament-groups-accessible-extensions">Filament Group&#8217;s Accessible Extensions</a></li>
<li class="zemanta-article-ul-li"><a href="http://www.stylegala.com/news/public200809/4777.htm">jQuery Nested Menu</a></li>
<li class="zemanta-article-ul-li"><a href="http://ajaxian.com/archives/the-lessons-of-css-frameworks">The lessons of CSS frameworks</a></li>
<li class="zemanta-article-ul-li"><a href="http://ajaxian.com/archives/rounded-tabs-with-dijit">Rounded tabs with Dijit</a></li>
<li class="zemanta-article-ul-li"><a href="http://jtame05.wordpress.com/2008/06/16/dynamic-css-yet-another-follow-up/">Dynamic CSS (Yet another follow up)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/tabbed-search-form-yui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create your own Search Engine with Yahoo! BOSS</title>
		<link>http://www.last-child.com/create-search-yahoo-boss/</link>
		<comments>http://www.last-child.com/create-search-yahoo-boss/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 20:38:41 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Online Resource]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[Yahoo!]]></category>
		<category><![CDATA[Application programming interface]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Web search engine]]></category>
		<category><![CDATA[Yahoo Boss]]></category>

		<guid isPermaLink="false">http://www.last-child.com/?p=158</guid>
		<description><![CDATA[Yahoo! recently launched BOSS, which opened their search platform to developers around the world. They didn&#8217;t just create an API to access data. That has been around for a while. Yahoo! has opened the data to developers with no limits on requests, no restrictions of icon use, results display, or even the need to let [...]]]></description>
			<content:encoded><![CDATA[<p>
    Yahoo! recently launched <a href="http://developer.yahoo.com/search/boss/" title="Build Own Search Service">BOSS</a>, which opened their search platform to developers around the world. They didn&#8217;t just create an API to access data. That has been around for a while. Yahoo! has opened the data to developers with no limits on requests, no restrictions of icon use, results display, or even the need to let people know the search engine is Yahoo! based.</p>
<p>   <a href="http://developer.yahoo.com/search/boss"><img src="http://l.yimg.com/a/i/ydn/boss/boss_info4.gif" alt="Yahoo BOSS plus your special sauce equals search innovation" class="plainimage" /></a> </p>
<p>
    This open approach lets anyone build a search engine to their particular skills, mash the data with other sources, re-arrange results, or any other novel idea for the next king of search.  You could also use BOSS to add search capabilities to a pre-existing site, limiting the resuts to just its data.</p>
<p>
    Why is Yahoo! doing this? It&#8217;s a brash approach to push search beyond its current status of pages with ordered sets of links You can let your imagine fly with the only cost being your personal development investment.  I recently took this challenge and decided to build a search engine for vegetarians.</p>
<h3>V3GGIE &#8211; A Vegetarian Search Engine</h3>
<p>My goals were simple:</p>
<ol>
<li>Create a simple site that could be copied easily as a proof of concept for other genres. Document the construction for others to explore.      </li>
<li>Keep it fast with minimal javascript and images      </li>
<li>Use as much Yahoo infrastructure as possible to minimize development time      </li>
<li><strong>Most importantly:</strong> return information relevant to the niche audience: Vegetarians and Vegans.
</li>
</ol>
<p>I&#8217;m not a PHP expert and some of my code is crude. I hope to clean it up and add a number of features to enhance performance and usability. However, the code samples will still be useful to the PHP beginner. More advanced PHP programmers could easily see where they&#8217;d take the concepts and improve on them.</p>
<h3>Set up the basic structure</h3>
<p><a href="http://v3ggie.com">V3ggie</a> has a basic workflow, there&#8217;s an input and result page. Arguably, this should only be one page which displays the original landing and subsequent results. I have separated them as I hope to create extra content that is appropriate to either the landing or results pages. </p>
<p>Further, there are several search engines built into this site. Each has a specific set of resources to fine tune the results. Currently, these are built with subdirectories (/recipes/, /blogs/, /news/, /local/ ). Each subsection includes   index and result pages. This could be changed by utilizing rewrite rules. I&#8217;ve kept it simple for now.</p>
<h3>Setup the Resources</h3>
<p>The <a href="http://developer.yahoo.com/search/boss/">BOSS API</a> allows you to create a query param with a list of domains to search through. This is the easiest way to fine tune your results. For instance, the <a href="http://v3ggie.com/recipes/">V3ggie recipe search page</a> uses a list of vegetarian cooking sites as well as the vegetarian subdirectories of <a href="http://epicurious.com">Epicurious</a> and FoodNetwork. </p>
<p><a href="http://technorati.com">Technorati</a> is the source for blog buzz. V3ggie searches through blogs tagged with &#8220;vegetarian&#8221; and/or &#8220;vegan&#8221;. This helps get the vegetarian viewpoint for any subject.</p>
<p>You have complete freedom to mash the data as much as you like. You could take the search results and mix them with other data, such as the page rank for a result page, the company or product&#8217;s appearance on <a href="http://wikipedia.org">wikipedia</a>, or perhaps data you&#8217;ve stored in your own databases. I can imagine creating an internal product search page that cross-references the results with a list of preferred vendors to encourage employees to purchase supplies from the correct vendor.</p>
<h3>Setup the Platform</h3>
<p>V3ggie is built from <a href="http://developer.yahoo.com/php/">PHP</a>. However, Yahoo! has also provided a python platform, the <a href="http://developer.yahoo.com/search/boss/mashup.html">BOSS Mashup Framework</a>, for building sites very quickly. You can combine this with the <a href="http://code.google.com/appengine/">Google App Engine</a> to create a custom search engine in a short time. <a href="http://4hoursearch.com">Four Hour Search</a>, formally known as <strong>Yuil</strong>, is such an example. It got its name from the length of time it required to research a domain name, setup Google Apps, and build the final search web site. Personally, I spent more than 4 hours trying to get Google Apps set up and I really didn&#8217;t want to learn yet another language (python). </p>
<h3>YUI on the frontend</h3>
<p>The <a href="http://developer.yahoo.com/yui">Yahoo! User Interface library</a> handles the tedious, basic formatting of a page. The <a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets" title="Cascading Style Sheets" rel="wikipedia" class="zem_slink">CSS</a> libraries allow you to create a wide variety of page grids, standardize the fonts, reset browser inconsistencies and establish a common look and feel. </p>
<p>I started the project by using the <a href="http://developer.yahoo.com/yui/grids/builder/">CSS Grid Builder</a>. This easy to use tool sets up the page with the desired columns and includes the base css files. I then added the YUI Base CSS file. This takes the plain page and re-establishes the margins and font-styles for a basic site. These two CSS files will remove 75% of the CSS you would normally have to write for a site. Now you can concentrate on what makes your site special.</p>
<p>I also wanted to offer different seach options from a single interface. Once again, I used the <a href="http://developer.yahoo.com/yui/tabview/">YUI TabView</a> package. This combination of CSS and JS allows you to create a semantic set of links and corresponding series of div wrapped objects. YUI Tab View will turn this into the tabbed interface that even has built in ARIA support for screen readers.</p>
<p>I had some trouble getting the tabs to look correct. The documentation does not make it very clear that  tab links must have an em within the links to get the proper look and feel. I also downloaded the preferred sprite and used fireworks to change the tab color gradients from blue to green. </p>
<p>Yahoo also provides a <a href="http://developer.yahoo.com/ypatterns/">design pattern library</a>. This helped me configure my pagination links. Yahoo has spent a lot of time with user testing to make sure things are easy to use.</p>
<h3>Create your own search engine</h3>
<p>So, what are you wating for? Visit the <a href="htp://developer.yahoo.com">Yahoo Developer Network</a> and start by signing up and getting a application key. I will write separate posts that describe how to build various components of the page. I&#8217;m looking forward to hearing from better PHP programmers on how to improve the code.</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.saurabhsahni.com/2008/08/natural-language-image-search-with-boss-and-app-engine/">Natural Language Image Search with Yahoo Boss and Google App Engine</a></li>
<li class="zemanta-article-ul-li"><a href="http://www.techcrunch.com/2008/08/04/yahoo-boss-is-so-open-it-runs-on-googles-app-engine/">Yahoo Boss Is So Open, It Runs on Google&#8217;s App Engine</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/create-search-yahoo-boss/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ARIA support with the YUI library</title>
		<link>http://www.last-child.com/aria-support-with-the-yui-library/</link>
		<comments>http://www.last-child.com/aria-support-with-the-yui-library/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 16:15:51 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[Yahoo!]]></category>

		<guid isPermaLink="false">http://www.last-child.com/?p=157</guid>
		<description><![CDATA[AJAX and DHTML have made web sites more interactive and easier to use. At least for visitors who are not using a screen reader. Screen reader users have to struggle with pages that lose focus, change without prompting the user of new data, and much more. However, there are many developers working on solutions to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29" title="Ajax (programming)" rel="wikipedia" class="zem_slink">AJAX</a> and <a href="http://en.wikipedia.org/wiki/Dynamic_HTML" title="Dynamic HTML" rel="wikipedia" class="zem_slink">DHTML</a> have made  web sites more interactive and easier to use. At least for visitors who are  not using a screen reader. Screen reader users have to struggle with pages that lose focus, change without prompting the user of new data, and much more. However, there are many developers working on solutions to this problem.</p>
<p>Todd Kloots, of the Yahoo User Interface group was one of the first to develop accessible javascript libraries with the YUI menu package. He just published a blog post on the YUI web site about adding ARIA support to the YUI tab package. This information could also help you add this functionality to your existing YUI-based applications. </p>
<p>Here&#8217;s how Todd describes the goal</p>
<blockquote cite="http://yuiblog.com/blog/2008/07/30/tabview-aria/">
<p>
The <a href="http://developer.yahoo.com/yui/tabview/">YUI TabView Control</a> is built on a strong<br />
foundation of semantic markup that provides users with some basic accessibility.  But while TabView looks like a desktop tab control, <a href="http://en.wikipedia.org/wiki/Screen_reader" title="Screen reader" rel="wikipedia" class="zem_slink">screen readers</a> don’t present it as an atomic<br />
widget, leaving users to figure out how the various HTML elements that compose a TabView relate to each other.  However, through the application of the <a href="http://www.w3.org/TR/wai-aria/">WAI-ARIA Roles and States</a>, it is possible to enhance TabView’s accessibility such that users of screen readers perceive it as a desktop tab control.
</p>
<p><cite><a href="http://yuiblog.com/blog/2008/07/30/tabview-aria/">Enhancing TabView Accessibility with WAI-ARIA Roles and States</a>  &#8211; Todd Kloots</cite>
</p></blockquote>
<p>The following video shows how this approach works with Firefox and a screen reader.</p>
<div><object height="322" width="512"><param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.17"><param name="allowFullScreen" value="true"><param name="bgcolor" value="#000000"><param name="flashVars" value="id=9051193&amp;vid=3199866&amp;lang=en-us&amp;intl=us&amp;thumbUrl=http%3A//us.i1.yimg.com/us.yimg.com/p/i/bcst/videosearch/4371/69134473.jpeg&amp;embed=1"><embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.17" type="application/x-shockwave-flash" allowfullscreen="true" bgcolor="#000000" flashvars="id=9051193&amp;vid=3199866&amp;lang=en-us&amp;intl=us&amp;thumbUrl=http%3A//us.i1.yimg.com/us.yimg.com/p/i/bcst/videosearch/4371/69134473.jpeg&amp;embed=1" height="322" width="512"></object><br /><a href="http://video.yahoo.com/watch/3199866/9051193">YUI TabView with ARIA roles and states/Todd Kloots</a> @ <a href="http://video.yahoo.com">Yahoo! Video</a></div>
<h3>Related articles </h3>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://arstechnica.com/news.ars/post/20080708-ibm-makes-web-accessibility-for-blind-users-a-social-effort.html">IBM makes web accessibility for blind users a social effort</a></li>
<li class="zemanta-article-ul-li"><a href="http://ajaxian.com/archives/accessible-google-charts">Accessible Google Charts</a></li>
<li class="zemanta-article-ul-li"><a href="http://ajaxian.com/archives/axsjax-access-enabling-ajax">AxsJAX: Access-Enabling AJAX</a></li>
<li class="zemanta-article-ul-li"><a href="http://www.nytimes.com/idg/IDG_852573C4006938800025747F007CBD5E.html?partner=rssnyt&amp;emc=rss">I.B.M. Software Enhances Web Accessibility for the Blind</a></li>
<li class="zemanta-article-ul-li"><a href="http://www.ajaxperformance.com/2007/08/29/quick-follow-up-more-yui-compressor-work/">Quick follow-up: more YUI Compressor work</a></li>
<li class="zemanta-article-ul-li"><a href="http://ajaxian.com/archives/high-performance-ajax-applications">High Performance Ajax Applications</a></li>
<li class="zemanta-article-ul-li"><a href="http://ajaxian.com/archives/reminded-of-speaking-your-yahoolang">Reminded of speaking your YAHOO.lang</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/aria-support-with-the-yui-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple asides categories in WordPress?</title>
		<link>http://www.last-child.com/multiple-asides-categories-in-wordpress/</link>
		<comments>http://www.last-child.com/multiple-asides-categories-in-wordpress/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 19:44:25 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[Templates]]></category>
		<category><![CDATA[Weblogs]]></category>
		<category><![CDATA[Yahoo!]]></category>

		<guid isPermaLink="false">http://www.last-child.com/multiple-asides-categories-in-wordpress/</guid>
		<description><![CDATA[I&#8217;m working on a new theme for WordPress. It&#8217;s a generic theme that I hope will make it easier to build multiple business sites in the future. Part of the goal is integrating the Yahoo! YUI library into the superb K2 theme. I&#8217;ve come across a problem that should be easy to solve. WordPress allows [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a new theme for <a href="http://wordpress.org">WordPress</a>. It&#8217;s a generic theme that I hope will make it easier to build multiple business sites in the future. Part of the goal is integrating the <a href="http://developer.yahoo.com">Yahoo! YUI library</a> into the superb<a href="http://getk2.com"> K2</a> theme. </p>
<p>I&#8217;ve come across a problem that should be easy to solve. <a href="http://wordpress.org/" title="WordPress" rel="homepage" target="_blank" class="zem_slink">WordPress</a> allows you to create a category whose posts are displayed differently than other category posts. These &#8220;asides&#8221; are short posts that appear in the side bar and not in the main body of the blog. This functionality is baked into the latest versions of WordPress and the K2 theme&#8217;s admin screen makes it really easy to use.</p>
<p>However, I need to add a second variation of the asides. I want to create a new landing page with three promo spots just below the topnav. This branding section would allow the site to highlight important features, promos, sales, or blog posts. This could be done with asides, however I don&#8217;t want to lose the functionality of asides in the blog section.</p>
<h3>Asides become Promos</h3>
<p>I&#8217;ve started by cloning the asides module and functionality and creating a new set of functions (promos). The admin screen now allows you to choose a category that will be defined as a promo. Everything seems to be working until you get to the blog post page. Blog posts labeled as the asides category appear as they should.</p>
<p>However, the promos category and promo posts are not following the aside functionality. I&#8217;ve looked at the loop to see where it excludes the asides category and can&#8217;t find it. I can&#8217;t find the &#8220;the_post()&#8221; function, which may be the source of the issue. I would assume that the promos module is telling the_post that &#8220;promos&#8221; category is special and these posts should not be included in the loop, nor in the category list. </p>
<h3>help?</h3>
<p>Have you worked with the asides functionality in WordPress? Do you have any suggestions? I&#8217;ll post a summary when I get the solution figured out.</p>
<h3>Resources</h3>
<p>Here&#8217;s a list of related web pages that include information but haven&#8217;t answered my questions.</p>
<ul>
<li><a href="http://codex.wordpress.org/The_Loop">WordPress Codex: The Loop</a></li>
<li><a href="http://codex.wordpress.org/Function_Reference/WP_Query">WP_Query function reference</a></li>
<li><a href="http://wordpress.org/support/topic/119459">1 post, 3 asides on front page support question</a></li>
<li><a href="http://codex.wordpress.org/Adding_Asides">Adding Asides</a></li>
</ul>
<h3>Updates</h3>
<p>The above link for <a href="http://codex.wordpress.org/The_Loop">the loop</a> has some interesting information on multiple loops within one page. I&#8217;m going through the examples for some answers. Here&#8217;s a snippet of the post:</p>
<blockquote>
<h4> Loop Examples</h4>
<p>Below are two examples of using multiple loops. The key to using multiple loops is that $wp_query can only be called once. In order to get around this it is possible to re-use the query by calling rewind_posts() or by creating a new query object. This is covered in example 1. In example 2, using a variable to store the results of a query is covered. Example 3 documents the use of the update_post_caches(); function to avoid common plugin problems. Finally, ‘multiple loops in action’ brings a bunch of ideas together to document one way of using multiple loops to promote posts of a certain category on your blog’s homepage.<br />
<cite><a href="http://codex.wordpress.org/The_Loop">WordPress Codex: The Loop</a></cite>
</p></blockquote>
<h3>Updated: the solution</h3>
<p>During my initial modification of the files, I missed an important line that tells the loop to honor a new filter. So, if you want to duplicate the asides functionality with a new category, add this new section to wordpress/wp-content/themes/k2/app/includes/info.php<br />
<code lang="PHP"><br />
function k2promos_filter($query) {<br />
	global $k2sbm_current_module;<br />
	$promos = get_option('k2promoscategory');<br />
	// Only filter when it's in the homepage<br />
	if ( ($promos != 0) and ($query-&gt;is_home) and (!$k2sbm_current_module) and</p>
<p>		( (function_exists('is_active_module') and is_active_module('promos_module')) or<br />
		  (function_exists('is_active_widget') and is_active_widget('k2_promos_widget')) ) ) {<br />
                $priorcat = $query-&gt;get('cat');<br />
		if ( !empty($priorcat) ) {<br />
			$priorcat .= ',';<br />
		}<br />
		$query-&gt;set('cat', $priorcat . '-' . $promos);<br />
	}<br />
	return $query;<br />
}<br />
// Filter to remove promos from the loop<br />
add_filter('pre_get_posts', 'k2promos_filter');<br />
</code><br />
In a fit of cleverness, I changed the naming convention on my promos from promos_sidebar_module to promos_module. This threw my code off for a while.</p>
<p>This is the rough draft of my promos.php file that sits in wordpress/wp-content/themes/k2/app/modules/promos.php<br />
<code lang="PHP"></p>
<div class="bd">
have_posts() ):<br />
		$promos-&gt;the_post();<br />
?&gt;</p>
<div class="&lt;?php k2_post_class($promos_count++, true); ?&gt;">
<p>',''); ?&gt;
</p></div>
</div>
<p><label for="promos-module-num-posts"></label><br />
<input id="promos-module-num-posts" name="promos_module_num_posts" value="&lt;?php echo(sbm_get_option('num_posts')); ?&gt;" size="2" type="text"></p>
<p> 3));<br />
register_sidebar_module_control('Promos', 'promos_module_control');<br />
?&gt;</p>
<p></code></p>
<p>There are also some changes in the options.php file and sbm section. Do a search for asides and start replacing with your new function, i.e. promos.</p>
<h3>Remove the categories from latest posts and categories modules</h3>
<p>The next step in this process was to make sure the promos category (and asides) don&#8217;t appear in the category and latest posts modules. These two modules sit inside the /k2/app/modules/ folder. They also use similar logic. We need to create a comma delimited list of categories to exclude from the functions that build the appropriate lists. </p>
<p>This code checks for aside and promos categories. It then creates a comma separator and then combines the categories into a string, i.e. &#8220;12,13&#8243;<br />
<code lang="PHP"><br />
global $k2sbm_current_module;</p>
<p>$promos = get_option('k2promoscategory');<br />
$asides = get_option('k2asidescategory');<br />
/* lets create a new variable, excludes and use this to populate the exclude=foo parameter.*/<br />
$excludes = "";<br />
if ( ($asides != 0) or ($promos != 0 )) {<br />
$separator = (($asides!=0)&amp;&amp;($promos!=0)) ? "," : "";<br />
$excludes = $asides . $separator . $promos;<br />
}</p>
<p></code></p>
<p>For the latest posts, we&#8217;ll need to create a slightly different string. We need to create a parameter and add a negative sign to each category</p>
<p><code lang="PHP"><br />
$excludes = '-' . $asides . $separator . '-' . $promos;<br />
</code><br />
actually, this is bad logic, I need to only add the &#8211; if the category exists. That&#8217;s what is great about blogging your code. You realize your mistakes before it is too late.</p>
<p>Finally, we use that excludes variable in the logic to hide the categories, for example (categories.php)<br />
<code lang="PHP"><br />
wp_list_categories('title_li=&amp;show_count=1&amp;hierarchical=0&amp;exclude=' . $excludes);<br />
</code></p>
<p>These snippets assume you do not want to include your asides posts into the latest posts and categories modules. you can simplify the code if you only want to exclude the promos.</p>
<ul class="zemanta-article-ul" >
<li class="zemanta-article" ><a title="Open in new window" href="http://performancing.com/wordpress-tips/wordpress-hacks-upgrading-versions">WordPress Hacks: Upgrading Versions</a> [via&nbsp;Zemanta]</li>
<li class="zemanta-article"><a title="Open in new window" href="http://www.blogherald.com/2008/03/26/wordpress-wednesday-news-wordpress-25-due-any-day-beta-2-released-many-plugins-updated-wordcamp-dallas-this-weekend-wordcamp-uk-suggested-and-more/">WordPress Wednesday News: WordPress 2.5 Due Any Day, Beta 2 Released, Many Plugins Updated, WordCamp Dallas This Weekend, WordCamp UK Suggested, and More</a> [via&nbsp;Zemanta]</li>
<li class="zemanta-article" ><a title="Open in new window" href="http://www.techcrunch.com/2008/03/27/a-content-suggestion-engine-for-blogging-that-could-work/">A content suggestion engine for blogging? That could work&#8230;</a> [via&nbsp;Zemanta]</li>
</ul>
</fieldset>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/multiple-asides-categories-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yahoo! Music &#8211; Easy, semantic, unobtrusive music badges</title>
		<link>http://www.last-child.com/yahoo-music-easy-semantic-unobtrusive-music-badges/</link>
		<comments>http://www.last-child.com/yahoo-music-easy-semantic-unobtrusive-music-badges/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 12:59:09 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[DHTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Online Resource]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[Yahoo!]]></category>

		<guid isPermaLink="false">http://www.last-child.com/yahoo-music-easy-semantic-unobtrusive-music-badges/</guid>
		<description><![CDATA[Let&#8217;s say you want to link to a song on the internet. Let&#8217;s also say that you want your users to easily listen to that music. Further, let&#8217;s say you want people to find and enjoy the music without having JavaScript enabled. Is this asking too much? Yahoo&#8217;s Christian Heilmann has been advocating layered, semantic [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you want to link to a song on the internet. Let&#8217;s also say that you want your users to easily listen to that music. Further, let&#8217;s say you want people to find and enjoy the music without having JavaScript enabled.</p>
<h3>Is this asking too much?</h3>
<p>Yahoo&#8217;s <a href="http://www.wait-till-i.com/">Christian Heilmann</a> has been advocating <a href="http://www.wait-till-i.com/2008/02/12/the-great-implementer-swindle-making-badge-use-easy-doesnt-make-it-clever/">layered, semantic badging</a>. </p>
<h3>Yahoo Music badges and the simple href</h3>
<p><a href="http://mediaplayer.yahoo.com/">Yahoo! Media Player</a> has taken this approach to embedding music. You simply put a link to a music file in your site, insert the music JavaScript and away you go. The <a href="http://yahoomediaplayer.wikia.com/wiki/How_To_Link">Music Badge Twiki </a>also shows how you can extend the functionality with basic HTML elements, such as adding a title attribute or image inside the link.</p>
<p>Here&#8217;s an example of the badge in effect. <a href="http://music.tdrake.net/orca.mp3" title="untitled song"><img src="http://farm1.static.flickr.com/41/83669348_cbcae831d8_s.jpg" alt="Orca at the Casbah, 1992" />Orca live at the Casbah, 1992</a> I made a bootleg recording of <a href="http://www.flickr.com/photos/draket/83669348/">Orca</a>, a San Diego supergroup circa 1993. I&#8217;m simply going to create a basic link to the music file  and include an optional image from <a href="http://flickr.com">flickr</a>. The JavaScript will use that information for the player to appear. You&#8217;ll see page loads with a little play icon next to the link. There&#8217;s also a small player on the side of the browser. Click on either and you&#8217;ll see a media player appear in your browser with the music controls.</p>
<p>Here&#8217;s the code:<br />
<code lang="HTML"><br />
<a href="http://music.tdrake.net/orca.mp3" title="untitled song"><img src="http://farm1.static.flickr.com/41/83669348_cbcae831d8_s.jpg" alt="Orca at the Casbah, 1992" />Orca live at the Casbah, 1992</a><br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/yahoo-music-easy-semantic-unobtrusive-music-badges/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://music.tdrake.net/orca.mp3" length="48629323" type="audio/mpeg" />
		</item>
		<item>
		<title>Use a content delivery network for dirt cheap</title>
		<link>http://www.last-child.com/use-a-content-delivery-network-for-dirt-cheap/</link>
		<comments>http://www.last-child.com/use-a-content-delivery-network-for-dirt-cheap/#comments</comments>
		<pubDate>Sun, 09 Dec 2007 20:07:02 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[Image]]></category>
		<category><![CDATA[Online Resource]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[Yahoo!]]></category>

		<guid isPermaLink="false">http://www.last-child.com/use-a-content-delivery-network-for-dirt-cheap/</guid>
		<description><![CDATA[The Yahoo! exceptional performance team has released a series of best practice rules for making your site perform significantly faster. Fortunately, the majority of fixes can be handled by any developer. #2 however seems a bit outside the budget of most developers&#8230; until now 2: Use a Content Delivery Network Let&#8217;s say you have a [...]]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://rcm.amazon.com/e/cm?t=csstoyslastch-20&#038;o=1&#038;p=8&#038;l=as1&#038;asins=0596529309&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px; float:right;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe><br />
The <a href="http://developer.yahoo.com/performance/">Yahoo! exceptional performance team</a> has released a series of best practice rules for making your site perform significantly faster. Fortunately, the majority of fixes can be handled by any developer. #2 however seems a bit outside the budget of most developers&#8230; until now</p>
<p>2: Use a Content Delivery Network</p>
<p>Let&#8217;s say you have a small site that has a very local audience. Sally down the street doesn&#8217;t notice any problems with slow images. But what if your site is more global?  Will the Sally equivalent in Europe, Asia, India, or the other side of the country have the same experience?  Probably not.  This is why large sites use the Akamai servers. They can cache images and files closer to the user.</p>
<p>The #2 rule by the exceptional performance team tells us to use one of these distributed asset servers.</p>
<blockquote><p>A content delivery network (CDN) is a collection of web servers distributed across multiple locations to deliver content more efficiently to users. The server selected for delivering content to a specific user is typically based on a measure of network proximity. For example, the server with the fewest network hops or the server with the quickest response time is chosen.</p>
<p>Some large Internet companies own their own CDN, but it&#8217;s cost-effective to use a CDN service provider, such as Akamai Technologies, Mirror Image Internet, or Limelight Networks. For start-up companies and private web sites, the cost of a CDN service can be prohibitive, but as your target audience grows larger and becomes more global, a CDN is necessary to achieve fast response times. At Yahoo!, properties that moved static content off their application web servers to a CDN improved end-user response times by 20% or more. Switching to a CDN is a relatively easy code change that will dramatically improve the speed of your web site.<br />
<cite><a href="http://developer.yahoo.com/performance/rules.html#cdn">Best Practices for Speeding Up Your Web Site</a></cite></p></blockquote>
<h3>Doing this cheaply with Amazon</h3>
<p>Amazon&#8217;s Web Services give you this functionality for a very low cost. There S3 service costs most people less than $5/month. This gives you easy acces to your private database and storage. You pay by the size of your files and the total traffic. </p>
<p>You can further increase your site&#8217;s performance by taking advantage of the hosted <a href="http://developer.yahoo.com/yui/">Yahoo! YUI CSS and JavaScript libraries</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/use-a-content-delivery-network-for-dirt-cheap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Storyboard your DHTML interactions</title>
		<link>http://www.last-child.com/storyboard-your-dhtml-interactions/</link>
		<comments>http://www.last-child.com/storyboard-your-dhtml-interactions/#comments</comments>
		<pubDate>Fri, 28 Sep 2007 22:04:26 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[Developers]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Online Resource]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[Yahoo!]]></category>
		<category><![CDATA[Design pattern]]></category>

		<guid isPermaLink="false">http://www.last-child.com/storyboard-your-dhtml-interactions/</guid>
		<description><![CDATA[Bill Scott gave an interesting lecture today at Yahoo! about AJAX design patterns. He explained how good AJAX designs keep the user&#8217;s attention on the page, remove roadblocks, and increase stickiness to a site. Patterns of successful AJAX behaviors are beginning to appear (Netflix, 37Signals, Yahoo!). There are subtle, and sometimes not so subtle, changes [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/draket/534888874/"><img src="http://farm2.static.flickr.com/1156/534888874_b1c783a5a8_m.jpg" alt="Bill Scott - AJAX God"></a><a href="http://looksgoodworkswell.blogspot.com/">Bill Scott</a> gave an interesting lecture today at Yahoo! about AJAX design patterns. He explained how <a href="http://looksgoodworkswell.blogspot.com/2005/05/interactive-wireframes-documenting.html">good AJAX designs</a> keep the user&#8217;s attention on the page, remove roadblocks, and increase stickiness to a site. </p>
<p>Patterns of successful AJAX behaviors are beginning to appear (<a href="http://netflix.com">Netflix</a>, <a href="http://37signals.com/">37Signals</a>, <a href="http://developer.yahoo.com/ypatterns/">Yahoo!</a>). There are subtle, and sometimes not so subtle, changes that can occur  to let a user know that an action has happened. </p>
<p><a href="http://developer.yahoo.com/yui/dragdrop/dragdrop_storyboard.zip" title="this is a .zip file"><img src="http://us.i1.yimg.com/us.yimg.com/i/ydn/yuiweb/img/dragdrop_storyboard.gif" alt="storyboard for AJAX interactions">Download the drag and drop storyboard design package</a></p>
<p>For instance, he pointed out an interaction on the recently departed Yahoo! Photos site. A user could select multiple photos and then drag them to  special collection folders. The page generated several panels to let the user know that the move would go to the preferred folder (hit yes), wait for the action to finish, and then a final congratulations panel (hit yes). These panels and the two required clicks could have been avoided if the folder changed when the photos were dropped into it. This could be a simple glow and maybe the number of photos in the folder is increased.</p>
<h3>Plan your entire sequence in advance</h3>
<p>Eric Miraglia coined the phrase <a href="http://developer.yahoo.com/yui/dragdrop/#moments">Interesting Moments</a> to describe the multiple changes that occur during an AJAX/DHTML action. </p>
<blockquote><p>In most cases, Drag and Drop requires that you write code to respond to the interesting moments in the interaction: when the drag event starts, when the dragged object enters another object, and so on.<br />
<cite><a href="http://developer.yahoo.com/yui/dragdrop/#moments">Yahoo! UI Library: Drag &amp; Drop &#8211; Interesting Moments </a></cite>
</p></blockquote>
<p>Your user will have a much more pleasant experience if these are considered in the beginning of production. The Yahoo User Interface library includes a <a href="http://developer.yahoo.com/yui/dragdrop/dragdrop_storyboard.zip">storyboard template (.zip)</a> for planning these interactions effectively. This <a href="http://en.wikipedia.org/wiki/Storyboard" title="Storyboard" rel="wikipedia" class="zem_slink">story board</a> concept also works well for forms (especially form validation actions) and Flash components.</p>
<h3>Update</h3>
<p>The YUI blog has posted a video of Bill&#8217;s lecture: <a href="http://yuiblog.com/blog/2007/10/15/video-scott/">YUI Theater — Bill Scott: “Designing the Rich Web Experience: Principals and Patterns for Rich Interaction Design on the Web”</a>. This is a great opportunity to learn from one of the finest developers around.</p>
<h3>Related articles</h3>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a   href="http://ajaxian.com/archives/yui-252-released-big-focus-on-firefox-3-and-opera-95-support">YUI 2.5.2 Released, Big Focus on Firefox 3 and Opera 9.5 Support</a> [via&nbsp;Zemanta]</li>
<li class="zemanta-article-ul-li"><a  href="http://ajaxian.com/archives/pingdom-checks-on-javascript-usage-on-top-sites">Pingdom checks on JavaScript usage on top sites</a> [via&nbsp;Zemanta]</li>
<li class="zemanta-article-ul-li"><a   href="http://wisdump.com/design/a-need-for-information-and-interface-design-pattern-websites/">A Need for Information and Interface Design Pattern Websites</a> [via&nbsp;Zemanta]</li>
<li class="zemanta-article-ul-li"><a   href="http://bokardo.com/archives/social-design-patterns-for-reputation-systems-two/">Social Design Patterns for Reputation Systems: An Interview with Yahoo&#8217;s Bryce Glass (Part II)</a> [via&nbsp;Zemanta]</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.last-child.com/storyboard-your-dhtml-interactions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
