16 Decembris 2005

Browse links, not buttons

My continuing DSpace usability crusade led me to the browse buttons on community and collection home pages.

Yes, you heard me right: browse buttons. That’s just wrong. Buttons are for search. People browsing expect to click links, not buttons.

Fortunately, changing the buttons into links isn’t all that hard. It’s just non-obvious enough, though, that I thought I’d pass on how to do it.

DSpace community and collection browses are addressable; the URL formula is the local URL prefix plus “/handle/” plus the community’s handle plus “/browse-title” (or -author or -date): http://dspace.myu.edu/handle/1234/56/browse-title for example. The trick is that you can’t actually use the handle server to get there (I tried!), because the handle server gets confused by the “browse-title” portion of the URL.

So here’s what works, straight-up:

<p id="browselinks"><small><fmt:message key=”jsp.general.orbrowse”><fmt:param><%= name %></fmt:param></fmt:message></small>
<ul>
<li><a href=”
<%= request.getContextPath() %>/handle/<%= community.getHandle() %>/browse-title">Title</a></li>
<li><a href="
<%= request.getContextPath() %>/handle/<%= community.getHandle() %>/browse-author">Author</a></li>
<li><a href="
<%= request.getContextPath() %>/handle/<%= community.getHandle() %>/browse-date">Date</a></li>
</ul></p>

The next thing you’ll want is to give this an introduction. The browse directive in Messages.properties is—rather stupidly, I’m afraid—called jsp.general.orbrowse. Edit it to read Browse {0} by: and you’re golden.

I’m not sending this live on Monday because I haven’t made it pretty yet, and I’m also considering getting rid of the triply-damned combo box in the search form (we all know I’m anti-combo-box, right?) because it’s confusing—if you’re on a community or collection page anyway, you expect that to be the search scope. But I’ve tested this on my staging server, and it does work as expected. Happy hacking!