I fought the XSLT and I won: Browse index hightlighting in HIP

So I feel like I just won a wrestling match with the Horizon Information Portal (our OPAC), and wanted to gloat and share what I’ve done. The rules of the match were ‘XSLT’, because HIP has a point of intervention where you can change display using XSLT (not always very easily). My stuff isn’t entirely deployed yet, but I’ll show you on our test server.

We, like many users, have the HIP browse results configured to put your match on line 3, not line 1, so you get some alphabetical context. But that confuses the user, they don’t know where to look. Because it doesn’t mark that row in any special way.

UChicago hacked HIP to address this somewhat, see the asterisk on row 3 here.

So to begin with, I took what they have, made easier because they share some of their internal docs on the web. (Thanks Stuart!).

But I wanted to improve upon this. To begin with, instead of an asterisk, how about CSS hilighting? (I don’t like that color much, but that’s trivial). Also, try pressing ‘next’ and ‘previous’ buttons, nothing is hilighted on other screens, which is good.

But wait, sometimes your exact query doesn’t match. How about a better style to show you where your query files alphabetically, rather than implying that one of the rows was a match?

At this point I thought I was done, but then the real XSLT wrestling began. I realized that on the subject browse lists, “see” and “see also” lines could push the ‘match’ line to a row other than 3. So I had to find the right row first—which might match your query exactly, or might be a closest alphabetical match. And somehow I did it. See this search, or for a particularly pathological example, check out line 53 (! I didn’t make it work this way, I just made it correctly hilighted) on this one.

Whew. The XSLT is crazy. I worry a bit about performance, but I think so much XSLT is going on anyway that my addition shouldn’t hurt much (and I did my best to minimize it). But it works!

Then I remember that I’m not sure why or if the browse lists are useful to anyone anyway. Doh! But as long as we have em, might as well make em work better (and it’s at least useful to other librarians).

Details can be shared with other HIP users who want it, but give me a couple days to make sure it’s bug free. (And then I’ll have to figure out how to pull out the crazy XSLT in a way you can understand where to put it).

[In other news, I still think ‘duck typing’ is a really bad idea, sorry. I like everything about Ruby except this convention. I can even easily think of a way to use Ruby that I would like, but if the Ruby community doesn’t do it, it’s kind of pointless.]

This entry was posted in catalogs. Bookmark the permalink.

One Response to I fought the XSLT and I won: Browse index hightlighting in HIP

  1. Yes, I’d love to know what you come up with; I’d love to incorporate it here. Thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s