Mediawiki Tag Cloud and Google Suggest extension

Enterprise 2.0, MIKE2.0, Mediawiki, Web 2.0 Add comments

It’s here, finally! A Mediawiki extension that combines a tag cloud and Google Suggest like features to categories. It’s called SelectCategoryTagCloud and version 1.0 is available on http://www.mediawiki.org/wiki/Extension:SelectCategoryTagCloud.

Let me explain how and why we did this. A couple of weeks ago Jeremy wrote about how taxonomies and folksonomies are complimentary. In a simplified view of Mediawiki and Enterprise 2.0, categories are as close to a taxonomy as you can get. You can pre-define categories, nest them to create a hierarchy or automatically include them in templates that you force on certain pages (and therefore the page itself becomes a member of the category). However, categories also allow users to create horizontal or lateral views on content that is otherwise stored in a hierarchical or sequential manner. In wikis you create a link from a top page or home page to a sub page to a sub page and so on. You can then link from one sub page to another one, but if you want to see what pages deal with the same topic, you have to navigate through them one by one (either hierarchically or in sequence). Categories allow you to group pages that share a common topic into categories by simply ‘tagging’ the page with a category name. Here is a screenshot of an article with 4 categories applied to it:

SCTC Article with categories

If you want to see all pages in that category, you just need to click on the category name and Mediawiki displays all pages that are part of the category. The following screenshot show all pages in the category MIKE2 Activities:

2 SCTC Articles in category

A couple of extensions to Mediawiki exist that have attempted to solve the problem of suggesting categories to users, visualising what categories are popular and applying the style of Web 2.0 applications to categories. But none of them have achieved to provide the usability and simplicity of applying tags to bookmarks as Deli.cio.us and Digg have done.

My first step was to review existing extensions to see how much code reuse is possible. As a professor of mine at university used to tell me, copying code gets you expelled from school, but awards in the corporate world ;) . I found two extensions that were particularly useful (SelectCategory and WikiCategoryTagCloud). Credits to the developers of these extensions, because their code was to become the basis of my new extension which I named ‘SelectCategoryTagCloud’ in their honor.

The first step was to refactor the Wiki Tag cloud to be displayed on the edit page (and then further on the upload file page) of a Mediawiki article. Users are now able to see what categories are popular on the site and what categories are already assigned to the article. Take note of the simple visual marki-up of the existing categories.

3 SCTC Edit mode with tag cloud

The second step was to extend the functionality by adding an input box that would list all categories that are already assigned to the article. So instead of having to type the category command [[Category:CategoryName]] into the regular edit field or having to hunt down where the original user had put the command, users now have one single place where all categories are managed. Users can click on any of the categories in the tag cloud which adds it to the list of categories. Clicking on a category that already exists in the list removes it.

Finally, I needed to solve the problem that a tag cloud can only display so many categories as feasible to show on screen. Wikipedia has something like 150,000 categories, can you imagine how their category tag cloud would look like?! In my extension the number of displayed categories can be limited by setting a minimum count number for articles that are part of the category.

But how about all the other categories that don’t fit into the tag cloud but which we still want to encourage the users to reuse?!! So I added a category suggestion feature, similar to Google Suggest. When the user starts typing the initial characters of existing categories, the extension will display suggestions of existing categories right below the category input box. This not only encourages reuse of existing categories, but also reduces the amount of categories with similar names and typos. Check out this screenshot to see suggestions on the initial characters ‘Bu’:

4 SCTC Edit mode with suggest

The user is presented with 3 suggestions (Business Activity Monitoring, Business Intelligence Offering Group, Business Solution Offerings) and can select any of them with a simple mouse click. And because it’s all AJAX based, the lookup and suggest feature is kicked off in the background and doesn’t interfere with the user’s typing.

So what’s the next steps? Well, this is a first stab at applying some of the Web 2.0 features like tag clouds and suggestion to Wikis. Next I would like to apply a more formal approach to social bookmarks to complete the circle of taxonomies and folksonomies. Specifically, I will work on how to apply categories created in Mediawiki to Scuttle, an open source bookmarking software. This great software hasn’t really received any development support over the last year or so, but we have been using it internally and we believe that this will be another piece in our work to glue Web 2.0 technologies together to provide a solid, open source Enterprise 2.0 offering for collaboration.

  • Share/Bookmark

