Home
The Toolkit for Online Communities
17443 Community Members, 1 member online, 3008 visitors today
Log In Register
OpenACS Home : Forums : OpenACS Q&A : Improving forums package usability

Forum OpenACS Q&A: Improving forums package usability

Icon of envelope Request notifications

Collapse
Posted by Roberto Mello on
Hi all,

I added "pretty" URLs to the forums instance in openacs.org. You can now go to "/forums/openacs" instead of "/forums/forum_view?forum_id=13013".

Also, you can go to "/forums/openacs/56087" instead of "/forums/message_view?message_id=56087". Right now, for messages, it grabs whatever message_id you especified, regardless if it actually belongs to that forum. It does usual checks for read permissions, etc.

This was accomplished with .vuh (Virtual URL Handler) magic (which is really nice btw).

I will be comitting this feature to the forums CVS, but first I have to change the data model so that each forum has a "short_name" column to identify the forum (currently forum_ids are hardcoded on openacs.org). I have already talked to Ben and he agreed.

The short_name column will also allow us to have a "[openacs] Re: Foobar is here" style of subject lines in e-mail, which will only happen if scanning of incoming e-mail through notifications is off (a feature that I'm adding to the notifications package).

Let me know if you have any problems/suggestions.

-Roberto

Collapse
Posted by Vadim Makarov on
That's nice, but does this mean now we have two URLs for each piece of content? Where will all automatically generated links point at?
Collapse
Posted by Vadim Makarov on
Real usability starts when one and only one URL is used for each piece of content, and all hyperlinks on the site point to exactly that URL. If that piece of content must respond at a different legacy URL, it's 301 redirected to the new one (but no autogenerated content on the site should point to the legacy URL).

This includes character encoding in URLs. For example, "-", "%2d" and "%2D" may mean the same to the server, but make URLs different from client's standpoint (browser history, search engine, etc.); only one encoding for every character should be therefore used.

I hope I'm not getting too hard here, but this is what consistency of URLs really means. If you've visited a page but see a link to it in blue (unvisited) color on another page, you know that the site is not being consistent. Some sites hide it by setting the link colors to the same color :)

Collapse
Posted by Roberto Mello on
Vadim,

If I went through the trouble of adding the feature it would seem pretty obvious that the plan is to make all dynamically-generated content to point to those new pretty URLs. Why else would I add pretty URLs? I can assure you it wasn't for the cool factor.

In my post I made clear that I had to make some data model changes before being able to incorporate the feature into the forums package proper. As a matter of fact, I'm testing my modifications to the forums package as we speak.

-Roberto

Collapse
Posted by Tom Jackson on

I can't agree that you must have only one official url for each 'page'. Also, it is a browser bug if the browser cannot figure out that character encodings are case insensitive. An url is an abstraction, and in OpenACS, it is only a part of what determines the response that is returned. Using a 302 response doesn't really do much, the content hasn't moved. A 302 should be used when the server cannot fulfil the request, but knows where it can be fulfilled.

Collapse
Posted by Ben Adida on
Roberto's modification is a really good step towards making OpenACS more W3C-friendly. We should move entirely towards URLs that don't have form variables when those aren't needed.

In general, our URLs for fetching single pieces of data (one message, one FAQ, one news item, one blog entry) should be of the form /package_name/view/{id}

This is good for bookmarking, emailing URLs, indexing, etc... and it's really easy to do with .vuh files. I don't think this is so much an added feature as much as a replacement for the old clunky URLs.

Collapse
Posted by Tilmann Singer on
Here's a utility proc that I had lying around for automatically generating a version of a text that is suitable for usage in a URL. It transforms e.g. "Foo Bar" to "foo-bar". I tried to add some automatic numbering so that it can be passed a list of existing URL's so that it can generate foo-bar-2 if there is already a foo-bar URL present to avoid collisions.

It might be useful to optionally create the URL automatically, so that the admin does not have to insert a short name manually every time when creating a new forum.

http://openacs.org/bugtracker/openacs/patch?patch%5fnumber=3