<?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/"
	>

<channel>
	<title>Everything In Between &#187; Information Architecture</title>
	<atom:link href="http://maymay.net/blog/category/information-communication/information-architecture/feed/" rel="self" type="application/rss+xml" />
	<link>http://maymay.net/blog</link>
	<description>The brutally honest, first-person account of Meitar Moscovitz's life.</description>
	<pubDate>Mon, 29 Dec 2008 14:40:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The ROI of Knowledge Sharing (Part 1)</title>
		<link>http://maymay.net/blog/2006/12/21/the-roi-of-knowledge-sharing-part-1/</link>
		<comments>http://maymay.net/blog/2006/12/21/the-roi-of-knowledge-sharing-part-1/#comments</comments>
		<pubDate>Thu, 21 Dec 2006 19:17:54 +0000</pubDate>
		<dc:creator>Meitar</dc:creator>
		
		<category><![CDATA[Business & E-Commerce]]></category>

		<category><![CDATA[Information & Communication]]></category>

		<category><![CDATA[Information Architecture]]></category>

		<category><![CDATA[Productivity]]></category>

		<guid isPermaLink="false">http://maymay.net/blog/archives/2006/12/21/the-roi-of-knowledge-sharing-part-1/</guid>
		<description><![CDATA[Successful knowledge sharing increases the productivity, effectiveness, and efficiency of your organization by enabling your staff to accomplish orders-of-magnitude more than they would otherwise have been able to. This <del>article</del> rant presents my ideas on this subject from the ground up.]]></description>
			<content:encoded><![CDATA[<p>Define success. Success means growing, making things easier, doing more in less time, etc. There are entire industry movements dedicated to figuring out how to be the best at being successful. Heck, there are even acronyms (imagine that!) for it in all sorts of speech domains, such as in business, where <acronym title="Return On Investment">ROI</acronym> (Return on Investment) is huge, and in productivity, GTD (Getting Things Done) is a huge fad right now. What I think people often misunderstand or fail to realize is the very simple fact that success is much harder on a large scale than on a small one. Why is this the case?</p>
<p>Well, obviously, success on a large scale means accomplish &#8220;much more&#8221; than success on a small scale. Also, success on a large scale often means working with more than one person where collaboration is a must. So what are the tools people use to accomplish this success?</p>
<p>The most well-known tool is management. Implement a structure in an organization that is overseen by people whose job it is to make sure success happens on varying levels of scale. The larger an organization gets the more managers it needs, not because of personnel (technology advancements and process improvements in Human Resources have significantly the amount of employees a company can keep track of) but rather to ensure that this army of personnel is not going to lose sight of whatever is deemed the successful goal in their appropriate &#8220;big picture.&#8221; For CEOs, this means the company&#8217;s bottom line. For regional managers, this means their region&#8217;s bottom line. For individual supervisors, this means success completion of the task their division was handed, and so on and so forth.</p>
<p>Clearly, this is an important and necessary part of doing business. But I theorize that businesses and large organizations tend to see the act of adding more management to their organization as an act of ensuring a return on their investments which is probably overestimated. A manager is someone you have to pay (often a lot more than other forms of employees), and whose job actually adds to the complexity and opaqueness and beurocracy of an organization. At some point, this must be more harmful than helpful.</p>
<p>So what else can be done? I would suggest that an often very underestimated and underutilized area of increasing <acronym title="Return On Investment">ROI</acronym> is by improving knowledge transfer and knowledge sharing between employees. Why? Because it builds on the concepts and proven methodologies of small-scale success wherein many small successes brings larger success naturally, rather than forcefully. I see the largest contributor to small-scale success (most explicitly evident in personal successes, probably the smallest scale you can get) as the increase of knowledge. My own experience has taught me that I am more productive now than I was one year ago because I can do more than I could do one year ago, and I can do more now than I could then because I know more about the world and the objects within it.</p>
<p>Applying this to a larger scale is simple in theory but difficult in practice. In theory, the more smart people an organization has working for it, the more collective knowledge is stored within that organization. In practice, this is actually a huge problem that the solution called management is attempting to alleviate because smart people tend to be very insular and self-driven. This leads to a phenomenon I have begun calling knowledge fracturing which ultimately results in siloed and specialized skill sets with little ability to expand beyond that specialization. This is so significant a problem in large organizations that entire industries and bodies of knowledge have been created to help alleviate workflow problems and help facilitate communication.</p>
<p>Now, this is good, because a prerequisite to knowledge sharing is communication. You can&#8217;t share what you know if you can&#8217;t communicate with someone who can listen. But this is only the first step. Certainly, an organization can ensure better <acronym title="Return On Investment">ROI</acronym> with communication tools, but the next level&#8211;which I have yet to see anyone focus on too obviously&#8211;is knowledge sharing; communication with the intent of making available the information one has accumulated to the point that enables one to share the information about one&#8217;s job function or skill set.</p>
<p>This is a concept that is actually extremely scary to most people. There are two oft-cited rebuttals to this. The first involves a concern for job security. If everything that I know about how to do my job and why is written down for fellow employees to see, what need is there for me? I maintain that this actually makes you as an employee more valuable, rather than less, because suddenly you are a teacher, a reference guide, an invaluable &#8220;go-to guy.&#8221; The more you share, the more clearly people understand what you know and what you&#8217;re good at. Sharing, at its roots, is all just about showcasing what you&#8217;re good at. How can that be bad?</p>
<p>The second involves a concern for an organizations information security, wherein too much knowledge sharing can actually be security breaches and information leaks that are unacceptable to the organization&#8217;s policies. Obviously, while this is an important issue, it is not a direct argument against the validity of knowledge sharing but rather an objection to a side-effect of it if it is done carelessly. As with all things, I think most people will agree that care should always be taken in everything you do. This is just one more example.</p>
<p>So why does knowledge sharing actually increase the overall <acronym title="Return On Investment">ROI</acronym> of an organization? I theorize, based solely on my own experiences, that the majority of time and expense that is not directly spent on progressing an organization&#8217;s goals are spent trying to navigate a system or accomplish a task that is only difficult because it is not understood. If it were understood, the procedure would take less time, or the company would not need to hire a consultant, or whatever the situation may be. The point is that if you know what you&#8217;re doing, you&#8217;ll do it more effectively and more efficiently.</p>
<p><strong>Successful knowledge sharing increases the productivity, effectiveness, and efficiency of your organization by enabling your staff to accomplish orders-of-magnitude more than they would otherwise have been able to.</strong></p>
<p>With that as a foundation, let&#8217;s next explore how an organization might go about successfully sharing knowledge. And as you may have guessed, I have one word that: wiki.</p>
<p>(I have not yet written the next part.)</p>
]]></content:encoded>
			<wfw:commentRss>http://maymay.net/blog/2006/12/21/the-roi-of-knowledge-sharing-part-1/feed/</wfw:commentRss>
		</item>
		<item>
		<title>To CMS or not to CMS?</title>
		<link>http://maymay.net/blog/2005/12/24/to-cms-or-not-to-cms/</link>
		<comments>http://maymay.net/blog/2005/12/24/to-cms-or-not-to-cms/#comments</comments>
		<pubDate>Sat, 24 Dec 2005 10:50:13 +0000</pubDate>
		<dc:creator>Meitar</dc:creator>
		
		<category><![CDATA[Business & E-Commerce]]></category>

		<category><![CDATA[Information Architecture]]></category>

		<category><![CDATA[Productivity]]></category>

		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">/?p=87</guid>
		<description><![CDATA[When considering a Content Management System, make sure you've worked out a publishing process that works for you and that you're not trying to solve process problems with software.]]></description>
			<content:encoded><![CDATA[<p>Earlier, I was with my brother and we were talking about his new job as the <a href="//uvm.edu/%7Eupb/?Page=roster.html&amp;SM=submenu4.html">Publicity Coordinator</a> for the <a href="//uvm.edu/~upb/">UVM Program Board</a>. I don&#8217;t know quite what the situation is, but it sounds like he wants to make their current web site more relevant to the students. I applaud that effort. To that end, I showed him what <a href="//wordpress.org">WordPress</a>, a blogging tool, might be able to do for them.</p>
<p>However, as I was going over the system with him I was reminded of <a href="http://www.uie.com/events/uiconf/articles/veen_interview/">this interview</a> with <a href="//veen.com/jeff/">Jefferey Veen</a>, in which he says that most web sites and companies never need a <acronym title="Content Management System">CMS</acronym>, and that it may very well fail in the first year anyway. According to Veen, the most important factor to consider when thinking about whether to use a new <acronym title="Content Management System">CMS</acronym> is only the basics.</p>
<blockquote cite="http://www.uie.com/events/uiconf/articles/veen_interview/"><p>&ldquo;What&#8217;s the absolute least you can get away with?&rdquo; Initially, teams should get the super-simple solution working and, only then, start adding complexity.</p>
</blockquote>
<p>This strategy is very sound because it focuses on the active process of getting content published, which is the ultimate goal. Here&#8217;s one area where blogging tools like WordPress really shine. At its roots, it is a super-simple mechanism for writing stuff that gets published on a web site. Contrast this goal with other, more &ldquo;robust&rdquo; <acronym title="Content Management System">CMS</acronym> packages like <a href="//postnuke.com">PostNuke</a> or <a href="//drupal.org">Drupal</a>, and it&#8217;s easy to see why the more one tool tries to do, the less effective it will potentially be for certain organizations.</p>
<blockquote title="Jefferey Veen talks about content management with UIE.com" cite="http://www.uie.com/events/uiconf/articles/veen_interview/"><p>Content management isn&#8217;t a software problem at all. It&#8217;s a process problem. By solving process problems, you often find you don&#8217;t even need software. Many companies buy software thinking that it will fix their process problems. But that&#8217;s like buying Microsoft Word hoping that it will make you a better writer.</p>
</blockquote>
<p>(That&#8217;s not to say that PostNuke and Drupal are bad <acronym title="Content Management System">CMS</acronym> packages, they&#8217;re just different, but I&#8217;ve never known anyone to be happy with either of these products when all they wanted to do was &ldquo;get my page online.&rdquo; Most of their features are overkill, either too complicated or too confusing or, even worse, not relevant for the average business web site.)</p>
<p>This &ldquo;best tool for the job&rdquo; philosophy is too often overlooked by webmasters who are rushing to get it all done. Analyzing a web site&#8217;s needs is the most important step towards building a site that works. And that brings me back to the UVM Program Board.</p>
<p>Starting from scratch they have a golden opportunity to define their workflow and create a process for creating content that works for them. WordPress might be a great tool to aid in that process because they have the content and the architecture they need to start using it right away. In other words, the role of their <acronym title="Content Management System">CMS</acronym> will be to provide access to content to the appropriate people. <em>Everything</em> else is the job of a <em>person</em>. Veen says it best:</p>
<blockquote cite="http://www.uie.com/events/uiconf/articles/veen_interview/"><p>[&hellip;] a <acronym title="Content Management System">CMS</acronym> is almost never a piece of software that you can buy and start using right away. Rather, they are platforms &#8212; frameworks for building custom content applications based on an organization&#8217;s needs.</p>
</blockquote>
<p>So in short, <a href="//sheershir.com/">Shir</a>, congratulations on your new position as the Publicity Coordinator, and I&#8217;m proud of you for thinking of innovative new ways to use the Web to achieve your goals. That said, keep in mind that whatever you end up doing with the site, whether it&#8217;s using WordPress or not, remember that it&#8217;s all just a tool to get another job done. Keep the big picture in mind, and I know you&#8217;ll succeed.</p>
<p><strong>Update:</strong> On further examination of their site, it looks like some sections might be using <a href="//moveabletype.org">Moveable Type</a> as a blogging system. Either way, the point I&#8217;m trying to make is that whatever system you use has to be compatible with the way you work, and the way you work needs to be planned out well before you start picking a <acronym title="Content Management System">CMS</acronym> to install.</p>
]]></content:encoded>
			<wfw:commentRss>http://maymay.net/blog/2005/12/24/to-cms-or-not-to-cms/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using Good URL Design to Create a Breadcrumb Navigation System In PHP</title>
		<link>http://maymay.net/blog/2005/03/21/php-breadcrumb-navigation-using-url-design/</link>
		<comments>http://maymay.net/blog/2005/03/21/php-breadcrumb-navigation-using-url-design/#comments</comments>
		<pubDate>Mon, 21 Mar 2005 11:38:52 +0000</pubDate>
		<dc:creator>Meitar</dc:creator>
		
		<category><![CDATA[Information Architecture]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">/?p=212</guid>
		<description><![CDATA[By designing and using a meaningful, cruft-free URL scheme you can easily implement a dynamic, scalable, breadcrumb navigation trail on your entire site with minimal fuss, all in about 30 lines of PHP. I kid you not!]]></description>
			<content:encoded><![CDATA[<p>One fundamental aspect of any good navigation system is a mechanism to let users know where they are in relation to the rest of the content. On the Web, one of the <a href="http://www.webdesignpractices.com/navigation/breadcrumb.html" title="Simple survey of sites on breadcrumb navigation.">most popular</a> and <a href="http://psychology.wichita.edu/surl/usabilitynews/51/breadcrumb.htm" title="Usability study on breadcrumb navigation.">thoroughly studied</a> ways to reflect this information is in a so-called breadcrumb navigation trail or bar. This navigation bar lists the categories and subcategories (or sections and subsections) of the page which the user is browsing.</p>
<p>(Quick-minded readers will be quick to point out that the term <em>breadcrumb</em> navigation trail, which originates from the Hansel and Gretel story, is not entirely accurate. In the story, Hansel and Gretel left a trail of breadcrumbs as they wandered through the forest so they could retrace their steps back home. On a web site, the breadcrumb navigation trail reflects the current page&#8217;s position in the site hierarchy, <em>not</em> the path the user has taken through the site.)</p>
<h3>Defining the Requirements of Breadcrumb Navigation</h3>
<p>When I started looking for ways to easily implement a breadcrumb navigation trail on my web site, I immediately saw the potential complexity of the project. The hierarchical navigation system needed to:</p>
<ul>
<li>Accurately reflect a page&#8217;s position in the hierarchical information architecture of <em>the site</em> and not the physical location of the page in my web server. (This is important for me because I&#8217;m constantly moving things around.)</li>
<li>Present a nicely formatted label for each level of depth.</li>
<li>Automatically adjust itself for new pages, so I would never have to deal with it when adding new sections to my site.</li>
<li>Not require any &ldquo;heavy&rdquo; database or large application to use <em>and scale</em>.</li>
</ul>
<p>Additionally, the module should:</p>
<ul>
<li>Produce semantic, valid <acronym title="HyperText Markup Language">HTML</acronym> marked up <em>as a list</em>.</li>
<li>Link all elements in the list to their appropriate page level.</li>
<li>Not link the last level, which should display the current location of the user in the site. (We don&#8217;t need a link back to the same page we&#8217;re already on.)</li>
</ul>
<h3>Searching for Inspiration</h3>
<p>The first thing I, like any good programmer, went to do was search for existing code. Unfortunately, there is an appallingly small amount of <a href="http://www.google.com/search?q=dynamic+breadcrumb+navigation" title="Search google.">information on implementing breadcrumb navigation</a> out there. Sure, they&#8217;ll tell you what it is and what it&#8217;s good for, even convince you why you should have it, but as for actually implementing it goes&hellip;sorry, you&#8217;re on your own.</p>
<p>Every tutorial I found on the matter was decidely sub-par or completely failed to meet my requirements, listed above. Most sites stated the need for databases to create truly scalable and customizeable breadcrumb trails. Of course, nothing can compete with a fully integrated <acronym title="Relational DataBase Management System">RDBMS</acronym> solution, but with intelligent information architecture you can come pretty darn close.</p>
<h3>Using the <acronym title="Uniform Resource Locator">URL</acronym> to Our Advantage</h3>
<p>Thankfully, there is already a system of hierarchical navigation readily available to us. In fact, there are two!</p>
<ol>
<li><strong>Directory trees on your web server.</strong> The folders in which your files are stored are probably already sorted somewhat logically and categorically.</li>
<li><strong>The <acronym title="Uniform Resource Locator">URL</acronym> of the requested page.</strong> The address bar in your browser drills down through these categories to get to the final page.</li>
</ol>
<p>Both of these systems provide a basis from which we can draw upon to create a simple, self-organizing breadcrumb navigation system on a web site of almost any size. However, there are a few problems with the first method. (If you want to implement that method anyway, here&#8217;s a <a href="http://www.zend.com/zend/spotlight/breadcrumb28.php" title="Zend's Code Gallery Spotlight on breadcrumb navigation based on directory trees.">tutorial</a> based around using a directory tree.)</p>
<ul>
<li><strong>It doesn&#8217;t scale.</strong> If you&#8217;ve got a huge web site, you&#8217;re not going to keep all that data on static files on your web server. It would also be a full-time job to categorize and sort that content on said server! Oi, vey!</li>
<li><strong>It&#8217;s dependant on your organization system.</strong> If you&#8217;re anything like me, you don&#8217;t necessarily have folders within folders within folders just to store files, and if you do, you probably change them around pretty often to suit your needs. Unfortunately, basing breadcrumb navigation on <em>your</em> view of your information as opposed to <em>your visitor&#8217;s view</em> of the same information is a recipe for disaster in all but the smallest web sites.</li>
</ul>
<p>Thus, the only remaining solution was to rope the <acronym title="Uniform Resource Locator">URL</acronym> of the page into service to serve as the basis for a breadcrumb navigation system. Even so, there is one huge obstacle to overcome with this method. <strong>The <acronym title="Uniform Resource Locator">URL</acronym> itself must not be attached to a physical filesystem on the web server.</strong></p>
<p>Otherwise, we&#8217;re just basically using the filesystem hierarchy, which we&#8217;ve already seen is not adequete for our needs. So we need a way to abstract, or detach, the <acronym title="Uniform Resource Locator">URL</acronym> from the filesystem itself. Enter <code>mod_rewrite</code>, stage left.</p>
<h3>Abstracting the <acronym title="Uniform Resource Locator">URL</acronym> from the Filesystem</h3>
<p>Abstracting the <acronym title="Uniform Resource Locator">URL</acronym> from the filesystem is the critical step to enabling truly scalable, self-organizing breadcrumb navigation using such a simple foundation. This is essential because the <acronym title="Uniform Resource Locator">URL</acronym> of your page is the thing that will always be live; if the <acronym title="Uniform Resource Locator">URL</acronym> changes, so has your page! This change will then be reflected automatically in the breadcrumb navigation trail.</p>
<p>There are a number of other benefits to abstracting the <acronym title="Uniform Resource Locator">URL</acronym> of a page away from the physical filesystem it represents. I&#8217;ve even talked about some of them before when I blogged about <a href="http://www.maymay.net/blog/archives/2004/12/13/fun-with-apache-redirects/?r-msg=Abstracting+URLs+away+from+the+filesystem+enables+seamless%2c+invisible+behind-the-scenes+reorganization%3A#seamless-reorganization" title="Reorganize at will, and don't break links!">playing with Apache</a> and when <a href="http://www.maymay.net/blog/archives/2004/11/14/tips-to-improve-search-engine-rankings-of-cms-generated-content/?r-msg=Search+engines+and+site+visitors+alike+both+want+and+need+friendly+URLs%3A#friendly-urls-for-spiders" title="What you can do to help your dynamic pages rank better in search engines.">I suggested tips</a> for improving search engine rankings of <acronym title="Content Management System">CMS</acronym>-generated content.</p>
<p>The basic prerequisite for a good <acronym title="Uniform Resource Locator">URL</acronym> schema, however, is solid information architecture. This means having a well-defined and clear structure to your site so information is easily findable and properly labelled, categorized, and placed within the system you use. Only after you create a sound <acronym title="Uniform Resource Locator">URL</acronym> design schema free of any unsightly cruft which succinctly encodes the hierarchy of your site will you be able to leverage them to their fullest potential. (Phew, that was a mouthful!)</p>
<p>So, since this is not a post about <acronym title="Uniform Resource Identifier">URI</acronym> design (see <a href="#uri-design-resources" title="The end of this entry has additional resources on designing meaninful web addresses.">these resources</a> for articles on that), let&#8217;s assume you&#8217;ve done all that and are ready to implement your schema. The tools you&#8217;ll need are:</p>
<ul>
<li>The <a href="http://httpd.apache.org/" title="Don't worry, it's free!">Apache web server</a>.</li>
<li>Its <code><a href="http://httpd.apache.org/docs/mod/mod_rewrite.html" title="Comes standard with most Apache installations.">mod_rewrite</a></code> module.</li>
<li>Access to the server configuration file or the ability to use <code>.htaccess</code> files.</li>
<li>Later on, you&#8217;ll also need <a href="http://php.net/" title="Also free-of-charge!"><acronym title="PHP Hypertext Preprocessor; an HTML-embedded scripting language">PHP</acronym></a>, for the coding thing.</li>
</ul>
<p>To make things simple, I&#8217;ll use <a href="http://maymaymedia.com/" title="The site I actually implemented this whole thing on.">my site</a> as an example.</p>
<p>For my own site, I have several sections (&ldquo;About,&rdquo; &ldquo;Services,&rdquo; &ldquo;News &amp; Weblog,&rdquo; etc.) and several top level pages that stand on their own (&ldquo;Home,&rdquo; &ldquo;Contact&rdquo;). Additionally, each section has an index page to ensure that no hierarchical level of my site is without its corresponding landing page.</p>
<p>This was going to be represented with straight-forward URLs that looked like this:</p>
<ul>
<li>The &ldquo;Home&rdquo; page would have this URL: <code>http://www.maymay.net/maymaymedia/</code></li>
<li>So-called &ldquo;top-level&rdquo; pages would look like this:
<ul>
<li>For the &ldquo;Contact&rdquo; page: <code>http://www.maymay.net/maymaymedia/contact/</code></li>
<li>For the &ldquo;About Us&rdquo; page: <code>http://www.maymay.net/maymaymedia/about/</code></li>
<li>For the &ldquo;Services&rdquo; page: <code>http://www.maymay.net/maymaymedia/services/</code></li>
</ul>
</li>
<li>Second-level pages would have URLs such as these:
<ul>
<li>For each service:
<ul>
<li>http://www.maymay.net/maymaymedia/services/web-programming/</li>
<li>http://www.maymay.net/maymaymedia/services/web-accessibility/</li>
<li>http://www.maymay.net/maymaymedia/services/web-site-optimization/</li>
</ul>
<li>For each &ldquo;About&rdquo; page, for instance:
<ul>
<li>http://www.maymay.net/maymaymedia/about/accessibility/</li>
<li>http://www.maymay.net/maymaymedia/about/philosophy/</li>
<li>http://www.maymay.net/maymaymedia/about/technology/</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>My files are stored pretty simply on my web server. Some pages, like the &ldquo;Contact&rdquo; page are stored in the <code>maymaymedia</code> directory but not in their own sub-directory. Other pages, like the &ldquo;Services&rdquo; and &ldquo;About&rdquo; pages, are stored in the <code>services</code> and <code>about</code> directories, respectively</p>
<p>This created filenames like <code>maymaymedia/contact.php</code> and <code>maymaymedia/about/index.php</code>. That <code>.php</code> stuff had to go!</p>
<h4>Writing Your <code>.htaccess</code> File</h4>
<p>Using the magic of <code>mod_rewrite</code>, a few relatively simple lines added to your <code>.htaccess</code> file is all it takes to turn these filenames into these beautiful cruft-free URLs.</p>
<p>Creating the sections was easy enough. Some of the work was already done by keeping the pages in their own directory (such as &ldquo;Services,&rdquo; for me) so I didn&#8217;t even <em>have</em> to do anything. Of course, to be safe, I could future-proof my site to abstract these directory trees using additional lines in my <code>.htaccess</code> file, but for the sake of simplicty we&#8217;ll leave it as is.</p>
<p>Here are a few relevant snippets from my <code>.htaccess</code> file:</p>
<pre>RewriteEngine On
RewriteBase /maymaymedia/
[&hellip;]
RewriteRule ^about/technology/?$ /maymaymedia/about/tech.php
RewriteRule ^about/philosophy/?$ /maymaymedia/about/philosophy.php
RewriteRule ^about/accessibility/?$ /maymaymedia/about/access.php
[&hellip;]
RewriteRule ^services?/web-site-optimization/?$ /maymaymedia/services/wso.php
RewriteRule ^services?/web-programming/?$ /maymaymedia/services/webprogramming.php
RewriteRule ^services?/web-accessibility/?$ /maymaymedia/services/accessconsult.php
[&hellip;]
RewriteRule ^contact/?$ /maymaymedia/contact.php</pre>
<p>These merely map simple <acronym title="Uniform Resource Locator">URL</acronym>&#8217;s onto the appropriate files for the specific page on my server, creating the nice breadcrumb-like <acronym title="Uniform Resource Identifier">URI</acronym> structure we can now use to automate the process of generating our hierarchical navigation bar.</p>
<p>There are two main points to keep in mind when creating such <acronym title="Uniform Resource Locator">URL</acronym> schemes.</p>
<ul>
<li><strong>Use a standardized syntax.</strong>
<p>Don&#8217;t mix and match symbols. Choose one syntax and stick with it. I used a hyphen (-) to simulate spaces, since spaces are not allowed in URIs. You could also use the underscore (_) if you wanted, but hyphens don&#8217;t require users to press the <kbd>shift</kbd> key.</p>
</li>
<li><strong>Make the <acronym title="Uniform Resource Locator">URL</acronym> descriptive.</strong>
<p>Since we&#8217;re going to be using these URLs as our breadcrumb navigation labels, they need to be as descriptive as possible. Keep them short enough to easily type but long enough to provide context. For instance, I could have used <code>wso</code> instead of <code>web-site-optimization</code> but how many people know that that&#8217;s what <acronym title="Web Site Optimization">WSO</acronym> stands for?</p>
<p>Besides, including the whole phrase boosts our search engine rankings by embedding our keywords into the <acronym title="Uniform Resource Locator">URL</acronym> itself! A nice bonus which also enhances usability.</p>
<p>If you&#8217;re really worried about optimizations (for instance, because you&#8217;ll have to write all your links like <code>href="/services/web-site-optimization/"</code>) then you can use a redirection script and point your links at something like <code>href="/r/wso/"</code> which would then automatically redirect to the expanded <acronym title="Uniform Resource Locator">URL</acronym>.</p>
</li>
</ul>
<h3>Coding the <acronym title="PHP Hypertext Preprocessor; an HTML-embedded scripting language">PHP</acronym> Breadcrumb Navigation Bar</h3>
<p>Now we&#8217;re ready to leverage the inherent advantages of good <acronym title="Uniform Resource Locator">URL</acronym> design to create our scalable <acronym title="PHP Hypertext Preprocessor; an HTML-embedded scripting language">PHP</acronym> breadcrumb navigation script. I use a special <acronym title="PHP Hypertext Preprocessor; an HTML-embedded scripting language">PHP</acronym> script called <code>navbar.php</code> to dynamically generate all of my navigation, so that&#8217;s where the code will go. <code>navbar.php</code> can then be <acronym title="Server Side Include">SSI</acronym>&#8216;ed or <code>include()</code>&#8216;ed on our page template so it will be present in all the pages we create from here on out.</p>
<p>The breadcrumb navigation script needs to do a few things. The code flow looks like this:</p>
<ul>
<li>Grab the requested <acronym title="Uniform Resource Identifier">URI</acronym> and break it into its path components.</li>
<li>Initialize (or remove) the first (&ldquo;top&rdquo;) element.</li>
<li>Count the remaining elements.</li>
<li>Check for trailing slashes on the last element, and remove it if necessary (such as if its empty or it&#8217;s just a query string).</li>
<li>Loop through all the elements, placing them within <code>&lt;li&gt;&lt;/li&gt;</code> <acronym title="HyperText Markup Language">HTML</acronym> elements as well as <code>&lt;a&gt;&lt;/a&gt;</code> if we are not at the last level.</li>
</ul>
<h4>Stepping Through the Code</h4>
<p>First, we start our <acronym title="HyperText Markup Language">HTML</acronym> by providing a header (which we can later set to <code>display:none;</code> in our <acronym title="Cascading Style Sheets">CSS</acronym>) and starting the list element. Due to the specific nature of my site structure (the site starts in a sub-directory of my main site), I also chose to always print the main &ldquo;Maymay Media Home&rdquo; link. You don&#8217;t have to do this.</p>
<pre>&lt;h3&gt;Hierarchical Navigation&lt;/h3&gt;
&lt;ul id="hier-nav"&gt;
&lt;li id="hier-homeLnk"&gt;&lt;a href="/maymaymedia/" title="Maymay Media Home"&gt;Maymay Media&lt;/a&gt;&lt;/li&gt;</pre>
<p>Next, we start the <acronym title="PHP Hypertext Preprocessor; an HTML-embedded scripting language">PHP</acronym> magic, grab the <acronym title="Uniform Resource Identifier">URI</acronym> the browser requested and break it on the slashes with <code><a href="http://php.net/explode" title="Documentation for the explode() function.">explode()</a></code>.</p>
<pre>&lt;?php
<var>$url_parts</var> = explode('/', <var>$_SERVER</var>['REQUEST_URI']);</pre>
<p>Now the <code><var>$url_parts</var></code> variable contains an array, each element of which is a segment of the path from the requested <acronym title="Uniform Resource Identifier">URI</acronym>. Since a <acronym title="Uniform Resource Identifier">URI</acronym> request always starts with a leading <code>/</code>, the first element of our <code><var>$url_parts</var></code> variable is an empty string. That&#8217;s somewhat useless for us, so we&#8217;ll get rid of it.</p>
<pre>array_shift(<var>$url_parts</var>); // first item always empty in URLs</pre>
<p><strong>In my particular case</strong>, the second element will always correspond to the <code>maymaymedia</code> sub-directory I have my site in. Thus, the second element of this array is also useless to me, since I chose to always print this &ldquo;top level&rdquo; link before we even started the conditional code. Thus, I get rid of the second element, too. (You may not want to do this in your script!)</p>
<pre>array_shift(<var>$url_parts</var>); // second item unneeded since always contains "maymaymedia" due to my site structure</pre>
<p>Now we need to count how many elements are left in our array which will tell us how many list items we need to make and where to find the end of our array so we can identify the last element. Remember, we&#8217;re going to need to check if the last element is empty or not because we don&#8217;t know if the visitor entered a trailing slash in the address bar.</p>
<p>If the last element is empty like the first one then we don&#8217;t need it. We also don&#8217;t need it if all it contains is a query string, so in either case we can pop it off the end of our array and decrement the variable we use to store the size of our array.</p>
<pre><var>$num_parts</var> = count(<var>$url_parts</var>);
// remove last element if empty or if a query string
if (empty(<var>$url_parts</var>[<var>$num_parts</var>-1]) || <var>$url_parts</var>[<var>$num_parts</var>-1] == '?'.<var>$_SERVER</var>['QUERY_STRING'])
{
    array_pop(<var>$url_parts</var>);
    <var>$num_parts</var>&#45;&#45;; // decrement to keep track
}</pre>
<p>Now we have all the data we need to construct our breadcrumb navigation list. The first step is to start the second list item and insert a separator (I chose a &ldquo;&gt;&rdquo; character), and then to format our <acronym title="Uniform Resource Locator">URL</acronym> strings into a more human-readable format. Basically, that just means replacing all of the &ldquo;<code>-</code>&rdquo; characters with spaces, and then capitalizing the first character of all the resulting words.</p>
<pre>for (<var>$i</var>=0; <var>$i</var>&lt;<var>$num_parts</var>; <var>$i</var>++)
{
    echo '&lt;li&gt; &amp;gt; ';
    <var>$p</var> = ucwords(str_replace('-', ' ', <var>$url_parts</var>[<var>$i</var>])); // format 'things-like-this' to 'Things Like This'</pre>
<p>(Of course, advanced <acronym title="Cascading Style Sheets">CSS</acronym> coders will note that inserting a physical character in the <acronym title="HyperText Markup Language">HTML</acronym> markup is unnecessary since we can use a <acronym title="Cascading Style Sheets">CSS</acronym> rule such as <code>#hier-nav li:before { content: ">"; }</code> to create this presentational separator instead. Unfortunately, Internet Explorer does not support this level of <acronym title="Cascading Style Sheets">CSS</acronym> yet, so we must resign ourselves to use a physical character in the markup for now.)</p>
<p>Then we make a quick check to ensure we&#8217;re not at the end of the trail. If indeed we&#8217;re not, then we need to turn our text into a link and point it to go to the appropriate level. Otherwise, since we&#8217;re at the end of the trail, we just print the text and end our list item.</p>
<p>Creating the link looks complicated, but it&#8217;s really not. Our array stores all the path components for us, so all we need to do is slice off the end of it so all that remains is the first elements we&#8217;ve already looped through.</p>
<p>Once we&#8217;ve done that, we merely reassemble our <acronym title="Uniform Resource Locator">URL</acronym> by reversing the formatting process we used before. Namely, we <code><a href="http://php.net/implode" title="Documentation on the implode() function.">implode()</a></code> our array to turn it into a single string connected with the slashes, replace all spaces with dashes (<code>-</code>), and then turn the whole thing lowercase. We can do all of it on one line.</p>
<p>Also note that <strong>due to my particular site structure</strong> I&#8217;ve hard-coded the links to point to the root directory of <em>this</em> site. You&#8217;ll probably want to remove that on your own script.</p>
<pre>    // only link if not last time through loop
    if (<var>$i</var> != (<var>$num_parts</var>-1) )
    {
        echo "&lt;a href=&#92;"/maymaymedia/".strtolower(str_replace(' ', '-', implode('/', array_slice(<var>$url_parts</var>, 0, <var>$i</var>+1))))."/&#92;" title=&#92;"Go up to <var>$p</var>&#92;"&gt;<var>$p</var>&lt;/a&gt;&lt;/li&gt;";
    }
    else // last time through loop, so don't do the link
    {
        echo "<var>$p</var>&lt;/li&gt;";
    }
}
?>
&lt;/ul&gt;</pre>
<p>That&#8217;s it! After closing our list element, we&#8217;re <em>done</em>, and we now have scalable breadcrumb navigation based on an intelligent <acronym title="Uniform Resource Identifier">URI</acronym> schema <em>on every single page</em>. Was it good for you too?</p>
<h3 id="uri-design-resources">Additional <acronym title="Uniform Resource Identifier">URI</acronym> Design Resources</h3>
<p>(Some segments shamelessly swiped for my own easy reference from <a href="http://www.pixelcharmer.com/fieldnotes/archives/process_designing/2003/000285.html" title="Where I got all this cool stuff.">Pixelcharmer</a>.)</p>
<p>A list of resources that argue for and suggest best practices in <acronym title="Uniform Resource Identifier">URI</acronym> construction.</p>
<ul>
<li><a href="http://www.isoc.org/HMP/PAPER/016/html/paper.html">The User Interface of URLs</a> (Paul E. Hoffman, 1995)</li>
<li><a href="http://www.w3.org/Provider/Style/URI.html">Cool URI’s Don’t Change</a> (Tim Berners-Lee, 1998)</li>
<li><a href="http://www.useit.com/alertbox/990321.html">URL’s as <acronym title="User Interface">UI</acronym></a> (Jakob Nielsen, 1999)</li>
<li><a href="http://www.alistapart.com/stories/urls/">URL’s URL’s URL’s</a> (Bill Humphries, 2000)</li>
<li><a href="http://www.alistapart.com/stories/succeed/">How to Succeed with URL’s</a> (Till Quack, 2001)</li>
<li>
<a href="http://www-106.ibm.com/developerworks/library/us-cranky8.html?dwzone=usability">Making URLs accessible</a> (Peter Seebach, 2001)</li>
<li><a href="http://www.adaptivepath.com/publications/essays/archives/000058.php">User-Centered <acronym title="Uniform Resource Locator">URL</acronym> Design</a> (Jesse James Garrett, 2002)</li>
<li><a title="Common HTTP Implementation Problems" href="http://www.w3.org/TR/2003/NOTE-chips-20030128/#gl1">Designing URIs</a> (2003)</li>
<li>In German: <a href="http://www.web-blog.net/comments/P122_0_1_0/">Usability Inside | <acronym title="Uniform Resource Locator">URL</acronym>-Design</a> (January, 2004)</li>
</ul>
<p>By the way, here&#8217;s the difference between the two: <a href="http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?Uniform+Resource+Locator">What is a <acronym title="Uniform Resource Locator">URL</acronym></a>? <a href="http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?Universal+Resource+Identifier">What is a <acronym title="Uniform Resource Identifier">URI</acronym></a>?</p>
]]></content:encoded>
			<wfw:commentRss>http://maymay.net/blog/2005/03/21/php-breadcrumb-navigation-using-url-design/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
