Interwiki Habari Plugin

A while back, I talked about my favorite Habari plugins, which received some links from the Habarians forum. Nothing much has changed, but I have found another neat plugin. Today, I thought that I would talk about that plugin, which is called Interwiki.

As most of you should probably know, I have local and server-based copies of Habari and posts are transferred between the two. However, Relative Replace is not quite so good at making the transition easier. It works well when one uses the user directory capabilities of Apache, or something similar, but not quite so well when trying to link to subdomains, mainly because it automatically prefixes URLs with http://. This means that entering addresses with subdomains, which would point to other virtual hosts on the same server, are practically impossible. As such, I needed another plugin to fufill this role.

After a bit of searching, I came across a plugin that has existed for quite a while, which promises the ability to use another item from the MediaWiki platform, known as an interwiki link.

While there are things that can be used to link to things on the same server as the wiki, that is not the only option for linking to other sites either on the server or outside it. The other option, which I was introduced to via a book I read in my college days, is a shorthand method where one enters a prefix ending with a colon followed by the article name. MediaWiki would then take that and transform it into an external link. As it works like a normal internal link, one could also use pipes to specify the link text.

Thinking that this plugin would let me do the same, since I really wanted to link to a page on my wiki in a few posts, mostly episode reviews of Detective Conan (Case Closed), I downloaded it and gave it a try.

On first usage, it seemed to work as expected and I could add prefixes via the PHP source. There are prefixes for Wikimedia sites, such as Wikipedia, Wikibooks, Wiktionary, and Wikimedia Commons, which I have not tried but should work without any problems. For my usage, I only needed to create one prefix and have it point to my local copy of MediaWiki for my local copy of Habari and have that same prefix point to the public address for my wiki on the server-based copy of Habari. That part was not too difficult and was somewhat satisfying.

However, there were some problems that arose during the first time I tried the plugin. First, I expected to be able to use a pipe to specify link text, like I could on Wikipedia and other sites that used MediaWiki, but it always put up the article name instead. Whatever was typed after the pipe was added to the URL. This meant that even when one entered the right article name, the link still would not work, unless one gave in and just forgot about specifying link text. In some cases, one would be okay with the article name being in the body of a blog post's content, but I think that most of the time, people just want something other than the article name. Second, article names cannot contain spaces, whereas they can on Wikipedia. Article names that contain spaces must have underscores present. Considering that there are prefixes for more than sites that use MediaWiki though, this is understandable. Still, this leads into the third problem I had, which I only remember happening when ringmaster, who made Relative Replace for me, modified the plugin at my request, which is that spaces were not even allowed after the article name. While it is a minor inconvenience, when typing the syntax for interwiki links, it just makes things harder to read. If one were to use enter space after the article name + signs would be added to the URL, which would also result in an invalid link. The fact that the plugin did not work as expected really put a damper on my first experience.

When I got fed up with the issues, I asked the developers if they could modify it for me or tell me how to fix the problems.

After that a bit of trial and error, which involved my testing the modifications, the plugin finally works as I expect it to, and perhaps better. Instead of manually prefixes, I can add the prefixes via plugin configuration. If had to edit PHP files, that would mean that there would be more than the usual that would need to be transferred between my two copies of Habari. Also no matter whether there are spaces or not, everything after a pipe is made the link text, instead of the article name. Now, I can be sure that all links work correctly with even less modification than with Relative Replace alone, especially with the help of the CSS print rules that displays link addresses that my custom theme has.

Although the plugin works quite well now, it still does have its problems. Out of everything I said I had troubles with, only one of those issues exists now, which is the fact that article names cannot contain spaces. As I said earlier, however, that is understandable due to the fact that there are prefixes for sites that do not work like MediaWiki.

While the interwiki plugin is quite useful, it was not always that way. Its problems ranged from being unable to specify link text to not supporting spaces at all. The fixes, on the other hand, which made the only remaining issue be the understandable lack of support for spaces in article names, makes this one of the best plugins to use, if one wants to easily migrate between two servers that use Habari.

What do you think of the Habari Interwiki plugin? Does it sound as useful as the MediaWiki feature? Feel free to comment.

Use an app on your phone (e.g. Scan for Android) to capture the image above. If successful, you should be taken to the web version of this article.

Copyright © 2015 Bryce Campbell. All Rights Reserved.