<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.developerfriendly.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>microformats</title>
 <link>http://www.developerfriendly.com/taxonomy/term/22</link>
 <description>The taxonomy view with a depth of 0.</description>
 <language>en</language>
<item>
 <title>The ultimate embedded MP3 player: SoundManager 2 and hAudio</title>
 <link>http://www.developerfriendly.com/node/61</link>
 <description>&lt;p&gt;
Tonight I implemented &lt;a href=&quot;http://www.rotgutglory.com/node/42&quot;&gt;this MP3 player&lt;/a&gt; for my band&#039;s website using &lt;a href=&quot;http://schillmania.com/projects/soundmanager2/&quot;&gt;SoundManager 2&lt;/a&gt; and minimal support for the &lt;a href=&quot;http://microformats.org/wiki/haudio&quot;&gt;hAudio&lt;/a&gt; &lt;a href=&quot;http://microformats.org/&quot;&gt;Microformat.&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
I&#039;m rather pleased with the way that this turned out. Thanks to SoundManager 2 I have a nice playlist embedded directly in the semantic html on the page. Javascript catches clicks and hands off the URL to a hidden Flash object embedded on the page. 
It degrades gracefully: users without Javascript or Flash support will still be able to download the mp3 file since it&#039;s the target of a href link and the hAudio microformat should make it robot-friendly.
&lt;/p&gt;
&lt;p&gt;
Another benefit: &lt;a href=&quot;http://www.songbirdnest.com&quot;&gt;Songbird&lt;/a&gt; can see the mp3 files automatically populate it&#039;s web playlist.&lt;/p&gt;

&lt;p&gt;If you would like to implement something similar you can visit &lt;a href=&quot;http://www.rotgutglory.com/node/42&quot;&gt;this page&lt;/a&gt; and view the source, or check out the examples on the &lt;a href=&quot;http://schillmania.com/projects/soundmanager2/&quot;&gt;SoundManager 2 Project Page&lt;/a&gt;.
&lt;/p&gt;</description>
 <comments>http://www.developerfriendly.com/node/61#comments</comments>
 <category domain="http://www.developerfriendly.com/taxonomy/term/17">JavaScript</category>
 <category domain="http://www.developerfriendly.com/taxonomy/term/22">microformats</category>
 <category domain="http://www.developerfriendly.com/taxonomy/term/58">mp3</category>
 <category domain="http://www.developerfriendly.com/taxonomy/term/59">music</category>
 <pubDate>Sat, 31 May 2008 06:54:56 -0500</pubDate>
 <dc:creator>20after4</dc:creator>
 <guid isPermaLink="false">61 at http://www.developerfriendly.com</guid>
</item>
<item>
 <title>Improving Drupal&#039;s support for the rel-tag Microformat</title>
 <link>http://www.developerfriendly.com/node/22</link>
 <description>&lt;p&gt;I recently installed the &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/4106&quot; title=&quot;The Operator extension at addons.mozilla.org&quot;&gt;Operator&lt;/a&gt; extension for Firefox. Operator is an interesting little extension which attempts to expose microformats embedded in web pages through a toolbar in the browser.&lt;/p&gt;

&lt;p&gt;While browsing this site with Operator installed I noticed a problem with the tags that are typically attached to each post to organize the site into categories. Drupal attempts to conform to the &lt;a href=&quot;http://microformats.org/wiki/rel-tag&quot;&gt;rel-tag microformat&lt;/a&gt; by attaching a rel=&quot;tag&quot; attribute to each tag link (Look at the section titled Tags: at the top of this post.) The problem is that drupal uses numbers for each category (aka &quot;Taxonomy Term.&quot;) and numbers don&#039;t make very readable tags.  As several others have already pointed out, this could be considered a deficiency in the microformat. The rel-tag specification doesn&#039;t provide any alternate way to specify a text-version of the tag, other than the last segment of the url. In the case of drupal, the last segment of a taxonomy url is the taxonomy term id, which is a number.&lt;/p&gt;
&lt;!--break--&gt;
&lt;p&gt; Fortunately, this is one case where the flexibility of Drupal&#039;s API comes to the rescue. I did a quick search of Drupal.org and turned up &lt;a href=&quot;http://drupal.org/node/65344&quot;&gt;this post&lt;/a&gt;. The solution offered was not up to date with Drupal 5.x and it didn&#039;t work for my version, however, that article mentioned a new API hook in Drupal HEAD called &lt;em&gt;hook_link_alter&lt;/em&gt;, a feature that eventually made it&#039;s way into the final release for Drupal 5. Using hook_link_alter I was able to hack together a short function that rewrites the tag links so that they end with the tag name instead of a number. Fortunately for us, Drupal&#039;s taxonomy system ignores the extra baggage on the end of taxonomy URLs and everything still works as expected.&lt;/p&gt;

&lt;p&gt;All of this explanation has quickly become much longer than the code that I am describing. Without further delay, here is some code that you can place in your drupal theme&#039;s template.php to make more sensible rel-tag taxonomy links:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
/* Alter rel-tag links to include the link tag name in the url */
function blog_link_alter(&amp;$node, &amp;$links) {
        foreach ($links AS $module =&gt; $link) {
                if ($link[&#039;attributes&#039;][&#039;rel&#039;] == &#039;tag&#039; &amp;&amp; !empty($link[&#039;title&#039;])) {
                        $links[$module][&#039;href&#039;] .= &quot;/&quot;.$link[&#039;title&#039;];
                }
        }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Warning: This is slightly hackish because I am placing a drupal api hook inside a theme template.php - this hook is prefixed with the blog module name and it actually belongs inside the blog module, however, I don&#039;t want to alter drupal core code so I chose to place this in my theme.&lt;/p&gt;

Technorati tags: &lt;a href=&quot;http://www.technorati.com/tag/drupal&quot; rel=&quot;tag&quot;&gt;drupal&lt;/a&gt;, &lt;a href=&quot;http://www.technorati.com/tag/rel-tag&quot; rel=&quot;tag&quot;&gt;rel-tag&lt;/a&gt;</description>
 <comments>http://www.developerfriendly.com/node/22#comments</comments>
 <category domain="http://www.developerfriendly.com/taxonomy/term/20">Drupal</category>
 <category domain="http://www.developerfriendly.com/taxonomy/term/22">microformats</category>
 <category domain="http://www.developerfriendly.com/taxonomy/term/7">Mozilla</category>
 <pubDate>Wed, 18 Jul 2007 16:27:40 -0500</pubDate>
 <dc:creator>20after4</dc:creator>
 <guid isPermaLink="false">22 at http://www.developerfriendly.com</guid>
</item>
</channel>
</rss>
