Archiv für Juni 2007

A clear election recommendation

29. Juni 2007

No you won’t get a recommendation whom to vote for the board of Trustees of the Wikimedia Foundation or an analysis of the candidates here – except that I don’t run for the board this time as I feel committed making my own wiki project a success first which wouldn’t be possible with a full free time job in the board.

However I still have a clear recommendation:

Give your favourite Wikimedia project your voice with your vote – If you like Wikimedia Commons most (and you meet the vote requirements there) please vote at Wikimedia Commons. If Wikisource is your pet project go and vote there. The same applies for Wikinews, Wikibooks, Wiktionary, Wikiversity, Wikiquote

I just don’t want to see again statements of people that globally say everything else than Wikipedia is a waste of time and who partly base these claims on the 2006 election statistics. Please proof them wrong this time. In 2006 I deliberately did vote in Wikimedia Commons and I will do so again this time and I hope a lot of other people will give their voice with their vote to their favourite Wikimedia project, too.

MediaWiki tricks 2 – Essential extensions

27. Juni 2007

Although MediaWiki is a feature rich wiki software there are still some important common features missing. Luckily you can add them via extensions to MediaWiki. So here a list of plugins that are very useful in any MediaWiki installation.

Newuserlog

In a usual MediaWiki installation you have no possibility to determine, when a particular user has registered an account. There is just the „Special:Userlist“ special page that lists all currently existing users alphabetically (with additional user rights such as bot, sysop and bureaucrat flag). So things like newbie welcome messages and quick reaction to certain vandal accounts are overly complicated if not even impossible. Luckily the Newuserlog extension solves this very nicely by adding a new user log feed into the central MediaWiki logs at „Special:Log“. You can even filter the log and access the new user log directly by accessing „Special:Log/newusers“. IMHO the new user log should be directly builtin into MediaWiki and not an extension.

Renameuser

As well it is not possible to rename a user in plain MediaWiki. Sooner or later in every wiki there will be users that bug you to rename them to a new user name because they want to keep their old contributions associated to them, their existing configuration, their probably very long „watchlist“ and other things. Or you will get some vandals with very inapropriate user names, you don’t want to see anylonger anywhere in your wiki. With the Renameuser extension you can add this often requested feature to your wiki. However don’t forget some small pitfalls: By default only people with „bureaucrat rights“ are able to rename a user and after renaming the user you still have to move the old user page(s) to the new name manually.

ConfirmEdit

Spammers like wikis. They insert their ads full of web links into wikis using robots so that you have quite a lot to do in case such a bot hits your wiki. Although MediaWiki flags every weblink with a „nofollow“ tag (which effectively avoids exploiting a wiki as a link farm for pushing a web site in search engines) dumb spammers probably need some further years to recognize that spamming MediaWiki is useless for them. In worst case you maybe want to close your wiki for guest contributions just because of spamming, which is odd. So the ConfirmEdit extension asks for solving a simple captcha in case a guest (person that does not have a user account) tries to add a new weblink to a wiki page (you can configure the exact behaviour within a broad range). This effectively reduces wiki spamming alot and thus avoids closing down your wiki for guests and of course ConfirmEdit is quite unobstrusive and doesn’t bug people on every edit.

CategoryTree

Browsing categories in MediaWiki isn’t very intuitive and one gets quickly lost in the category hierarchy because there is no tree view of categories. The CategoryTree extension solves this by adding a dynamic view of the wiki’s category structure as an expandable tree directly at category pages (and on a special page and embeddable via a custom tag in article pages), which makes browsing categories much faster and makes organizing and maintaining your category structure a lot easier.

ParserFunctions

When using templates with variables or in case you need some templates reacting more advanced to certain conditions you quickly will notice that templates are somewhat limited in MediaWiki. The ParserFunctions extension (see also the info page at mediawiki.org) provides programming like features such as „if“, „switch“, „for“, calculating („epxr“ function) and many more which are very useful when writing some flexible, advanced yet short templates for your wiki. Otherwise the desired functionality wouldn’t be possible or only using some very wired and complicated „wiki hacking“ with nested templates.

CharInsert

From time to time you need to enter special characters, especially for foreign words and names of persons, places and others but you miss these special characters on your keyboard. The CharInsert extension solves this on editing a page by providing a extra tool bar with a configurable list of special characters that can be inserted into the text field by clicking on the desired character. In order to make this list more compact and ordered there exists some additional JavaScript code that makes the special character tool bar switchable to the desired character set with a drop down list (the extra JavaScript code needs to be called from either „MediaWiki:Common.js“ or „MediaWiki:Monobook.js“ in order to work, see e.g. at Wikimedia Commons for the required call).

General tips

Beside looking in mediawiki.org for useful extensions it is always a good idea looking at the „Special:Version“ page of other MediaWiki installations like on Wikipedia in order to find useful and reliable working extensions. Another additional useful source of nice tools are also the „MediaWiki:Common.js“ and „MediaWiki:Monobook.js“ pages in Wikipedia if your are wanting some nice JavaScript Wikipedia helpers for your own wiki, too.

MediaWiki tricks 1 – Custom link colors

24. Juni 2007

This is the first post in an irregular series of nifty tricks that saved my day when using MediaWiki and which maybe are useful for you, too…

Sometimes you may want to color a wikilink (for example in order to indicate that two wikilinks are pointing to fundamental different kinds content) with something different than standard blue for existant pages (Monobook).

A minimal wiki code example for turning a wiki link green:

[[ARTICLE|<span style="color:green;">ARTICLE</span>]]

The trick is to do the coloring inside the alternative text and not outside the link brackets (thanks to Shardsofmetal for the hint). However there is a problem: In case ARTICLE does not exist, the link would be still green instead of red for indicating missing content. Using the „ifexist“ function of the parser functions extension this can be solved (splitted one-liner):

[[ARTICLE|{{#ifexist: ARTICLE
|<span style="color:green;">ARTICLE</span>
|ARTICLE}}]]

Now the link turns green in case ARTICLE exists and stays with the default red in case not.

Of course this is rather long winded and you probably want to shorten this with a template if you’re using this more than once. So the template code would be like that:

[[{{{1}}}|{{#ifexist: {{{1}}}
|<span style="color:green;">{{{1}}}</span>
|{{{1}}}}}]]

The wiki code using such a link does look with the template much shorter now:

{{TEMPLATENAME|ARTICLE}}

But now there is a new problem when using a template. You sometimes want to link with a different expression like COOL PAGE to ARTICLE. The solution for the template code is using an optional second variable:

[[{{{1}}}|{{#ifexist: {{{1}}}
|<span style="color:green;">{{{2|{{{1}}}}}}</span>
|{{{2|{{{1}}}}}}}}]]

Now you can call it both ways:

{{TEMPLATENAME|ARTICLE}}
{{TEMPLATENAME|ARTICLE|ALTERNATIVE LINK TEXT}}

Dislcaimer: Make spare use of it. To much stuff at once cocks up the „wow nice effect“. ;-)