<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>GrasshopperPebbles.com</title>
	
	<link>http://grasshopperpebbles.com</link>
	<description>Ajax and Ajax Frameworks</description>
	<lastBuildDate>Sun, 28 Feb 2010 19:03:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Grasshopperpebblescom" /><feedburner:info uri="grasshopperpebblescom" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nd/2.0/</creativeCommons:license><feedburner:emailServiceId>Grasshopperpebblescom</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>CSS: Styling Input Fields</title>
		<link>http://feedproxy.google.com/~r/Grasshopperpebblescom/~3/MfSPtZrdt5I/</link>
		<comments>http://grasshopperpebbles.com/css/css-styling-input-fields/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 17:54:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Background-image]]></category>
		<category><![CDATA[background-position]]></category>
		<category><![CDATA[border-radius]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Input Field]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[ms-border-radius]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[Webkit]]></category>

		<guid isPermaLink="false">http://grasshopperpebbles.com/?p=628</guid>
		<description><![CDATA[



I&#8217;m working on a project where I&#8217;m using CSS to add a border radius and background image to an input field. Background images are supported by all browsers, but border radius is only supported by Firefox, Safari, and Google Chrome.

border-radius
To apply a border-radius to an input field:

?View Code CSSinput &#123;
	-webkit-border-radius: 3px;
	-moz-broder-radius: 3px;
&#125;

-webkit-border-radius is supported by [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fcss%2Fcss-styling-input-fields%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fcss%2Fcss-styling-input-fields%2F" height="61" width="51" /></a></div><div class="KonaBody">
<div id="mediatext">
<!-- google_ad_section_start -->
<!--Amazon_CLS_IM_START-->
<p>I&#8217;m working on a project where I&#8217;m using CSS to add a border radius and background image to an input field. <strong>Background images</strong> are supported by all browsers, but <strong>border radius</strong> is only supported by <a href="http://www.mozilla.com/en-US/firefox/upgrade.html" target="_blank">Firefox</a>, <a href="http://www.apple.com/safari/" target="_blank">Safari</a>, and <a href="http://www.google.com/chrome">Google Chrome</a>.</p>
<p><span id="more-628"></span></p>
<h3>border-radius</h3>
<p>To apply a border-radius to an input field:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p628code8'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p6288"><td class="code" id="p628code8"><pre class="css" style="font-family:monospace;">input <span style="color: #00AA00;">&#123;</span>
	-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	-moz-broder-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><strong>-webkit-border-radius</strong> is supported by <a href="http://webkit.org/" target="_blank">Webkit</a>-based browsers such as Safari and Google Chrome. </p>
<p><a href="https://developer.mozilla.org/en/CSS/-moz-border-radius" target="_blank">-moz-border-radius</a> is supported by Mozilla (<a href="http://en.wikipedia.org/wiki/Gecko_%28layout_engine%29" target="_blank">Gecko</a>)-based browsers such as Firefox. </p>
<p>Although Internet Explorer does not yet support the border-radius CSS Attribute, I found a project on <a href="http://code.google.com/p/ms-border-radius/" target="_blank">Google Code</a> that enables a developer to add border-radius support for IE6-8:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p628code9'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p6289"><td class="code" id="p628code9"><pre class="css" style="font-family:monospace;">ms-border-radius</pre></td></tr></table></div>

<h3>Background Image Inside Input Text</h3>
<p>The next CSS attribute that I needed for the project was to place the image of a magnifying glass inside the input field. I do this by using the <a href="http://www.w3schools.com/css/pr_background-image.asp" target="_blank">background-image</a> and <a href="http://www.w3schools.com/css/pr_background-position.asp" target="_blank">background-position</a> attributes.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p628code10'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p62810"><td class="code" id="p628code10"><pre class="css" style="font-family:monospace;">input <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">25px</span><span style="color: #00AA00;">;</span>
        -webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	-moz-broder-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">background-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">magnifying-glass.png</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">background-repeat</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>I can alternatively use <a href="http://articles.sitepoint.com/article/introduction-css-shorthand" target="_blank">CSS Shorthand</a>:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p628code11'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p62811"><td class="code" id="p628code11"><pre class="css" style="font-family:monospace;">input <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">25px</span><span style="color: #00AA00;">;</span>
        -webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	-moz-broder-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">magnifying-glass.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h3>Replace Input Field with Background Image</h3>
<p>For different project, I wanted to replace the input field with a background image. I didn&#8217;t want to use a browser-based input field, so I designed one using Photoshop.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p628code12'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p62812"><td class="code" id="p628code12"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#searchCntnr</span> input <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'images/search_input.png'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span> <span style="color: #933;">32px</span> <span style="color: #993333;">bold</span> helvetica<span style="color: #00AA00;">,</span> arial<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">660px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*668 - padding-left*/</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">44px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*62 - padding-top*/</span>
	<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">8px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-bottom</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>The most important CSS attribute to note when replacing an input field with a background image is the <strong>border</strong>. If you do not set the border to 0, then the default input field border will appear around the background image.</p>
<p>I also added padding to the input field so that the input text would appear correctly within the background image, but doing so caused the background image to be pushed down and to the right. To fix this, I changed the width and height of the background image. The background image was originally:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p628code13'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p62813"><td class="code" id="p628code13"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#searchCntnr</span> input <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'images/search_input.png'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">668px</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">62px</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>But because I added 8px to the left padding and 18px to the top padding, I subtracted those values from the width and height of the background image, respectively:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p628code14'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p62814"><td class="code" id="p628code14"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#searchCntnr</span> input <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'images/search_input.png'</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">660px</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">44px</span><span style="color: #00AA00;">;</span> 
	<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">8px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">18px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Using CSS to add background images to input fields is fairly straightforward, but you will usually have to do a lot of playing in order to get it to appear the same in all browsers. Enjoy.</p>
<!--Amazon_CLS_IM_END-->
<!-- google_ad_section_end -->
</div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=MfSPtZrdt5I:aR7xdjoRF6I:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=MfSPtZrdt5I:aR7xdjoRF6I:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=MfSPtZrdt5I:aR7xdjoRF6I:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=MfSPtZrdt5I:aR7xdjoRF6I:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=MfSPtZrdt5I:aR7xdjoRF6I:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=MfSPtZrdt5I:aR7xdjoRF6I:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=MfSPtZrdt5I:aR7xdjoRF6I:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=MfSPtZrdt5I:aR7xdjoRF6I:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=MfSPtZrdt5I:aR7xdjoRF6I:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=MfSPtZrdt5I:aR7xdjoRF6I:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=MfSPtZrdt5I:aR7xdjoRF6I:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=MfSPtZrdt5I:aR7xdjoRF6I:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=MfSPtZrdt5I:aR7xdjoRF6I:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=MfSPtZrdt5I:aR7xdjoRF6I:KwTdNBX3Jqk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Grasshopperpebblescom/~4/MfSPtZrdt5I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://grasshopperpebbles.com/css/css-styling-input-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://grasshopperpebbles.com/css/css-styling-input-fields/</feedburner:origLink></item>
		<item>
		<title>Vertical Text with CSS</title>
		<link>http://feedproxy.google.com/~r/Grasshopperpebblescom/~3/uCiSVu8DfUo/</link>
		<comments>http://grasshopperpebbles.com/css/vertical-text-with-css/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 03:20:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[Vertical Text]]></category>
		<category><![CDATA[Webkit]]></category>

		<guid isPermaLink="false">http://grasshopperpebbles.com/?p=625</guid>
		<description><![CDATA[



I&#8217;m working on a new JQuery Plugin that requires the text to be vertical. This can easily be accomplished using CSS, but I found that the vertical text may appear differently in each browser depending upon the element that is used. I was able to display the text vertically in Firefox, IE8 (and IE7), Google [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fcss%2Fvertical-text-with-css%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fcss%2Fvertical-text-with-css%2F" height="61" width="51" /></a></div><div class="KonaBody">
<div id="mediatext">
<!-- google_ad_section_start -->
<!--Amazon_CLS_IM_START-->
<p>I&#8217;m working on a new JQuery Plugin that requires the text to be vertical. This can easily be accomplished using CSS, but I found that the vertical text may appear differently in each browser depending upon the element that is used. I was able to display the text vertically in <a href="http://www.mozilla.com/en-US/firefox/upgrade.html" target="_blank">Firefox</a>, <a href="http://www.microsoft.com/nz/windows/internet-explorer/default.aspx" target="_blank">IE8</a> (and IE7), <a href="http://www.google.com/chrome">Google Chrome</a> and <a href="http://www.apple.com/safari/" target="_blank">Safari</a>. I looked at <a href="http://www.opera.com/" target="_blank">Opera&#8217;s</a> CSS support and it doesn&#8217;t appear to support vertical text.  </p>
<p><span id="more-625"></span></p>
<p>To display vertical text:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p625code21'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p62521"><td class="code" id="p625code21"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#right-col</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ff6600</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">390px</span><span style="color: #00AA00;">;</span>
	-webkit-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	-moz-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	writing-mode<span style="color: #00AA00;">:</span> tb-rl<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>


<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p625code22'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p62522"><td class="code" id="p625code22"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;right-col&quot;&gt;FeedBack&lt;/div&gt;</pre></td></tr></table></div>

<p><strong>-webkit-transform</strong> is supported by <a href="http://webkit.org/" target="_blank">Webkit</a>-based browsers such as Safari and Google Chrome. </p>
<p><a href="https://developer.mozilla.org/en/CSS/-moz-transform" target="_blank">-moz-transform</a> is supported by Mozilla (<a href="http://en.wikipedia.org/wiki/Gecko_%28layout_engine%29" target="_blank">Gecko</a>)-based browsers such as Firefox. </p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms531187%28VS.85%29.aspx" target="_blank">writing-mode</a> is supported by Internet Explorer (8, 7, not sure about 6). Can also be written as:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p625code23'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p62523"><td class="code" id="p625code23"><pre class="css" style="font-family:monospace;">-ms-writing-mode<span style="color: #00AA00;">:</span> tb-rl<span style="color: #00AA00;">;</span></pre></td></tr></table></div>

<p><strong>writing-mode</strong> is a W3C draft specification, <strong>-ms-writing-mode</strong> is an Internet Explorer specific CSS attribute. </p>
<p>The Writing Mode CSS attribute was initially designed for right-to-left languages, so the vertical text rotation is 90 degrees. In order for the text to appear with a -90 degree like the Mozilla and Webkit transforms:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p625code24'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p62524"><td class="code" id="p625code24"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#right-col</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ff6600</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">390px</span><span style="color: #00AA00;">;</span>
	-webkit-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	-moz-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	writing-mode<span style="color: #00AA00;">:</span> tb-rl<span style="color: #00AA00;">;</span>
        filter<span style="color: #00AA00;">:</span> flipv fliph<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Keep in mind that the entire container will be rotated, not just the text. But when you attempt to use CSS to create vertical text on an element within a container, the placement of the text in Firefox, Safari, and Google Chrome is not where you think it would be.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p625code25'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p62525"><td class="code" id="p625code25"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#right-col</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ff6600</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">390px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#right-col</span> p <span style="color: #00AA00;">&#123;</span>
	-webkit-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	-moz-transform<span style="color: #00AA00;">:</span> rotate<span style="color: #00AA00;">&#40;</span>-90deg<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	writing-mode<span style="color: #00AA00;">:</span> tb-rl<span style="color: #00AA00;">;</span>
        filter<span style="color: #00AA00;">:</span> flipv fliph<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>The height of the container (#right-col) will not increase to accommodate the new position of the P element. And the P element is displayed below the container, vertically centered. So,</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p625code26'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p62526"><td class="code" id="p625code26"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;right-col&quot;&gt;&lt;p&gt;FeedBack&lt;/p&gt;&lt;/div&gt;</pre></td></tr></table></div>

<p>Will be displayed as:</p>
<p><img src="http://grasshopperpebbles.com/images/posts/vertical_text_p.gif" alt="Vertical Text" /></p>
<p>I made several attempts to correct the placement of the element, but was unable. It is easier to just apply the CSS vertical text attributes on the container. </p>
<!--Amazon_CLS_IM_END-->
<!-- google_ad_section_end -->
</div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uCiSVu8DfUo:dhElTJAX_qM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uCiSVu8DfUo:dhElTJAX_qM:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uCiSVu8DfUo:dhElTJAX_qM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=uCiSVu8DfUo:dhElTJAX_qM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uCiSVu8DfUo:dhElTJAX_qM:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uCiSVu8DfUo:dhElTJAX_qM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=uCiSVu8DfUo:dhElTJAX_qM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uCiSVu8DfUo:dhElTJAX_qM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uCiSVu8DfUo:dhElTJAX_qM:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=uCiSVu8DfUo:dhElTJAX_qM:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uCiSVu8DfUo:dhElTJAX_qM:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uCiSVu8DfUo:dhElTJAX_qM:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uCiSVu8DfUo:dhElTJAX_qM:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=uCiSVu8DfUo:dhElTJAX_qM:KwTdNBX3Jqk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Grasshopperpebblescom/~4/uCiSVu8DfUo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://grasshopperpebbles.com/css/vertical-text-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://grasshopperpebbles.com/css/vertical-text-with-css/</feedburner:origLink></item>
		<item>
		<title>CSS: Create List Style Color Different Than List Text</title>
		<link>http://feedproxy.google.com/~r/Grasshopperpebblescom/~3/M7XTUKxCeww/</link>
		<comments>http://grasshopperpebbles.com/css/css-create-list-style-color-different-than-list-text/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 14:49:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[bullet list]]></category>
		<category><![CDATA[List]]></category>
		<category><![CDATA[list-item]]></category>
		<category><![CDATA[list-style]]></category>
		<category><![CDATA[Unordered list]]></category>

		<guid isPermaLink="false">http://grasshopperpebbles.com/?p=620</guid>
		<description><![CDATA[



I wanted to use CSS to create a Unordered List where the color of the list-style (the bullet) was different than the list-item (the text). First I set the color for the Unordered List:

?View Code CSS.certsBlock ul &#123;
        color:#1AB7EA;
&#125;
.certsBlock ul  li &#123;
      [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fcss%2Fcss-create-list-style-color-different-than-list-text%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fcss%2Fcss-create-list-style-color-different-than-list-text%2F" height="61" width="51" /></a></div><div class="KonaBody">
<div id="mediatext">
<!-- google_ad_section_start -->
<!--Amazon_CLS_IM_START-->
<p>I wanted to use CSS to create a <a href="http://www.w3schools.com/html/html_lists.asp" target="_blank">Unordered List</a> where the color of the <a href="http://www.w3schools.com/css/pr_list-style-type.asp" target="_blank">list-style</a> (the bullet) was different than the list-item (the text). First I set the color for the Unordered List:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p620code30'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p62030"><td class="code" id="p620code30"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.certsBlock</span> ul <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#1AB7EA</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.certsBlock</span> ul  li <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">square</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Then I add an additional element inside the list-item (the text) and change it&#8217;s color:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p620code31'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p62031"><td class="code" id="p620code31"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.certsBlock</span> ul  li p <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/*white*/</span>
        <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Now I create my Unordered List:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p620code32'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p62032"><td class="code" id="p620code32"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;certsBlock&quot;&gt;
        &lt;ul&gt;
                &lt;li&gt;&lt;p&gt;Item 1&lt;/p&gt;&lt;/li&gt;
                &lt;li&gt;&lt;p&gt;Item 2&lt;/p&gt;&lt;/li&gt;
                &lt;li&gt;&lt;p&gt;Item 3&lt;/p&gt;&lt;/li&gt;
        &lt;/ul&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>So the color of the list-style (the square bullet) will be a blue and the list-item text will be white. Easy enough. </p>
<!--Amazon_CLS_IM_END-->
<!-- google_ad_section_end -->
</div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=M7XTUKxCeww:GqAkYpOpzEo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=M7XTUKxCeww:GqAkYpOpzEo:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=M7XTUKxCeww:GqAkYpOpzEo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=M7XTUKxCeww:GqAkYpOpzEo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=M7XTUKxCeww:GqAkYpOpzEo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=M7XTUKxCeww:GqAkYpOpzEo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=M7XTUKxCeww:GqAkYpOpzEo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=M7XTUKxCeww:GqAkYpOpzEo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=M7XTUKxCeww:GqAkYpOpzEo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=M7XTUKxCeww:GqAkYpOpzEo:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=M7XTUKxCeww:GqAkYpOpzEo:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=M7XTUKxCeww:GqAkYpOpzEo:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=M7XTUKxCeww:GqAkYpOpzEo:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=M7XTUKxCeww:GqAkYpOpzEo:KwTdNBX3Jqk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Grasshopperpebblescom/~4/M7XTUKxCeww" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://grasshopperpebbles.com/css/css-create-list-style-color-different-than-list-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://grasshopperpebbles.com/css/css-create-list-style-color-different-than-list-text/</feedburner:origLink></item>
		<item>
		<title>Relative Image Paths in Drupal</title>
		<link>http://feedproxy.google.com/~r/Grasshopperpebblescom/~3/uG4imn3_CuI/</link>
		<comments>http://grasshopperpebbles.com/drupal/relative-image-paths-in-drupal/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 15:04:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[file location]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[Panels Module]]></category>
		<category><![CDATA[relative path]]></category>

		<guid isPermaLink="false">http://grasshopperpebbles.com/?p=618</guid>
		<description><![CDATA[



I&#8217;m working on a project that uses Drupal and I wanted to add a few images to the home page. 
First I created the folders files/images under the root directory. I then created the home page (Create Content->Page). When adding images to the home page, the file location is relative to the root directory:

?View Code [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fdrupal%2Frelative-image-paths-in-drupal%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fdrupal%2Frelative-image-paths-in-drupal%2F" height="61" width="51" /></a></div><div class="KonaBody">
<div id="mediatext">
<!-- google_ad_section_start -->
<!--Amazon_CLS_IM_START-->
<p>I&#8217;m working on a project that uses <a href="http://drupal.org/">Drupal</a> and I wanted to add a few images to the home page. </p>
<p>First I created the folders <strong>files/images</strong> under the root directory. I then created the home page (Create Content->Page). When adding images to the home page, the file location is relative to the root directory:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p618code36'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p61836"><td class="code" id="p618code36"><pre class="html" style="font-family:monospace;">&lt;img src=&quot;files/images/flash1.jpg&quot; width=&quot;168&quot; height=&quot;112&quot; class=&quot;imageFloatLeft&quot;&gt;</pre></td></tr></table></div>

<p>But when I created another Drupal page (a page other than the home page), the relative path for the image is different:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p618code37'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p61837"><td class="code" id="p618code37"><pre class="html" style="font-family:monospace;">&lt;img src=&quot;../files/images/flash1.jpg&quot; width=&quot;168&quot; height=&quot;112&quot; class=&quot;imageFloatLeft&quot;&gt;</pre></td></tr></table></div>

<p>And when I created a page using Drupal&#8217;s <a href="http://drupal.org/project/panels" target="_blank">Panels Module</a>, the relative path for the image is once again relative to the root directory:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p618code38'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p61838"><td class="code" id="p618code38"><pre class="html" style="font-family:monospace;">&lt;img src=&quot;files/images/flash1.jpg&quot; width=&quot;168&quot; height=&quot;112&quot; class=&quot;imageFloatLeft&quot;&gt;</pre></td></tr></table></div>

<p>Adding content to Drupal seems to be fairly straightforward, but I did struggle a bit as I tried to figure out the relative paths of images/files so I hope this helps anyone else who may be struggling.</p>
<!--Amazon_CLS_IM_END-->
<!-- google_ad_section_end -->
</div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uG4imn3_CuI:vXz8OJZqdRE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uG4imn3_CuI:vXz8OJZqdRE:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uG4imn3_CuI:vXz8OJZqdRE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=uG4imn3_CuI:vXz8OJZqdRE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uG4imn3_CuI:vXz8OJZqdRE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uG4imn3_CuI:vXz8OJZqdRE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=uG4imn3_CuI:vXz8OJZqdRE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uG4imn3_CuI:vXz8OJZqdRE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uG4imn3_CuI:vXz8OJZqdRE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=uG4imn3_CuI:vXz8OJZqdRE:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uG4imn3_CuI:vXz8OJZqdRE:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uG4imn3_CuI:vXz8OJZqdRE:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=uG4imn3_CuI:vXz8OJZqdRE:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=uG4imn3_CuI:vXz8OJZqdRE:KwTdNBX3Jqk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Grasshopperpebblescom/~4/uG4imn3_CuI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://grasshopperpebbles.com/drupal/relative-image-paths-in-drupal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://grasshopperpebbles.com/drupal/relative-image-paths-in-drupal/</feedburner:origLink></item>
		<item>
		<title>FlashScope – A Marketplace for Flash Components</title>
		<link>http://feedproxy.google.com/~r/Grasshopperpebblescom/~3/8vtIsgZHoVM/</link>
		<comments>http://grasshopperpebbles.com/flash/flashscope-a-marketplace-for-flash-components/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 17:59:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Components]]></category>
		<category><![CDATA[Flash Developers]]></category>
		<category><![CDATA[Flash Files]]></category>
		<category><![CDATA[Flash Gallery]]></category>
		<category><![CDATA[FlashScope]]></category>
		<category><![CDATA[Marketplace]]></category>

		<guid isPermaLink="false">http://grasshopperpebbles.com/?p=616</guid>
		<description><![CDATA[



I recently stumbled upon the site FlashScope.com. It is a website where flash developers can sell their flash files, components, etc. The site contains a lot of great components such as Image galleries, page templates, and games. 
A few weeks ago, I started converting some of my Flash AS2 class packages to AS3. I am [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fflash%2Fflashscope-a-marketplace-for-flash-components%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fflash%2Fflashscope-a-marketplace-for-flash-components%2F" height="61" width="51" /></a></div><div class="KonaBody">
<div id="mediatext">
<!-- google_ad_section_start -->
<!--Amazon_CLS_IM_START-->
<p>I recently stumbled upon the site FlashScope.com. It is a website where <a href="http://www.adobe.com/products/flash/" target="_blank">flash</a> developers can sell their <a href="http://www.flashscope.com/" target="_blank">flash files</a>, components, etc. The site contains a lot of great components such as Image galleries, page templates, and games. </p>
<p>A few weeks ago, I started converting some of my Flash AS2 class <a href="http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&#038;file=00000041.html" target="_blank">packages</a> to <a href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/" target="_blank">AS3</a>. I am creating a few new Flash components/products and updating others that I created a few years ago. One of the Flash products that I am creating, I want to distribute a free version and a version that I can get paid for. </p>
<p>I don&#8217;t want to take the time to setup an e-commerce site (and promote it) just to sell a few inexpensive products, so I searched for an existing site that marketed Flash products. Flashscope.com seems to be the perfect site. </p>
<p>One other aspect of Flashscope.com that I like is that most of the products on the site are not expensive. While perusing the site, I don&#8217;t think that I saw a product that was over $30 (the average cost is probably $10). So, in the event that I don&#8217;t want to take the time to create a particular Flash product, Flashscope seems to have enough of a variety of products that I don&#8217;t have to reinvent the wheel &#8211; and I won&#8217;t have to cut deeply into my profits for a project.   </p>
<p>Flashscope.com also has a <a href="http://www.flashscope.com/free-flash-gallery" target="_blank">free flash gallery</a> that you can download. You can demo the gallery <a href="http://www.flashscope.com/files/flash-components/flash-gallery/index.html" target="_blank">here</a>. I think that I will be visiting the site quite often in the future. </p>
<!--Amazon_CLS_IM_END-->
<!-- google_ad_section_end -->
</div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8vtIsgZHoVM:P2f6N7tRFBA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8vtIsgZHoVM:P2f6N7tRFBA:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8vtIsgZHoVM:P2f6N7tRFBA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=8vtIsgZHoVM:P2f6N7tRFBA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8vtIsgZHoVM:P2f6N7tRFBA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8vtIsgZHoVM:P2f6N7tRFBA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=8vtIsgZHoVM:P2f6N7tRFBA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8vtIsgZHoVM:P2f6N7tRFBA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8vtIsgZHoVM:P2f6N7tRFBA:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=8vtIsgZHoVM:P2f6N7tRFBA:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8vtIsgZHoVM:P2f6N7tRFBA:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8vtIsgZHoVM:P2f6N7tRFBA:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8vtIsgZHoVM:P2f6N7tRFBA:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=8vtIsgZHoVM:P2f6N7tRFBA:KwTdNBX3Jqk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Grasshopperpebblescom/~4/8vtIsgZHoVM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://grasshopperpebbles.com/flash/flashscope-a-marketplace-for-flash-components/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://grasshopperpebbles.com/flash/flashscope-a-marketplace-for-flash-components/</feedburner:origLink></item>
		<item>
		<title>Blueprint CSS Framework</title>
		<link>http://feedproxy.google.com/~r/Grasshopperpebblescom/~3/naZGa1BHkjU/</link>
		<comments>http://grasshopperpebbles.com/css/blueprint-css-framework/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 17:34:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Blueprint CSS Framework]]></category>
		<category><![CDATA[Container class]]></category>
		<category><![CDATA[CSS Drop-Down Menu Framework]]></category>
		<category><![CDATA[Eric Myer]]></category>
		<category><![CDATA[Reset CSS]]></category>

		<guid isPermaLink="false">http://grasshopperpebbles.com/?p=570</guid>
		<description><![CDATA[



As a freelance developer, I am always looking for more work. The other day I was reading the skills required for a particular job and it mentioned that the candidate should have knowledge of the Blueprint CSS Framework. I had never heard of the framework before and was curious as to why one would need [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fcss%2Fblueprint-css-framework%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fcss%2Fblueprint-css-framework%2F" height="61" width="51" /></a></div><div class="KonaBody">
<div id="mediatext">
<!-- google_ad_section_start -->
<!--Amazon_CLS_IM_START-->
<p>As a freelance developer, I am always looking for more work. The other day I was reading the skills required for a particular job and it mentioned that the candidate should have knowledge of the <a href="http://www.blueprintcss.org/" target="_blank">Blueprint CSS Framework</a>. I had never heard of the framework before and was curious as to why one would need a framework for <a href="http://www.w3schools.com/css/">CSS</a>. I consider myself to be an expert CSS designer, but I decided to check out this Blueprint thingy.</p>
<p>The website says that by using the Blueprint CSS Framework, I can cut down my development time and it eliminates the discrepancies across browsers. Sounds intriguing. After a bit more research, I found that <a href="http://meyerweb.com/eric/tools/css/reset/" target="_blank">Eric Meyer&#8217;s Reset CSS</a> is incorporated into the framework. I have learned a great deal about CSS from Eric Meyer over the years:</p>
<p><iframe src="http://rcm.amazon.com/e/cm?t=wwwintriguing-20&#038;o=1&#038;p=8&#038;l=as1&#038;asins=073571245X&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;m=amazon&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p>
<p>Since I was beginning a redesign for a client, I decided to use the Blueprint framework as the basis for the effort.</p>
<p><span id="more-570"></span></p>
<p>After <a href="http://www.blueprintcss.org/" target="_blank">downloading</a> the framework, I opened the <strong>screen.css</strong> file. I noticed a bunch of generically named CSS classes. Looked rather confusing. The file also contained quite a few <strong>span</strong> classes with width attributes only.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code55'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57055"><td class="code" id="p570code55"><pre class="css" style="font-family:monospace;">...
<span style="color: #6666ff;">.span-1</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-2</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">70px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-3</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">110px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-4</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">150px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-5</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">190px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-6</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">230px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-7</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">270px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-8</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">310px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-9</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">350px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-10</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">390px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-11</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">430px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-12</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">470px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-13</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">510px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-14</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">550px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-15</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">590px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-16</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">630px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-17</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">670px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-18</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">710px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-19</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">750px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-20</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">790px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-21</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">830px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-22</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">870px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-23</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">910px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.span-24</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">950px</span><span style="color: #00AA00;">;</span>margin-<span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
...</pre></td></tr></table></div>

<p>I didn&#8217;t understand the concept until I opened the <strong>grid.html</strong> file (tests/parts/grid.html). I saw how the page was designed using these spans.</p>
<blockquote><p><strong>Note:</strong> The Blueprint CSS Framework was designed with a 1024 screen width in mind, so the maximum container width is set to 950px.</p></blockquote>
<p>So I started of by creating the home page for the site. I added the necessary CSS files to the top of the page:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code56'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57056"><td class="code" id="p570code56"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot; href=&quot;blueprint/screen.css&quot; type=&quot;text/css&quot; media=&quot;screen, projection&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;blueprint/print.css&quot; type=&quot;text/css&quot; media=&quot;print&quot;&gt;
&lt;!--[if lt IE 8]&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;blueprint/ie.css&quot; type=&quot;text/css&quot; media=&quot;screen, projection&quot;&gt;&lt;![endif]--&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot;&gt;</pre></td></tr></table></div>

<p>You should not modify the framework files &#8211; create your custom styles in a separate CSS file. The <strong>style.css</strong> file is my custom CSS file. This file will be used to augment the stylings of the Blueprint Framework. </p>
<h3>The Container Class</h3>
<p>First, I will use the framework&#8217;s <strong>container</strong> class. This will hold all of the content on the page.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code57'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57057"><td class="code" id="p570code57"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;container&quot;&gt;
&nbsp;
&lt;/div&gt;</pre></td></tr></table></div>

<p>You will notice in the <strong>screen.css</strong> file that the width for the <strong>container</strong> class is set at 950px.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code58'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57058"><td class="code" id="p570code58"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.container</span> <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">950px</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>The framework automatically centers the <strong>container</strong> class on the page. I want to create additional styles for the container class. I do this in my <strong>style.css</strong> file.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code59'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57059"><td class="code" id="p570code59"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.container</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#1E4366</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>I can optionally add a minimum height to the container.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code60'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57060"><td class="code" id="p570code60"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.container</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#1E4366</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">min-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">800px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h3>CSS Span Classes</h3>
<p>I designed the site with a menu at the top of the page. I will create a menu container using one of the framework&#8217;s <strong>span</strong> classes.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code61'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57061"><td class="code" id="p570code61"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;container&quot;&gt;
	&lt;div class=&quot;iet_main_menu span-24&quot;&gt;
&nbsp;
        &lt;/div&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>The <strong>span-24</strong> class will create the container with a width of 950px. The span classes are automatically <a href="http://www.w3schools.com/css/css_float.asp" target="_blank">floated</a>. I created the <strong>iet_main_menu</strong> class in my <strong>style.css</strong> file.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code62'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57062"><td class="code" id="p570code62"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.iet_main_menu</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/menu_top.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">40px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Now I create the banner using the same span class.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code63'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57063"><td class="code" id="p570code63"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;container&quot;&gt;
	&lt;div class=&quot;iet_main_menu span-24&quot;&gt;
&nbsp;
        &lt;/div&gt;
        &lt;div class=&quot;banner span-24&quot;&gt;
&nbsp;
        &lt;/div&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>And in my style.css file:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code64'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57064"><td class="code" id="p570code64"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.banner</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/banner.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">128px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Now I want to create left and right column containers. These will be contained within a <strong>main-content</strong> div.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code65'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57065"><td class="code" id="p570code65"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;container&quot;&gt;
	&lt;div class=&quot;iet_main_menu span-24&quot;&gt;
&nbsp;
        &lt;/div&gt;
        &lt;div class=&quot;banner span-24&quot;&gt;
&nbsp;
        &lt;/div&gt;
        &lt;div id=&quot;main-content&quot; class=&quot;span-24&quot;&gt;
		&lt;div id=&quot;left-col&quot; class=&quot;span-13&quot;&gt;&lt;/div&gt;
		&lt;div id=&quot;right-col&quot; class=&quot;span-11&quot;&gt;&lt;/div&gt;
	&lt;/div&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>I created the <strong>left-col</strong> and <strong>right-col</strong> id&#8217;s because I am creating a web application and I know that I may have to reference these id&#8217;s in the app. If your website is just html (and no programming will be required), then you can probably just use the span classes. These id&#8217;s are not part of the framework.</p>
<p>I want to set a minimum height for my <strong>left-col</strong> and <strong>main-content</strong> divs. Obviously this is optional.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code66'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57066"><td class="code" id="p570code66"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#main-content</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">min-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">450px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#left-col</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">min-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">300px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h3>CSS Drop-Down Menu Framework</h3>
<p>The Blueprint CSS Framework does not have any specific styles to create a menuing system, so I decided to use the <a href="http://lwis.net/free-css-drop-down-menu/" target="_blank">CSS Drop-Down Menu Framework</a>. While I wish that the Blueprint Framework came with a menu <a href="http://wiki.github.com/joshuaclayton/blueprint-css/plugins" target="_blank">plugin</a>, this menu framework comes with a lot of options. </p>
<p>After deciding on the type of menu that I wanted to display, I loaded the necessary CSS files.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code67'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57067"><td class="code" id="p570code67"><pre class="html" style="font-family:monospace;">&lt;link href=&quot;css-dropdown/dropdown.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;</pre></td></tr></table></div>

<p>Depending on the type of menu that you want to use, you can optionally load a small <a href="http://jquery.com/" target="_blank">JQuery</a> plugin that will be used for IE 7 compatibility.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code68'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57068"><td class="code" id="p570code68"><pre class="html" style="font-family:monospace;">&lt;!--[if lte IE 7]&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery/jquery.dropdown.js&quot;&gt;&lt;/script&gt;
&lt;![endif]--&gt;</pre></td></tr></table></div>

<p>So next I added the menus to the menu container:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code69'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57069"><td class="code" id="p570code69"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;iet_main_menu span-24&quot;&gt;
        &lt;ul id=&quot;nav&quot; class=&quot;dropdown dropdown-horizontal&quot;&gt;
	        &lt;li&gt;Home&lt;/li&gt;
	        &lt;li&gt;About&lt;/li&gt;
	        &lt;li&gt;Services
	                &lt;ul&gt;
		                &lt;li&gt;Services 1&lt;/li&gt;
		                &lt;li&gt;Services 2&lt;/li&gt;
		                &lt;li&gt;Services 3&lt;/li&gt;
	               &lt;/ul&gt;
	        &lt;/li&gt;
	        &lt;li&gt;Contact Us&lt;/li&gt;
        &lt;/ul&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>I then copied some of the styles from one of the theme files (dropdown/themes/_template/default.css) into my style.css file and modified them to match the look and feel of my site.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p570code70'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p57070"><td class="code" id="p570code70"><pre class="css" style="font-family:monospace;">ul<span style="color: #6666ff;">.dropdown</span> <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">8px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #6666ff;">.dropdown</span> li <span style="color: #00AA00;">&#123;</span>
 	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">7px</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
 	<span style="color: #000000; font-weight: bold;">border-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span>
 	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#1AB7EA</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #6666ff;">.dropdown</span> li<span style="color: #6666ff;">.hover</span><span style="color: #00AA00;">,</span> ul<span style="color: #6666ff;">.dropdown</span> li<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#1AB7EA</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #6666ff;">.dropdown</span> a<span style="color: #3333ff;">:link</span><span style="color: #00AA00;">,</span>
ul<span style="color: #6666ff;">.dropdown</span> a<span style="color: #3333ff;">:visited	</span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#1AB7EA</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.dropdown</span> a<span style="color: #3333ff;">:hover		</span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul<span style="color: #6666ff;">.dropdown</span> a<span style="color: #3333ff;">:active	</span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #6666ff;">.dropdown</span> ul <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ul<span style="color: #6666ff;">.dropdown</span> ul li <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#1E4366</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>That&#8217;s it. Now I can add as many menu items as I want and won&#8217;t have to worry about browser compatibility. </p>
<p>I still need to explore the Blueprint CSS Framework a bit more. I can see that over time, using the framework (along with the CSS Drop-Down Menu Framework) will enable me to design a site much faster than starting from scratch. </p>
<!--Amazon_CLS_IM_END-->
<!-- google_ad_section_end -->
</div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=naZGa1BHkjU:2v64l913TQc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=naZGa1BHkjU:2v64l913TQc:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=naZGa1BHkjU:2v64l913TQc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=naZGa1BHkjU:2v64l913TQc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=naZGa1BHkjU:2v64l913TQc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=naZGa1BHkjU:2v64l913TQc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=naZGa1BHkjU:2v64l913TQc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=naZGa1BHkjU:2v64l913TQc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=naZGa1BHkjU:2v64l913TQc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=naZGa1BHkjU:2v64l913TQc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=naZGa1BHkjU:2v64l913TQc:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=naZGa1BHkjU:2v64l913TQc:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=naZGa1BHkjU:2v64l913TQc:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=naZGa1BHkjU:2v64l913TQc:KwTdNBX3Jqk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Grasshopperpebblescom/~4/naZGa1BHkjU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://grasshopperpebbles.com/css/blueprint-css-framework/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://grasshopperpebbles.com/css/blueprint-css-framework/</feedburner:origLink></item>
		<item>
		<title>Installing Joomla on Ubuntu</title>
		<link>http://feedproxy.google.com/~r/Grasshopperpebblescom/~3/fd14-vstahI/</link>
		<comments>http://grasshopperpebbles.com/ubuntu/installing-joomla-on-ubuntu/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 05:57:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[configuration.php]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[Pre-installation check]]></category>
		<category><![CDATA[Sample Data]]></category>

		<guid isPermaLink="false">http://grasshopperpebbles.com/?p=567</guid>
		<description><![CDATA[



I&#8217;m redesigning my portfolio site and decided to use Joomla. I just installed  it on my Ubuntu box. It wasn&#8217;t difficult, but it could have been easier. 
First I downloaded Joomla from here. I had the option of download a nightly build, but I wanted the latest stable version.

I unzipped the files in a [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fubuntu%2Finstalling-joomla-on-ubuntu%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fubuntu%2Finstalling-joomla-on-ubuntu%2F" height="61" width="51" /></a></div><div class="KonaBody">
<div id="mediatext">
<!-- google_ad_section_start -->
<!--Amazon_CLS_IM_START-->
<p>I&#8217;m redesigning my portfolio site and decided to use <a href="http://www.joomla.org/" target="_blank">Joomla</a>. I just installed  it on my <a href="http://www.ubuntu.com/" target="_blank">Ubuntu</a> box. It wasn&#8217;t difficult, but it could have been easier. </p>
<p>First I downloaded Joomla from <a href="http://www.joomla.org/download.html" target="_blank">here</a>. I had the option of download a <a href="http://www.joomla.org/component/content/article/5252.html" target="_blank">nightly build</a>, but I wanted the latest stable version.</p>
<p><span id="more-567"></span></p>
<p>I unzipped the files in a directory on my web server, opened my browser and navigated to where the joomla files were located to begin the installation.</p>
<h3>Pre-installation Check</h3>
<p>After choosing a language, I started the <strong>Pre-installation</strong> check. According to the installation, my <strong>configuration.php</strong> file was not writable.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p567code74'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p56774"><td class="code" id="p567code74"><pre class="text" style="font-family:monospace;">PHP Version &gt;= 4.3.10  	  Yes    
- Zlib Compression Support 	Yes  
- XML Support 	Yes  
- MySQL Support 	Yes  
MB Language is Default 	Yes  
MB String Overload Off 	Yes   
configuration.php Writable  -	No</pre></td></tr></table></div>

<p>I found the file <strong>configuration.php-dist</strong> in the main Joomla folder. I opened Terminal and navigated to that location to rename the file and change the file permissions:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p567code75'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p56775"><td class="code" id="p567code75"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> configuration.php-dist configuration.php
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">777</span> configuration.php</pre></td></tr></table></div>

<p>I then clicked the <strong>Check Again</strong> button to re-run the Pre-installation check. All of the checks were now okay.</p>
<h3>Database Configuration</h3>
<p>I was then asked to enter my database information. I selected <a href="http://www.mysql.com/" target="_blank">MySQL</a> and entered <strong>localhost</strong> as the host. I then entered the username and password for my MySQL.</p>
<p>The database name must already exist, so I opened <a href="http://www.phpmyadmin.net/home_page/index.php" target="_blank">phpMyAdmin</a> and created a database. I then came back and entered the database name.</p>
<blockquote><p><strong>Note:</strong> For information on installing PHP, MySQL, and phpMyAdmin on Ubuntu, see my post,<br />
<a href="http://grasshopperpebbles.com/ubuntu/setting-up-ubuntu-for-web-development/" target="_blank">Setting up Ubuntu for Web Development </a></p></blockquote>
<h3>FTP Connection</h3>
<p>Because I&#8217;m installing Joomla on my computer, I skipped this step. </p>
<h3>Main Configuration</h3>
<p>Now I entered my site name, my email address, and an admin password. I then clicked the &#8216;Install Sample Data&#8217; button. I received an error:</p>
<p>Error: the XML response that was returned from the server is invalid.</p>
<p>After some <a href="http://forum.joomla.org/viewtopic.php?f=429&#038;t=265877" target="_blank">searching</a>, I found that I should not have created the <strong>configuration.php</strong> file. I don&#8217;t know why this is part of the installation pre-check if it can cause problems. Perhaps it only causes problems on Ubuntu/Linux.</p>
<p>So I renamed <strong>configuration.php</strong> file back to <strong>configuration.php-dist</strong> and was able to install the sample data.</p>
<p>But when I clicked the next button, I received two errors:</p>
<p>Notice: Undefined index: DBtype in /home/les/public_html/greenscorpion/installation/installer/models/model.php on line 764</p>
<p>Fatal error: Call to undefined method JException::getNullDate() in /home/les/public_html/greenscorpion/installation/installer/helper.php on line 290</p>
<p>After further reading, I found that I should have created an empty <strong>configuration.php</strong> file (should be empty and writable).</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p567code76'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p56776"><td class="code" id="p567code76"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">touch</span> configuration.php
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">777</span> configuration.php</pre></td></tr></table></div>

<p>I then removed removed all the database tables that were created and started the installation again. This time, I was able to successfully install Joomla. </p>
<p>I then removed the installation directory (Joomla security feature) and proceeded to the administrative area.</p>
<p>While some of these problems may occur only on Ubuntu/Linux, I was able to install Joomla and I can now work on my first template.  </p>
<!--Amazon_CLS_IM_END-->
<!-- google_ad_section_end -->
</div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=fd14-vstahI:GhbUf9Iq8C8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=fd14-vstahI:GhbUf9Iq8C8:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=fd14-vstahI:GhbUf9Iq8C8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=fd14-vstahI:GhbUf9Iq8C8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=fd14-vstahI:GhbUf9Iq8C8:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=fd14-vstahI:GhbUf9Iq8C8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=fd14-vstahI:GhbUf9Iq8C8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=fd14-vstahI:GhbUf9Iq8C8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=fd14-vstahI:GhbUf9Iq8C8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=fd14-vstahI:GhbUf9Iq8C8:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=fd14-vstahI:GhbUf9Iq8C8:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=fd14-vstahI:GhbUf9Iq8C8:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=fd14-vstahI:GhbUf9Iq8C8:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=fd14-vstahI:GhbUf9Iq8C8:KwTdNBX3Jqk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Grasshopperpebblescom/~4/fd14-vstahI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://grasshopperpebbles.com/ubuntu/installing-joomla-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://grasshopperpebbles.com/ubuntu/installing-joomla-on-ubuntu/</feedburner:origLink></item>
		<item>
		<title>Multiple Combo boxes with YUI and CakePHP</title>
		<link>http://feedproxy.google.com/~r/Grasshopperpebblescom/~3/CKtXuvBmv2Y/</link>
		<comments>http://grasshopperpebbles.com/ajax/multiple-combo-boxes-with-yui-and-cakephp/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 20:15:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[Dom.get]]></category>
		<category><![CDATA[Json]]></category>
		<category><![CDATA[multiple combo boxes]]></category>
		<category><![CDATA[Yahoo! User Interface Library]]></category>

		<guid isPermaLink="false">http://grasshopperpebbles.com/?p=558</guid>
		<description><![CDATA[



As a developer, I hate writing similar code for the same process over and over again. Just like highly optimized database design, developers should always try to write code as efficiently as possible. 
I&#8217;m working on a project where I use YUI and CakePHP to fill multiple combo boxes on a page using Json data. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fajax%2Fmultiple-combo-boxes-with-yui-and-cakephp%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fajax%2Fmultiple-combo-boxes-with-yui-and-cakephp%2F" height="61" width="51" /></a></div><div class="KonaBody">
<div id="mediatext">
<!-- google_ad_section_start -->
<!--Amazon_CLS_IM_START-->
<p>As a developer, I hate writing similar code for the same process over and over again. Just like highly optimized database design, developers should always try to write code as efficiently as possible. </p>
<p>I&#8217;m working on a project where I use <a href="http://developer.yahoo.com/yui/2/" target="_blank">YUI</a> and <a href="http://cakephp.org/" target="_blank">CakePHP</a> to fill multiple combo boxes on a page using <a href="http://cakephp.org/" target="_blank">Json</a> data. At first, I wrote separate code with the same functionality for each combo box. Every time I needed to change the functionality, I had to change it for each combo box. After doing this multiple times, I decided to combine the functionality on both the front-end (YUI) and the back-end (CakePHP).</p>
<p><span id="more-558"></span></p>
<h3>The Back-end (CakePHP)</h3>
<p>The key to creating the optimized code on the back-end is creating a method in 1 controller. The data for each combo box come from separate tables, so initially I was going to create a new method in each of the relevant CakePHP controllers.  But if I decided to change the functionality, I would have to change it in each controller file. So I am creating the method only in the controller of the relevant view. In this case, I have a <strong>Requestors</strong> page (view), so the method is created in the <strong>requestors_controller</strong>.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p558code89'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p55889"><td class="code" id="p558code89"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> getComboData<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cntrl</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$id</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$desc</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// set autoRender to false for Ajax requests</span>
	<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">autoRender</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">// set debug to 0 so debug information is not sent back to the application</span>
	Configure<span style="color: #339933;">::</span><span style="color: #004000;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'debug'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Requestor</span><span style="color: #339933;">-&gt;</span><span style="color: #000088;">$cntrl</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">find</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'all'</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'fields'</span> <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cntrl</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;.<span style="color: #006699; font-weight: bold;">$id</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cntrl</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;.<span style="color: #006699; font-weight: bold;">$desc</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'recursive'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <a href="http://www.php.net/json_encode"><span style="color: #990000;">json_encode</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>So I have a <strong>getComboData</strong> method that takes the <strong>controller</strong>, <strong>field id</strong>, and <strong>field description</strong> as parameters.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p558code90'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p55890"><td class="code" id="p558code90"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cntrl</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$id</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$desc</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>I set up the method with default values for id and description so that if you named your table fields using CakePHP&#8217;s <a href="http://book.cakephp.org/view/24/Model-and-Database-Conventions" target="_blank">naming conventions</a>, you don&#8217;t have to pass these values. </p>
<p>Notice in the <strong>find all</strong> method: When calling different model within a CakePHP controller, you have to prefix it with the existing model. In this case, the controller model is <strong>Requestor</strong>.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p558code91'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p55891"><td class="code" id="p558code91"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Requestor</span><span style="color: #339933;">-&gt;</span><span style="color: #000088;">$cntrl</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">find</span></pre></td></tr></table></div>

<p>If I passed <strong>Language</strong> as the controller, the statement would look like:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p558code92'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p55892"><td class="code" id="p558code92"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Requestor</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Language</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">find</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'all'</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'fields'</span> <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>Language<span style="color: #339933;">.</span>id<span style="color: #339933;">,</span> Language<span style="color: #339933;">.</span>name<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'recursive'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>For more information on creating ajax methods and CakePHP&#8217;s <a href="http://book.cakephp.org/view/439/recursive" target="_blank">recursive</a> option, read my post: <a href="http://grasshopperpebbles.com/ajax/yahoo-util-connect-cakephp-json-data/" target="_blank">YAHOO.util.Connect, CakePHP, Json Data</a>.</p>
<h3>The Front-end &#8211; YUI</h3>
<p>Now that the back-end is complete, we will create the front-end code. Again, we want to optimize the code as much as possible. We know that we have multiple combo boxes on this page (view). We will use the Yahoo Connection Manager (<a href="http://developer.yahoo.com/yui/connection/" target="_blank">Yahoo.util.connect</a>) to retrieve the Json data. </p>
<p>First we create the combo boxes on the page:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p558code93'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p55893"><td class="code" id="p558code93"><pre class="html" style="font-family:monospace;">&lt;label for=&quot;state_id&quot;&gt;State:&lt;/label&gt;&lt;select name=&quot;state_id&quot; id=&quot;state_id&quot;&gt;&lt;/select&gt;
&nbsp;
&lt;label for=&quot;country_id&quot;&gt;Country of Origin:&lt;/label&gt;&lt;select name=&quot;country_id&quot; id=&quot;country_id&quot;&gt;&lt;/select&gt;
&nbsp;
&lt;label for=&quot;language_id&quot;&gt;Native Language:&lt;/label&gt;&lt;select name=&quot;language_id&quot; id=&quot;language_id&quot;&gt;&lt;/select&gt;
&nbsp;
&lt;label for=&quot;cbxStaff&quot;&gt;Staff&lt;/label&gt;&lt;select name=&quot;cbxStaff&quot; id=&quot;cbxStaff&quot;&gt;&lt;/select&gt;</pre></td></tr></table></div>

<p>Next I am going to create a multidimensional array that will store the combo box <strong>name/id</strong>, the CakePHP <strong>controller name</strong>, the <strong>id field name</strong>, and the <strong>description field name</strong> for each combo box. I also created an optional default value for the <a href="http://www.jguru.com/faq/view.jsp?EID=818956" target="_blank">selected</a> option of the combo box &#8216;<strong>Select&#8230;</strong>&#8216;.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p558code94'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p55894"><td class="code" id="p558code94"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> Dom <span style="color: #339933;">=</span> YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Dom</span><span style="color: #339933;">,</span> $ <span style="color: #339933;">=</span> Dom.<span style="color: #660066;">get</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> aCB <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> cbSelect<span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// cbCount will be used to keep track of which</span>
<span style="color: #006600; font-style: italic;">// combo box I'll be updating based upon </span>
<span style="color: #006600; font-style: italic;">// it's position in the arrray</span>
<span style="color: #003366; font-weight: bold;">var</span> cbCount <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
aCB<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'language_id'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Language'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'name'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Select...'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
aCB<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'country_id'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Country'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'name'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Select...'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
aCB<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'state_id'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'State'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'name'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Select...'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
aCB<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'cbxStaff'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'User'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'id'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'last_name'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Select...'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>I created a <a href="http://grasshopperpebbles.com/ajax/yahoo-user-interface-library-method-shortcuts/" target="_blank">shortcut</a> for <a href="http://developer.yahoo.com/yui/dom/" target="_blank">YAHOO.util.Dom</a> and another for <a href="http://developer.yahoo.com/yui/get/" target="_blank">Dom.get</a>. <strong>cbSelect</strong> will store the selected combo box. </p>
<p>We will loop through the <strong>aCB</strong> array and use <a href="http://developer.yahoo.com/yui/connection/" target="_blank">Yahoo.util.connect</a> to retrieve the Json data for each combo box.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p558code95'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p55895"><td class="code" id="p558code95"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> aCBLngth <span style="color: #339933;">=</span> aCB.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> sUrl<span style="color: #339933;">,</span> request<span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// set cbSelect to the first combo box</span>
<span style="color: #006600; font-style: italic;">// aCB[0][0] = language_id</span>
<span style="color: #006600; font-style: italic;">// remember, we set $ to Dom.get</span>
cbSelect <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>aCB<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>aCBLngth<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	sUrl <span style="color: #339933;">=</span> <span style="color: #3366CC;">'getComboData/'</span> <span style="color: #339933;">+</span> aCB<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'/'</span> <span style="color: #339933;">+</span> aCB<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'/'</span> <span style="color: #339933;">+</span> aCB<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	request <span style="color: #339933;">=</span> YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Connect</span>.<span style="color: #660066;">asyncRequest</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'GET'</span><span style="color: #339933;">,</span> sUrl<span style="color: #339933;">,</span> callback<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>I build the url string as I iterate over the array. I&#8217;m adding the parameters needed for the getComboData in the Requestor controller. For instance, when i == 0, I retrieve the values for language.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p558code96'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p55896"><td class="code" id="p558code96"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// So:</span>
sUrl <span style="color: #339933;">=</span> <span style="color: #3366CC;">'getComboData/'</span> <span style="color: #339933;">+</span> aCB<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'/'</span> <span style="color: #339933;">+</span> aCB<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'/'</span> <span style="color: #339933;">+</span> aCB<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Becomes:</span>
sUrl <span style="color: #339933;">=</span> <span style="color: #3366CC;">'getComboData/Language/id/name'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Remember the parameters for the getComboData method:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p558code97'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p55897"><td class="code" id="p558code97"><pre class="php" style="font-family:monospace;">getComboData<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cntrl</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$id</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$desc</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>Also, notice that I did not need the name of the controller in the url string. I was a bit surprised about this as well. You would think that url string would be:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p558code98'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p55898"><td class="code" id="p558code98"><pre class="javascript" style="font-family:monospace;">sUrl <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Requestor/getComboData/Language/id/name'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Apparently, because I am using the Requestor controller to view this page, CakePHP knows that it should look within the Requestor controller to find the getComboData method. </p>
<p>So now we create the <strong>callback</strong> methods for <strong>YAHOO.util.Connect</strong>.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p558code99'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p55899"><td class="code" id="p558code99"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> callback <span style="color: #339933;">=</span>	<span style="color: #009900;">&#123;</span>
  	success<span style="color: #339933;">:</span>handleSuccess<span style="color: #339933;">,</span>
  	failure<span style="color: #339933;">:</span>handleFailure
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> handleFailure <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>o<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// do something 			</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> handleCmbSuccess <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>o<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> response <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>o.<span style="color: #660066;">responseText</span> <span style="color: #339933;">!==</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #006600; font-style: italic;">// parse the json data</span>
	                response <span style="color: #339933;">=</span> YAHOO.<span style="color: #660066;">lang</span>.<span style="color: #660066;">JSON</span>.<span style="color: #660066;">parse</span><span style="color: #009900;">&#40;</span>o.<span style="color: #660066;">responseText</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	            <span style="color: #009900;">&#125;</span>
	            <span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>x<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	                <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;JSON Parse failed! &quot;</span> <span style="color: #339933;">+</span> o.<span style="color: #660066;">responseText</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	                <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
	            <span style="color: #009900;">&#125;</span>
                <span style="color: #006600; font-style: italic;">// get the total number of records</span>
		<span style="color: #003366; font-weight: bold;">var</span> nL <span style="color: #339933;">=</span> response.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
&nbsp;
                 <span style="color: #006600; font-style: italic;">// if the aCB array has a default option for the combo box 'Select...',</span>
                 <span style="color: #006600; font-style: italic;">// create a select option</span>
                 <span style="color: #006600; font-style: italic;">// cbCount is currently 0 which corresponds to the language array</span>
                 <span style="color: #006600; font-style: italic;">// aCB[0] = new Array ('language_id', 'Language', 'id', 'name', 'Select...'); </span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>aCB<span style="color: #009900;">&#91;</span>cbCount<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #006600; font-style: italic;">// create new option</span>
			<span style="color: #003366; font-weight: bold;">var</span> opt <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;option&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #006600; font-style: italic;">// set the value-attribute to 0:</span>
			opt.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'value'</span><span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #006600; font-style: italic;">// set the displayed value: 'Select...'</span>
			opt.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> aCB<span style="color: #009900;">&#91;</span>cbCount<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                        <span style="color: #006600; font-style: italic;">// cbSelect = $(aCB[0][0]) = the language_id combo box</span>
			cbSelect.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>opt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #006600; font-style: italic;">// get the controller</span>
                <span style="color: #006600; font-style: italic;">// cbCount = 0 (the language array)</span>
                <span style="color: #006600; font-style: italic;">// aCB[cbCount][1] = 'Language'</span>
		<span style="color: #003366; font-weight: bold;">var</span> cntrl <span style="color: #339933;">=</span> aCB<span style="color: #009900;">&#91;</span>cbCount<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>nL<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #006600; font-style: italic;">// create an option</span>
			<span style="color: #003366; font-weight: bold;">var</span> opt <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;option&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #006600; font-style: italic;">// set the value-attribute:</span>
                        <span style="color: #006600; font-style: italic;">// the json data is in the following format:</span>
                        <span style="color: #006600; font-style: italic;">// {&quot;Language&quot;:{&quot;id&quot;:&quot;1&quot;,&quot;name&quot;:&quot;Afrikaans&quot;}},{&quot;Language&quot;:{&quot;id&quot;:&quot;2&quot;,&quot;name&quot;:&quot;Albanian&quot;}},{&quot;Language&quot;:{&quot;id&quot;:&quot;3&quot;,&quot;name&quot;:&quot;Amharic&quot;}}]</span>
                        <span style="color: #006600; font-style: italic;">//  var cVal = response[0]['Language'][aCB[0]['id']] = 1</span>
			<span style="color: #003366; font-weight: bold;">var</span> cVal <span style="color: #339933;">=</span> response<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>cntrl<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>aCB<span style="color: #009900;">&#91;</span>cbCount<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			opt.<span style="color: #660066;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'value'</span><span style="color: #339933;">,</span> cVal<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #006600; font-style: italic;">// set the displayed value:</span>
                        <span style="color: #006600; font-style: italic;">// var cVal = response[0]['Language'][aCB[0]['name']] = 'Afrikaans'</span>
			opt.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> response<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>cntrl<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>aCB<span style="color: #009900;">&#91;</span>cbCount<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			cbSelect.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>opt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
                <span style="color: #006600; font-style: italic;">// update cbCount </span>
		cbCount<span style="color: #339933;">++;</span>
                <span style="color: #006600; font-style: italic;">// if the cbCount is less than the number of records in the aCB array,</span>
                <span style="color: #006600; font-style: italic;">// change cbSelect to the next combo box </span>
                <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cbCount <span style="color: #339933;">&lt;</span> aCBLngth<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #006600; font-style: italic;">// cbCount now = 1, so </span>
                        <span style="color: #006600; font-style: italic;">// aCB[1][0] = country_id </span>
			cbSelect <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>aCB<span style="color: #009900;">&#91;</span>cbCount<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>I&#8217;m updating <strong>cbCount</strong> so that the next time the <strong>handleSuccess</strong> method is called, it will create options for the next combo box in the array. Remember, I am looping through the aCB array, so that the handleSuccess method is called for each index in the array:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p558code100'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p558100"><td class="code" id="p558code100"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>aCBLngth<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> request <span style="color: #339933;">=</span> YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Connect</span>.<span style="color: #660066;">asyncRequest</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'GET'</span><span style="color: #339933;">,</span> sUrl<span style="color: #339933;">,</span> callback<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>That&#8217;s it. Using YUI and CakePHP together to update multiple combo boxes may be a bit difficult, but at least I don&#8217;t have to write the same handleSuccess method for each combo box. </p>
<!--Amazon_CLS_IM_END-->
<!-- google_ad_section_end -->
</div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=CKtXuvBmv2Y:Kn_VTIoeBAo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=CKtXuvBmv2Y:Kn_VTIoeBAo:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=CKtXuvBmv2Y:Kn_VTIoeBAo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=CKtXuvBmv2Y:Kn_VTIoeBAo:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=CKtXuvBmv2Y:Kn_VTIoeBAo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=CKtXuvBmv2Y:Kn_VTIoeBAo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=CKtXuvBmv2Y:Kn_VTIoeBAo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=CKtXuvBmv2Y:Kn_VTIoeBAo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=CKtXuvBmv2Y:Kn_VTIoeBAo:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=CKtXuvBmv2Y:Kn_VTIoeBAo:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=CKtXuvBmv2Y:Kn_VTIoeBAo:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=CKtXuvBmv2Y:Kn_VTIoeBAo:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=CKtXuvBmv2Y:Kn_VTIoeBAo:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=CKtXuvBmv2Y:Kn_VTIoeBAo:KwTdNBX3Jqk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Grasshopperpebblescom/~4/CKtXuvBmv2Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://grasshopperpebbles.com/ajax/multiple-combo-boxes-with-yui-and-cakephp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://grasshopperpebbles.com/ajax/multiple-combo-boxes-with-yui-and-cakephp/</feedburner:origLink></item>
		<item>
		<title>YAHOO.util.Connect, CakePHP, Json Data</title>
		<link>http://feedproxy.google.com/~r/Grasshopperpebblescom/~3/8g2LARgC4Hk/</link>
		<comments>http://grasshopperpebbles.com/ajax/yahoo-util-connect-cakephp-json-data/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 04:09:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[YUI]]></category>
		<category><![CDATA[Find all]]></category>
		<category><![CDATA[Javascript Helper]]></category>
		<category><![CDATA[Json]]></category>
		<category><![CDATA[recursive]]></category>
		<category><![CDATA[RequestHandler Componenet]]></category>
		<category><![CDATA[YAHOO.util.Connect]]></category>

		<guid isPermaLink="false">http://grasshopperpebbles.com/?p=552</guid>
		<description><![CDATA[



I&#8217;ve been upgrading an Intranet application that I created for a client. I created the front-end using YUI (Yahoo! User Interface Library) and I am working on migrating the back-end to CakePHP. After setting up CakePHP, my first step of integrating YUI with CakePHP is retrieving data ajaxally. The application was already using YAHOO.util.Connect to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fajax%2Fyahoo-util-connect-cakephp-json-data%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fajax%2Fyahoo-util-connect-cakephp-json-data%2F" height="61" width="51" /></a></div><div class="KonaBody">
<div id="mediatext">
<!-- google_ad_section_start -->
<!--Amazon_CLS_IM_START-->
<p>I&#8217;ve been upgrading an Intranet application that I created for a client. I created the front-end using YUI (<a href="http://developer.yahoo.com/yui/2/" target="_blank">Yahoo! User Interface Library</a>) and I am working on migrating the back-end to <a href="http://cakephp.org/" target="_blank">CakePHP</a>. After setting up CakePHP, my first step of integrating YUI with CakePHP is retrieving data ajaxally. The application was already using <a href="http://developer.yahoo.com/yui/connection/" target="_blank">YAHOO.util.Connect</a> to retrieve the data, but I had to change my parsing code due to the format of the <a href="http://www.json.org/" target="_blank">Json</a> data that is returned by CakePHP.  </p>
<p><span id="more-552"></span></p>
<h3>The CakePHP Controller</h3>
<p>First we&#8217;ll setup the controller. We need to add the <a href="http://book.cakephp.org/view/207/Javascript" target="_blank">Javascript Helper</a> and the <a href="http://book.cakephp.org/view/174/Request-Handling" target="_blank">RequestHandler Component</a>.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p552code112'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p552112"><td class="code" id="p552code112"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$helpers</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Javascript'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$components</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'RequestHandler'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Next we create a controller method. Let&#8217;s say that we want method that retrieves all language id&#8217;s and descriptions from the Language controller.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p552code113'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p552113"><td class="code" id="p552code113"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> getLanguages<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// set autoRender to false for Ajax requests</span>
	<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">autoRender</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">// set debug to 0 so debug information is not sent back to the application</span>
	Configure<span style="color: #339933;">::</span><span style="color: #004000;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'debug'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Language</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">find</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'all'</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'fields'</span> <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Language.id'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Language.name'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'recursive'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <a href="http://www.php.net/json_encode"><span style="color: #990000;">json_encode</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>I&#8217;m using CakePHP&#8217;s <a href="http://book.cakephp.org/view/808/find-all" target="_blank">find</a> method with type &#8216;all&#8217;. The important thing to notice the <a href="http://book.cakephp.org/view/439/recursive" target="_blank">recursive</a> option. If I don&#8217;t set the recursive option to -1, then <strong>find all</strong> will retrieve more than just language data. It will also retrieve all associated model data.  </p>
<p>Also notice that I am using <a href="http://php.net/manual/en/function.json-encode.php" target="_blank">json_encode</a>. I attempted to use CakePHP&#8217;s <a href="http://book.cakephp.org/view/349/Methods" target="_blank">Javascript Object</a> method, but after an hour of trying to return a result, I moved on.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p552code114'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p552114"><td class="code" id="p552code114"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$javascript</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">object</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Normally when I deal with Json data from a database query, I am used to seeing it in the following format:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p552code115'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p552115"><td class="code" id="p552code115"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;id&quot;</span> <span style="color: #339933;">:</span>  <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span>  <span style="color: #3366CC;">&quot;Afrikaans&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;id&quot;</span> <span style="color: #339933;">:</span>  <span style="color: #3366CC;">&quot;2&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span>  <span style="color: #3366CC;">&quot;Albanian&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;3&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Amharic&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span></pre></td></tr></table></div>

<p>But the format created by CakePHP&#8217;s <strong>find all</strong> (after json encoding), looks like the following:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p552code116'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p552116"><td class="code" id="p552code116"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;Language&quot;</span> <span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Afrikaans&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;Language&quot;</span><span style="color: #339933;">:</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;2&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Albanian&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;Language&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;3&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Amharic&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span></pre></td></tr></table></div>

<p>This format will be important to remember when we parse the data using YUI.</p>
<h3>YUI &#8211; YAHOO.util.Connect</h3>
<p>Ok, now comes the fun. First we use YAHOO.util.Connect to retrieve the json data from the Language controller method.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p552code117'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p552117"><td class="code" id="p552code117"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> request <span style="color: #339933;">=</span> YAHOO.<span style="color: #660066;">util</span>.<span style="color: #660066;">Connect</span>.<span style="color: #660066;">asyncRequest</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'GET'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Language/getLanguages'</span><span style="color: #339933;">,</span> callback<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>We&#8217;ll create a simple <strong>callback</strong> method.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p552code118'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p552118"><td class="code" id="p552code118"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> callback <span style="color: #339933;">=</span>	<span style="color: #009900;">&#123;</span>
  	success<span style="color: #339933;">:</span>handleSuccess<span style="color: #339933;">,</span>
  	failure<span style="color: #339933;">:</span>handleFailure
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now we handle success and failure:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p552code119'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p552119"><td class="code" id="p552code119"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> handleFailure <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>o<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #006600; font-style: italic;">// do something			</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> handleSuccess <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>o<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> response <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>o.<span style="color: #660066;">responseText</span> <span style="color: #339933;">!==</span> undefined<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #006600; font-style: italic;">// parse the json data</span>
	                response <span style="color: #339933;">=</span> YAHOO.<span style="color: #660066;">lang</span>.<span style="color: #660066;">JSON</span>.<span style="color: #660066;">parse</span><span style="color: #009900;">&#40;</span>o.<span style="color: #660066;">responseText</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	            <span style="color: #009900;">&#125;</span>
	            <span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>x<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	                <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;JSON Parse failed! &quot;</span> <span style="color: #339933;">+</span> o.<span style="color: #660066;">responseText</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	                <span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
	            <span style="color: #009900;">&#125;</span>
                <span style="color: #006600; font-style: italic;">// get the number of records</span>
		<span style="color: #003366; font-weight: bold;">var</span> nL <span style="color: #339933;">=</span> response.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
                <span style="color: #006600; font-style: italic;">// iterate through the data</span>
		<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>nL<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #006600; font-style: italic;">// get language id</span>
			console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'Language'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #006600; font-style: italic;">// get Language name</span>
                        console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'Language'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Remember each Json record is formatted with the controller name:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p552code120'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p552120"><td class="code" id="p552code120"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;Language&quot;</span> <span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Afrikaans&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>So</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p552code121'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p552121"><td class="code" id="p552code121"><pre class="javascript" style="font-family:monospace;">response<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;Language&quot;</span> <span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Afrikaans&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span>
&nbsp;
response<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'Language'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;id&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;name&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Afrikaans&quot;</span><span style="color: #009900;">&#125;</span>
&nbsp;
response<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'Language'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span></pre></td></tr></table></div>

<p>Now I could have used dot notation to retrieve the data:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p552code122'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p552122"><td class="code" id="p552code122"><pre class="javascript" style="font-family:monospace;">response<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">Language</span>.<span style="color: #660066;">id</span></pre></td></tr></table></div>

<p>Whatever floats your boat. That&#8217;s it. So as you can see using YUI (YAHOO.util.Connect) to retrieve Json data returned from CakePHP is not that difficult. Enjoy.</p>
<!--Amazon_CLS_IM_END-->
<!-- google_ad_section_end -->
</div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8g2LARgC4Hk:_-tco3Nk4Yc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8g2LARgC4Hk:_-tco3Nk4Yc:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8g2LARgC4Hk:_-tco3Nk4Yc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=8g2LARgC4Hk:_-tco3Nk4Yc:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8g2LARgC4Hk:_-tco3Nk4Yc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8g2LARgC4Hk:_-tco3Nk4Yc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=8g2LARgC4Hk:_-tco3Nk4Yc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8g2LARgC4Hk:_-tco3Nk4Yc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8g2LARgC4Hk:_-tco3Nk4Yc:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=8g2LARgC4Hk:_-tco3Nk4Yc:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8g2LARgC4Hk:_-tco3Nk4Yc:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8g2LARgC4Hk:_-tco3Nk4Yc:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=8g2LARgC4Hk:_-tco3Nk4Yc:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=8g2LARgC4Hk:_-tco3Nk4Yc:KwTdNBX3Jqk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Grasshopperpebblescom/~4/8g2LARgC4Hk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://grasshopperpebbles.com/ajax/yahoo-util-connect-cakephp-json-data/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://grasshopperpebbles.com/ajax/yahoo-util-connect-cakephp-json-data/</feedburner:origLink></item>
		<item>
		<title>CakePHP Session Write Auth Error</title>
		<link>http://feedproxy.google.com/~r/Grasshopperpebblescom/~3/OT1lsUxn3lo/</link>
		<comments>http://grasshopperpebbles.com/cakephp/cakephp-session-write-auth-error/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 03:50:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[ACL]]></category>
		<category><![CDATA[Auth Component]]></category>
		<category><![CDATA[not authorized]]></category>
		<category><![CDATA[Session write]]></category>

		<guid isPermaLink="false">http://grasshopperpebbles.com/?p=550</guid>
		<description><![CDATA[



I justed received an error when logging into a CakePHP app. It was the Auth Component error:
you are not authorized to access that location
It occurred when I attempted to create two session variables:

?View Code PHPif &#40;$loggedIn == 1&#41; &#123;
	$result = $this-&#62;User-&#62;findByUsername&#40;$this-&#62;Auth-&#62;user&#40;&#34;username&#34;&#41;&#41;;
	if &#40;$result&#41; &#123;
		$this-&#62;Session-&#62;write&#40;'User.langID', $result&#91;'User'&#93;&#91;'language_id'&#93;&#41;;
		$this-&#62;Session-&#62;write&#40;'User.cntryID', $result&#91;'User'&#93;&#91;'country_id'&#93;&#41;;
		echo '{&#34;type&#34;:&#34;continue&#34;}';
	&#125;
&#125;

Because one generally receives this error message when attempting to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fcakephp%2Fcakephp-session-write-auth-error%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fgrasshopperpebbles.com%2Fcakephp%2Fcakephp-session-write-auth-error%2F" height="61" width="51" /></a></div><div class="KonaBody">
<div id="mediatext">
<!-- google_ad_section_start -->
<!--Amazon_CLS_IM_START-->
<p>I justed received an error when logging into a <a href="http://cakephp.org/" target="_blank">CakePHP</a> app. It was the <a href="http://book.cakephp.org/view/172/authentication" target="_blank">Auth Component</a> error:</p>
<p><strong>you are not authorized to access that location</strong></p>
<p>It occurred when I attempted to create two session variables:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p550code125'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p550125"><td class="code" id="p550code125"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$loggedIn</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">User</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">findByUsername</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Auth</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;username&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Session</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'User.langID'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'User'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'language_id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Session</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'User.cntryID'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'User'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'country_id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'{&quot;type&quot;:&quot;continue&quot;}'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Because one generally receives this error message when attempting to access a page that is secured by the Auth Component and ACL, I thought that the session component was attempting to write to a restricted area. After a bit of testing, I realized that the User session var (User.langID) was being used by the Auth Component. So I changed User to an application specific variable:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p550code126'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p550126"><td class="code" id="p550code126"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Session</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rdsStaff.langID'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'User'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'language_id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Session</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">write</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rdsStaff.cntryID'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$result</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'User'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'country_id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>No more errors. I hope this will be useful to someone in the same situation.</p>
<!--Amazon_CLS_IM_END-->
<!-- google_ad_section_end -->
</div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=OT1lsUxn3lo:lSBDkACKVps:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=OT1lsUxn3lo:lSBDkACKVps:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=OT1lsUxn3lo:lSBDkACKVps:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=OT1lsUxn3lo:lSBDkACKVps:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=OT1lsUxn3lo:lSBDkACKVps:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=OT1lsUxn3lo:lSBDkACKVps:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=OT1lsUxn3lo:lSBDkACKVps:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=OT1lsUxn3lo:lSBDkACKVps:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=OT1lsUxn3lo:lSBDkACKVps:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=OT1lsUxn3lo:lSBDkACKVps:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=OT1lsUxn3lo:lSBDkACKVps:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=TzevzKxY174" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=OT1lsUxn3lo:lSBDkACKVps:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?a=OT1lsUxn3lo:lSBDkACKVps:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/Grasshopperpebblescom?i=OT1lsUxn3lo:lSBDkACKVps:KwTdNBX3Jqk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Grasshopperpebblescom/~4/OT1lsUxn3lo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://grasshopperpebbles.com/cakephp/cakephp-session-write-auth-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://grasshopperpebbles.com/cakephp/cakephp-session-write-auth-error/</feedburner:origLink></item>
	</channel>
</rss>