20 Responses to “Mediawiki Tag Cloud and Google Suggest extension”

  1. Information Development » How Web 2.0 and Small Worlds Theory may shape data modelling Says:

    [...] to bring together collaborative forms of communications and link it to the formal network. Both Andi Rindler and Jeremy Thomas have discussed some work we are doing in their area on the MIKE2.0 project on [...]

  2. DBrckll Says:

    Excellent work. Quick question – does this work with a WYSIWYG editor for Mediawiki such as FCKeditor?

  3. arindler Says:

    The extension is non-intrusive, meaning that the actual content stored in the mediawiki database is 100% wikitext compliant. The extension strips out occurrences of [[Category:xxxxxx]] and puts them into the input box. And on save, it appends them on the bottom of the wiki page. So if you were gonna remove the extension, you would see no difference to the original behavior.

    This means that as long as the editor complies with the proper wikitext behavior, this extension shouldn’t interfere. The extension hooks into the user interface on the edit page, right below the Copyright notice. So it should just show up together with whatever WYSIWYG editor you use, as long as they don’t hijack the whole page but also only use the user interface hook.

    FCKeditor doesn’t comply to wikitext, but uses pure HTML. We have had tons of problems with it and once you start using it, it’s very costly to move back to regular wikitext. I don’t recommend using it. But if you have to, I think it would work together with SelectCategoryTagCloud because there is no reason why it wouldn’t strip out and add the categories the same way as with wikitext. Give it a shot…

  4. Zap Sharon Says:

    Is there a public wiki you can point me to that is using this tagging? In your screen grabs I can see the editing view, but not what the user would see on screen.

  5. arindler Says:

    This is in production at http://mike2.openmethodology.org

  6. Christian Boltz Says:

    Did someone test the Tag Cloud with the editor from http://mediawiki.fckeditor.net/ ?
    Yes, this is FCKeditor – but it creates pure wikitext.

  7. Matt Says:

    What about the ability to search by these category/tag names? One problem I’m having with adoption is that it’s difficult to find content. For example, if I forget how to request vacation, do I search for ‘vacation’ or ‘leave time’? I was thinking that tagging would help, but Categories do not lend themselves to this kind of architecture, in my experience…

  8. arindler Says:

    Re FCKEditor, as you can see from the comment above, we ran into so many problems, so we just had to remove it before we got to test them together. It would be great to see them working together, but no, I haven’t tested it. Technically I don’t see an issue.

    Re searching categories, every Mediawiki instance has a built-in search feature available as a special page (e.g. http://mike2.openmethodology.org/index.php/Special:Search). There is a checkbox to restrict search or include categories. It’s a simple boolean search. We have found this to be a great feature, but not very accessible to the user (most users wouldn’t bother to find this out themselves). We have lately installed Google Custom Search on the front page to make it clear to users, that Search is a core feature that we need to offer. There is no syntax to exclusively search by category, but if you add the term “category” in your search, it is usually pretty good about including category pages. Try it out on http://mike2.openmethodology.org/index.php/Main_Page.
    You might also want to take a look at the Category Tree extension (http://www.mediawiki.org/wiki/Extension:CategoryTree) which gives your users a more hierarchical view of the categories. So if you had your “Vacation” category, inside a “HR” category inside a “Corporate” category, your users could find all articles related to vacation by browsing to it top-down.
    Categories are not the same as tags and you will run into issues as described by you. This extension is intended to make categories as easy to use as tags, but not necessary to replace them. Good luck!

  9. Christian Boltz Says:

    I tested myself with FCKeditor (http://mediawiki.fckeditor.net/), and the results are very good – both FCKeditor and your Tag Cloud work.

    Only exception: The categories the article already has are displayed in the FCKeditor. The tag cloud looks like the article is not in any category. (This also means: to remove a category, you have to remove it in FCKeditor.)

    The only important thing is the include order in LocalSettings.php – first include SelectCategoryTagCloud, then FCKeditor. If you do it the other way round, removing categories won’t work.

    Some suggestions for the Tag Cloud extension (I downloaded SelectCategoryTagCloud_v1.1.zip):

    - SelectCategoryTagCloudSuggest.php has an additional “}” in the last line, which causes a PHP syntax error. Simply remove this “}”.

    - SelectCategoryTagCloudSuggest.php should work case-insensitive. It’s annoying that I have to type an uppercase letter to find a category.

    - regarding configuration: Please avoid the need to edit the extension’s PHP files. Instead, include a file in the wiki main directory which holds the database details (and maybe also the Tag Cloud configuration)
    BTW: I prefer to symlink extensions, which is impossible when they have to be edited.

    That said: Thanks for your great extension!

  10. arindler Says:

    Christian,
    I released version 1.2 to include your feedback and some other bugfixes. However, I still don’t know how to solve the configuration issue. See Stefan’s comments at http://www.mediawiki.org/wiki/Extension_talk:SelectCategoryTagCloud#Errors

  11. Christian Boltz Says:

    I just upgraded to version 1.2 (using diff and patch, that’s easier than re-entering the database settings ;-)

    Thanks for the bug fixes and the case insensitive search!

  12. Bernhard Krabina Says:

    Hi,
    I’m using SemanticMediaWiki with the Semantic Forms Extension: http://www.mediawiki.org/wiki/Extension:Semantic_Forms

    Have you ever tried to combine your extension with Semantic Forms? It would be a great enhancement…

    regards,
    Bernhard

  13. Daniel Says:

    Hi,
    I’m using this extension and I love it! It’s the perfect complement for Wikipedia.

    However, I’d like to ask you a question. I found this other extension
    http://www.mediawiki.org/wiki/Extension:TagAsCategory
    that let you add categories to a page without having to edit the page, I wonder if you extension can be modified so it also works this way.

    Thanks, and don’t hesitate to contact me by mail.

    Best regards,

    Daniel

  14. arindler Says:

    Daniel, thanks for the feedback. The plan for SelectCategoryTagCloud is to add guided indexing to the existing tag cloud and typeahead functionality. I can see how the framework could be moved from the edit page to the ajax based approach on the article page. However, A) I am not sure if this would be as visually appealing because the tag cloud is quite large. And then the additional tabs would need to get in there as well. B)I honestly just don’t have the time right now to do this, but would welcome any help. I might take a look into it, but if you would be willing to take a stab at it that would be great.
    Thanks,
    Andi

  15. Jan Says:

    How do I get the tagcloud to display on the wiki’s main page, or for that matter on each page I want to display?

    Thanks

  16. arindler Says:

    This extension is only to help assignment of categories when editing an article. I assume you would want something like http://www.mediawiki.org/wiki/Extension:WikiCategoryTagCloud.

    Cheers

  17. Luke Says:

    Hi,
    Wondering if you might be able to help. Your extension is exactly what I am looking for but does not seem to be working as expected…? There are no categories displayed under ‘Popular Categories’ tab and ‘Category Hierarchy’ tab says ‘Coming soon…’.

    I am assuming that tabs should be dynamically populated with existing categories for me to choose from?

    Feel free to email direct, any help appreciated. Thanks!

  18. Raul Says:

    Hi,

    I am having exactly the same problem. Did you get a response?

    Thanks in advance

  19. arindler Says:

    Yes, the tag cloud is automatically populated with existing categories. You can specify the criteria (e.g. minimum number of articles in a category before the category shows up in the cloud) in the .body file. It’s all working on http://mike2.openmethodology.org. I did get a message the other day on this topic as well. Please also check here: http://www.mediawiki.org/wiki/User_talk:Lindele
    -Andi

  20. werutzb Says:

    Hi!

    I want to make better my SQL experience.
    I red that many SQL resources and want to
    read more about SQL for my occupation as mysql database manager.

    What can you recommend?

    Thanks,
    Werutz

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in