<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>wax ideal &#187; code</title>
	<atom:link href="http://waxideal.com/blog/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://waxideal.com/blog</link>
	<description>learning to be human, since 1984</description>
	<lastBuildDate>Wed, 07 Dec 2011 21:46:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Fixing z-index object problems in Google Chrome using wmode</title>
		<link>http://waxideal.com/blog/2011/11/27/google-chrome-object-z-index/</link>
		<comments>http://waxideal.com/blog/2011/11/27/google-chrome-object-z-index/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 09:18:33 +0000</pubDate>
		<dc:creator>sarandi</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html/xhmtl]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://waxideal.com/blog/?p=641</guid>
		<description><![CDATA[Turns out that using z-index on html objects doesn&#8217;t work in Google Chrome! Luckily, there&#8217;s a quick fix &#8211; just add the following param to the object, add the z-index, and you should be good to go:]]></description>
			<content:encoded><![CDATA[<p>Turns out that using z-index on html objects doesn&#8217;t work in Google Chrome! Luckily, there&#8217;s a quick fix &#8211; just add the following param to the object, add the z-index, and you should be good to go:</p>
<pre class="brush: xml; title: ; notranslate">&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://waxideal.com/blog/2011/11/27/google-chrome-object-z-index/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to trigger a jQuery Plugin (fancybox) if URL match</title>
		<link>http://waxideal.com/blog/2011/06/16/how-to-trigger-a-jquery-plugin-fancybox-if-url-match/</link>
		<comments>http://waxideal.com/blog/2011/06/16/how-to-trigger-a-jquery-plugin-fancybox-if-url-match/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 21:42:05 +0000</pubDate>
		<dc:creator>sarandi</dc:creator>
				<category><![CDATA[clients]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[html/xhmtl]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://waxideal.com/blog/?p=626</guid>
		<description><![CDATA[I currently work for a venue &#8211; often times we have shows with multiple acts, so we need to list set times for each artist. Easy enough: I can write a modal-type pop-up window using fancybox that opens when the user clicks a link (&#8220;DJ Showtimes here&#8220;, for example). But say you want to send [...]]]></description>
			<content:encoded><![CDATA[<p>I currently work for a venue &#8211; often times we have shows with multiple acts, so we need to list set times for each artist. Easy enough: I can write a modal-type pop-up window using fancybox that opens when the user clicks a link (&#8220;DJ Showtimes <span style="text-decoration: underline;">here</span>&#8220;, for example). But say you want to send an email that links to that list? Since most email clients, web- or desktop-based, don&#8217;t allow javascript, I needed to trigger the click based on the URL. Here&#8217;s my solution (using a custom jQuery function to avoid conflicts with other libraries in use):</p>
<pre><code>
$j('#various2').fancybox({'hideOnContentClick': true, 'hideOnOverlayClick': true, 'showCloseButton': true, 'scrolling': 'auto'}); /* use id of link for fancybox selector */</code></pre>
<pre><code>/* necessary to set if-statement within page ready or load event */
</code></pre>
<pre><code>$j(document).ready(function() {
if(document.location.href.indexOf('#various2')&gt;-1){ /* check for anchor text in URL */
$j('#various2').fancybox().trigger('click'); /* chain click trigger on to previously written fancybox declaration */
}});
$j('#fancybox-wrap').css({'margin':'20px auto'}) /* set css for wrapper; safari was centering the inline element to the position of the #various2 element, which was at the top of the page. This resets to 20px top/bottom and in the middle horizontally */</code></pre>
<p>My link looks like this:</p>
<pre><code><a id="various2" href="#data">DJ Set Times Here</a></code></pre>
<p>and my content is wrapped with:</p>
<pre><code>
<div id="data">CONTENT HERE</div>

</code></pre>
<p>Easy, peasy.</p>
]]></content:encoded>
			<wfw:commentRss>http://waxideal.com/blog/2011/06/16/how-to-trigger-a-jquery-plugin-fancybox-if-url-match/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Analytics Links &amp; Resources</title>
		<link>http://waxideal.com/blog/2011/06/09/google-analytics-links-resources/</link>
		<comments>http://waxideal.com/blog/2011/06/09/google-analytics-links-resources/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 13:46:43 +0000</pubDate>
		<dc:creator>sarandi</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://waxideal.com/blog/?p=622</guid>
		<description><![CDATA[gleaned from http://appsumo.com/googlevid/ (must sign up to gain access to [temporarily free] video! Campaign Tracking Overview: http://cutroni.com/blog/2006/11/10/google-analytics-campaign-tracking-pt-0-an-overview/ Google Analytics URL Builder: http://www.google.com/support/analytics/bin/answer.py?hl=en&#38;answer=55578 Goals &#38; Funnels: http://www.google.com/support/analytics/bin/answer.py?answer=55515&#38;hl=en Site Search: http://www.google.com/support/analytics/bin/answer.py?hl=en&#38;answer=75817 Google Analytics: Power User Guide: http://blog.vkistudios.com/index.cfm/2009/6/5/The-Google-Analytics-Power-User-Guide 50 Resources for Getting the Most Out of Google Analytics http://blog.kissmetrics.com/50-resources-for-getting-the-most-out-of-google-analytics/ The Huge Collection of Google Analytics Tips http://www.searchenginejournal.com/the-huge-collection-of-google-analytics-tips/7426/ Google [...]]]></description>
			<content:encoded><![CDATA[<p>gleaned from <a href="http://appsumo.com/googlevid/" target="_blank">http://appsumo.com/googlevid/</a> (must sign up to gain access to [temporarily free] video!</p>
<p>Campaign Tracking Overview:<br />
<a href="http://cutroni.com/blog/2006/11/10/google-analytics-campaign-tracking-pt-0-an-overview/">http://cutroni.com/blog/2006/11/10/google-analytics-campaign-tracking-pt-0-an-overview/</a></p>
<p>Google Analytics URL Builder:<br />
<a href="http://www.google.com/support/analytics/bin/answer.py?hl=en&amp;answer=55578">http://www.google.com/support/analytics/bin/answer.py?hl=en&amp;answer=55578</a></p>
<p>Goals &amp; Funnels:<br />
<a href="http://www.google.com/support/analytics/bin/answer.py?answer=55515&amp;hl=en">http://www.google.com/support/analytics/bin/answer.py?answer=55515&amp;hl=en</a></p>
<p>Site Search:<br />
<a href="http://www.google.com/support/analytics/bin/answer.py?hl=en&amp;answer=75817">http://www.google.com/support/analytics/bin/answer.py?hl=en&amp;answer=75817</a></p>
<p>Google Analytics: Power User Guide:<br />
<a href="http://blog.vkistudios.com/index.cfm/2009/6/5/The-Google-Analytics-Power-User-Guide">http://blog.vkistudios.com/index.cfm/2009/6/5/The-Google-Analytics-Power-User-Guide</a></p>
<p>50 Resources for Getting the Most Out of Google Analytics<br />
<a href="http://blog.kissmetrics.com/50-resources-for-getting-the-most-out-of-google-analytics/">http://blog.kissmetrics.com/50-resources-for-getting-the-most-out-of-google-analytics/</a></p>
<p>The Huge Collection of Google Analytics Tips<br />
<a href="http://www.searchenginejournal.com/the-huge-collection-of-google-analytics-tips/7426/%22">http://www.searchenginejournal.com/the-huge-collection-of-google-analytics-tips/7426/</a></p>
<p>Google Analytics YouTube Channel<br />
<a href="http://www.youtube.com/googleanalytics">http://www.youtube.com/googleanalytics</a></p>
<h2>Blogs about Google Analytics</h2>
<p>The Official Google Analytics Blog<br />
<a href="http://analytics.blogspot.com/index.html">http://analytics.blogspot.com/index.html</a></p>
<p>Advanced Web Metrics<br />
<a href="http://www.advanced-web-metrics.com/blog/">http://www.advanced-web-metrics.com/blog/</a></p>
<p>Google Analytics Results<br />
<a href="http://www.googleanalyticsresults.com/">http://www.googleanalyticsresults.com/</a></p>
<p>Luna Metrics Blog<br />
<a href="http://www.lunametrics.com/blog/">http://www.lunametrics.com/blog/</a></p>
<p>Analytics Talk<br />
<a href="http://www.cutroni.com/">http://www.cutroni.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://waxideal.com/blog/2011/06/09/google-analytics-links-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>301 Redirects in Drupal Pages</title>
		<link>http://waxideal.com/blog/2010/05/15/301-redirects-in-drupal-pages/</link>
		<comments>http://waxideal.com/blog/2010/05/15/301-redirects-in-drupal-pages/#comments</comments>
		<pubDate>Sat, 15 May 2010 10:33:23 +0000</pubDate>
		<dc:creator>sarandi</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[quick tip]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://waxideal.com/blog/?p=497</guid>
		<description><![CDATA[I recently ran into a problem with a Drupal site I designed and maintain. Here&#8217;s a quick explanation of the problem, and then the solution. The front page has a Views Slideshow Block that grabs node data from custom CCK types. These types contain an image to be displayed in the slideshow (but not the [...]]]></description>
			<content:encoded><![CDATA[<p>I recently ran into a problem with a Drupal site I designed and maintain. Here&#8217;s a quick explanation of the problem, and then the solution.</p>
<p>The front page has a Views Slideshow Block that grabs node data from custom CCK types. These types contain an image to be displayed in the slideshow (but not the node itself) and a checkbox for enabling or disabling the node from appearing in the Slideshow Block. The slideshow images by default link to the nodes from which they were created.</p>
<p>The problem is linking to a page rendered by Views. Since I can&#8217;t add a field for the image or checkbox in a view page (not that I know of, let me know if I&#8217;m wrong on this) I had to figure out a different way. And I did, but not without further glitches.</p>
<p>I added the image and checkbox fields to my Page content type and created a node with the appropriate image. It appeared in the slideshow and linked to the page. I then tried several methods to redirect the alias to the correct page. First, the Path Redirect Module. Fail. Then, cpanel&#8217;s .htaccess redirect configuration tool. Fail. <a title="Apache URL Rewriting Guide" href="http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide.html" target="_blank">Then manual .htaccess configuration</a>. Fail.</p>
<p>I don&#8217;t really know why the .htaccess failed &#8211; I have suspicions it has to do simply with Apache not updating, the fact that I have the Global Redirect Module installed, the clean url directives that already exist in the .htaccess file, or some similar url rewriting conflict.</p>
<p>In a pinch, I added this snippet of code to the body of the page I created:</p>
<pre><code>&lt;?php
 header("HTTP/1.1 301 Moved Permanently");
 header("Location: http://www.mysite.com/aliasname");
 exit();
 ?&gt;
</code></pre>
<p>This delicious morsel did the trick, but not without a headache first. You&#8217;ll have to have access to posting PHP code, and post it as source, even if you select the PHP option.</p>
]]></content:encoded>
			<wfw:commentRss>http://waxideal.com/blog/2010/05/15/301-redirects-in-drupal-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing PHPList Delete/Merge Attributes Function</title>
		<link>http://waxideal.com/blog/2010/03/18/fixing-phplist-deletemerge-attributes-function/</link>
		<comments>http://waxideal.com/blog/2010/03/18/fixing-phplist-deletemerge-attributes-function/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 20:46:09 +0000</pubDate>
		<dc:creator>sarandi</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://waxideal.com/blog/?p=465</guid>
		<description><![CDATA[I recently installed PHPList v2.10.10 (the latest stable release) to manage an email campaign and ran into a slight problem. PHPList allows users to define their own form fields for lists &#8211; name, address, birthday, email, and so on. These fields are referred to as &#8220;attributes&#8221;. Almost any type of data can be configured by [...]]]></description>
			<content:encoded><![CDATA[<p>I recently installed PHPList v2.10.10 (<a title="The latest stable release of PHPList" href="http://www.phplist.com/download" target="_blank">the latest stable release</a>) to manage an email campaign and ran into a slight problem. PHPList allows users to define their own form fields for lists &#8211; name, address, birthday, email, and so on. These fields are referred to as &#8220;attributes&#8221;. Almost any type of data can be configured by adding an attribute in PHPList. You then create a sign-up page and choose which attributes you want users to enter, and whether or not that attribute is required to complete list sign-up.</p>
<p>I started setting up my attributes and naturally, added one by accident. After finding a button deceivingly named &#8220;delete&#8221;, I clicked it to correct my error. An http request was sent and the page reloaded &#8211; but my attribute was still there, winking at me like an old man who &#8211; while sitting on his porch &#8211; witnessed your ice cream tumbling off its cone after the first lick.</p>
<p>Luckily, a quick search found a remedy so I pass it along to you, the ethereal inter-web user:</p>
<p><a title="Fix for PHPList delete/merge function" href="http://forums.phplist.com/viewtopic.php?f=17&amp;t=24502#p67476" target="_blank">http://forums.phplist.com/viewtopic.php?f=17&amp;t=24502#p67476</a></p>
<p>Take that, old man.</p>
]]></content:encoded>
			<wfw:commentRss>http://waxideal.com/blog/2010/03/18/fixing-phplist-deletemerge-attributes-function/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Inserting a span element into an anchor via Drupal&#8217;s $primary_links</title>
		<link>http://waxideal.com/blog/2010/02/22/inserting-a-span-element-into-an-anchor-via-drupals-primary_links/</link>
		<comments>http://waxideal.com/blog/2010/02/22/inserting-a-span-element-into-an-anchor-via-drupals-primary_links/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 03:54:36 +0000</pubDate>
		<dc:creator>sarandi</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://waxideal.com/blog/?p=421</guid>
		<description><![CDATA[I previously wrote about how to insert a span into a link, but after testing this method quickly failed when coupled with the Views module. When a Page view is created and assigned to a node url, everything is fine and dandy. The issues arise when you want a link to use an alias. Luckily, [...]]]></description>
			<content:encoded><![CDATA[<p>I previously wrote about how to insert a span into a link, but after testing this method quickly failed when coupled with the Views module. When a Page view is created and assigned to a node url, everything is fine and dandy. The issues arise when you want a link to use an alias. Luckily, I&#8217;ve devised a really simple work around:</p>
<p>use the same code to generate your menu:</p>
<pre class="brush: php; title: ; notranslate">&amp;lt;?php if (!empty($primary_links)): ?&amp;gt;
&amp;lt;?php print theme('links', $primary_links, array('id' =&amp;gt; 'nav')); ?&amp;gt;
&amp;lt;?php endif; ?&amp;gt;
</pre>
<p>this calls the links() function inside of includes/theme.inc, which triggers the l() function in the includes/common.inc to write the primary links menu. We can&#8217;t override the l() entirely because other code uses it, so we&#8217;ll copy the code from theme.inc and override the l() function with a site template specific one. Here&#8217;s my code:</p>
<p>theme.inc</p>
<pre class="brush: php; title: ; notranslate">function mytheme_links($links, $attributes = array('class' =&amp;gt; 'links')) {
 global $language;
 $output = '';
 $options = array(
 'class' =&amp;gt; '',
 'html' =&amp;gt; FALSE,
 );

 if (count($links) &amp;gt; 0) {
 $output = '&amp;lt;ul' . drupal_attributes($attributes) .'&amp;gt;';

 $num_links = count($links);
 $i = 1;

 foreach ($links as $key =&amp;gt; $link) {
 $class = $key;

 $links['attributes']['title'] = $link['title'];
 // Add first, last and active classes to the list of links to help out themers.
 if ($i == 1) {
 $class .= ' first';
 }
 if ($i == $num_links) {
 $class .= ' signup last';
 $links['attributes']['class'] .= $class;
 }
 if (isset($link['href']) &amp;amp;&amp;amp; ($link['href'] == $_GET['q'] || ($link['href'] == '&amp;lt;front&amp;gt;' &amp;amp;&amp;amp; drupal_is_front_page()))
 &amp;amp;&amp;amp; (empty($link['language']) || $link['language']-&amp;gt;language == $language-&amp;gt;language)) {
 $class .= ' active';
 }
 $output .= '&amp;lt;li' . drupal_attributes(array('class' =&amp;gt; $class)) .'&amp;gt;';

 if (isset($link['href'])) {
 // Pass in $link as $options, they share the same keys.

//here's my call to the overridden function
 $output .= mytheme_l($link['title'], $link['href'], $links);
 }
 else if (!empty($link['title'])) {
 // Some links are actually not links, but we wrap these in &amp;lt;span&amp;gt; for adding title and class attributes
 if (empty($link['html'])) {
 $link['title'] = check_plain($link['title']);
 }
 $span_attributes = '';
 if (isset($link['attributes'])) {
 $span_attributes = drupal_attributes($link['attributes']);
 }
 $output .= '&amp;lt;span'. $span_attributes .'&amp;gt;'. $link['title'] .'&amp;lt;/span&amp;gt;';
 }

 $i++;
 $output .= &quot;&amp;lt;/li&amp;gt;\n&quot;;
 }

 $output .= '&amp;lt;/ul&amp;gt;';
 }

 return $output;
}</pre>
<p>and now the l() function in common.inc gets changed to mytheme_l():</p>
<pre class="brush: php; title: ; notranslate">function mytheme_l($text, $path, $options = array()) {
 global $language;

 // Merge in defaults.
 $options += array(
 'attributes' =&amp;gt; array(),
 'html' =&amp;gt; FALSE,
 );

 // Append active class.
 if (($path == $_GET['q'] || ($path == '&amp;lt;front&amp;gt;' &amp;amp;&amp;amp; drupal_is_front_page())) &amp;amp;&amp;amp;
 (empty($options['language']) || $options['language']-&amp;gt;language == $language-&amp;gt;language)) {
 if (isset($options['attributes']['class'])) {
 $options['attributes']['class'] .= ' active';
 }
 else {
 $options['attributes']['class'] = 'active';
 }
 }

 // Remove all HTML and PHP tags from a tooltip. For best performance, we act only
 // if a quick strpos() pre-check gave a suspicion (because strip_tags() is expensive).
 if (isset($options['attributes']['title']) &amp;amp;&amp;amp; strpos($options['attributes']['title'], '&amp;lt;') !== FALSE) {
 $options['attributes']['title'] = strip_tags($options['attributes']['title']);
 }
 // Inject a span inside the anchor tag for the purposes of this theme - NOTE - May have to remove check_plain() around
 // the $text variable
 return '&amp;lt;a href=&quot;'. check_url(url($path, $options)) .'&quot;'. drupal_attributes($options['attributes']) .'&amp;gt;&amp;lt;span&amp;gt;'. ($options['html'] ? $text : check_plain($text)) .'&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;';
}</pre>
<p>You can see that all I did was include the span element inside the anchor tag using simple php string concatenation. Until I can find a better solution, this does the trick. Don&#8217;t ask me about benchmarking, though&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://waxideal.com/blog/2010/02/22/inserting-a-span-element-into-an-anchor-via-drupals-primary_links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Returning an Alias from primary_links&#8217;s links[&#039;href&#039;] &#8211; or &#8211; How I became a Drupal Wizard</title>
		<link>http://waxideal.com/blog/2010/02/18/returning-an-alias-from-primary_linkss-linkshref-or-how-i-became-a-drupal-wizard/</link>
		<comments>http://waxideal.com/blog/2010/02/18/returning-an-alias-from-primary_linkss-linkshref-or-how-i-became-a-drupal-wizard/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 11:39:44 +0000</pubDate>
		<dc:creator>sarandi</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://waxideal.com/blog/?p=415</guid>
		<description><![CDATA[I&#8217;m building a custom template in Drupal for the farm, and needed a way to spit out a custom implementation of primary_links navigation unordered list. I needed something like this: &#60;ul id="nav"&#62; &#60;li class="first"&#62;&#60;a href="link-goes-here" title="wow, how descriptive"&#62;&#60;span&#62;link 1 copy&#60;/span&#62;&#60;/a&#62;&#60;/li&#62; &#60;li&#62;&#60;a href="link-goes-here2" title="round 2, FIGHT!"&#62;&#60;span&#62;link 2 copy&#60;/span&#62;&#60;/a&#62;&#60;/li&#62; &#60;/ul&#62; The spans inside the anchor tag are [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m building a custom template in Drupal for the farm, and needed a way to spit out a custom implementation of primary_links navigation unordered list. I needed something like this:</p>
<pre>&lt;ul id="nav"&gt;
  &lt;li class="first"&gt;&lt;a href="link-goes-here" title="wow, how descriptive"&gt;&lt;span&gt;link 1 copy&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="link-goes-here2" title="round 2, FIGHT!"&gt;&lt;span&gt;link 2 copy&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre>
<p>The spans inside the anchor tag are valid xhtml strict, and necessary for the nested/floating backgrounds. The l() function in drupal does a fine job of spitting out valid code, but I also haven&#8217;t found anything to delimit the angle brackets in the span element.<br />
Here&#8217;s how I solved the problem.</p>
<p>First, I added a preprocess function in template.php and copied this chunk of code from root/includes/theme.inc:</p>
<pre>function theme_links($links, $attributes = array('class' =&gt; 'links')) {
 global $language;
 $output = '';

 if (count($links) &gt; 0) {
 $output = '&lt;ul'. drupal_attributes($attributes) .'&gt;';

 $num_links = count($links);
 $i = 1;

 foreach ($links as $key =&gt; $link) {
 $class = $key;

 // Add first, last and active classes to the list of links to help out themers.
 if ($i == 1) {
 $class .= ' first';
 }
 if ($i == $num_links) {
 $class .= ' last';
 }
 if (isset($link['href']) &amp;&amp; ($link['href'] == $_GET['q'] || ($link['href'] == '&lt;front&gt;' &amp;&amp; drupal_is_front_page()))
 &amp;&amp; (empty($link['language']) || $link['language']-&gt;language == $language-&gt;language)) {
 $class .= ' active';
 }
 $output .= '&lt;li'. drupal_attributes(array('class' =&gt; $class)) .'&gt;';

 if (isset($link['href'])) {
 // Pass in $link as $options, they share the same keys.
 $output .= l($link['title'], $link['href'], $link);
 }
 else if (!empty($link['title'])) {
 // Some links are actually not links, but we wrap these in &lt;span&gt; for adding title and class attributes
 if (empty($link['html'])) {
 $link['title'] = check_plain($link['title']);
 }
 $span_attributes = '';
 if (isset($link['attributes'])) {
 $span_attributes = drupal_attributes($link['attributes']);
 }
 $output .= '&lt;span'. $span_attributes .'&gt;'. $link['title'] .'&lt;/span&gt;';
 }

 $i++;
 $output .= "&lt;/li&gt;\n";
 }

 $output .= '&lt;/ul&gt;';
 }

 return $output;
}</pre>
<p>I then modified the code as follows:</p>
<pre>function stoneyacresfarm_links($links, $attributes = array('class' =&gt; 'links')) {
 global $language;
 $output = '';

 if (count($links) &gt; 0) {
 $output = '&lt;ul'. drupal_attributes($attributes) .'&gt;';

 $num_links = count($links);
 $i = 1;

 foreach ($links as $key =&gt; $link) {
 $class = $key;

 // Add first, last and active classes to the list of links to help out themers.
 if ($i == 1) {
 $class .= ' first';
 }
 if ($i == $num_links) {
 $class .= ' last';
 }
 if (isset($link['href']) &amp;&amp; ($link['href'] == $_GET['q'] || ($link['href'] == '&lt;front&gt;' &amp;&amp; drupal_is_front_page()))
 &amp;&amp; (empty($link['language']) || $link['language']-&gt;language == $language-&gt;language)) {
 $class .= ' active';
 }
 $output .= '&lt;li'. drupal_attributes(array('class' =&gt; $class)) .'&gt;';

 if (isset($link['href'])) {
 // Pass in $link as $options, they share the same keys.
 // here are the modifications
 $temphref = drupal_lookup_path('alias', $link['href'], '');
 $output .= '&lt;a href="' . $temphref . '" title="' . $link['title'] . '"&gt; &lt;span&gt;' . $link['title'] . '&lt;/span&gt;&lt;/a&gt;';
 }
 else if (!empty($link['title'])) {
 // Some links are actually not links, but we wrap these in &lt;span&gt; for adding title and class attributes
 if (empty($link['html'])) {
 $link['title'] = check_plain($link['title']);
 }
 $span_attributes = '';
 if (isset($link['attributes'])) {
 $span_attributes = drupal_attributes($link['attributes']);
 }
 $output .= '&lt;span'. $span_attributes .'&gt;'. $link['title'] .'&lt;/span&gt;';
 }

 $i++;
 $output .= "&lt;/li&gt;\n";
 }

 $output .= '&lt;/ul&gt;';
 }

 return $output;
}</pre>
<p>Lines 29 &amp; 30 are the brilliant bits. I scoured api.drupal.org till I found the  <code><a title="Given an alias, return its Drupal system URL if one exists. Given a Drupal system URL return one of its aliases if such a one exists. Otherwise, return FALSE." href="http://api.drupal.org/api/function/drupal_lookup_path/6">drupal_lookup_path</a></code> function. Follow the link for the arguments that can be passed in. I specified that I wanted an alias, gave it the path ( links['href'] ), and passed in a blank character for language.</p>
<p>This is all rendered out in my page-front.tpl.php and page.tpl.php files in the standard fashion:</p>
<pre>&lt;?php if (!empty($primary_links)): ?&gt;
  &lt;?php print theme('links', $primary_links, array('id' =&gt; 'nav')); ?&gt;
&lt;?php endif; ?&gt;
</pre>
<p>I hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://waxideal.com/blog/2010/02/18/returning-an-alias-from-primary_linkss-linkshref-or-how-i-became-a-drupal-wizard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

