Auto tagging

Why auto tagging is usefull?

Tags are very usefull to categorize your pages. You can use them in the powerful ListPages module of wikidot. And you should use them since there are still some shortcomings in the listPages module (see below).

However in wikidot it is only possible to set tags when you, the author, see the page in 'view' mode, so not in 'edit' mode. This causes the annoying fact that you need to submit your valuable data (tags) in two steps.

I created some tools that can help you with this:

  1. A auto tagging script that creates a new page and adds in one go a tag "_x", where x would be the first character of your title. In this way you can make selections on the first character of your title.
  2. A small script that enables you to use all the words from a certain field from your data form and converts them to tag word in one go.

Here are a couple of reasons why you need tags in order to filter.

The Listpages module is a very powerfull tool for wikidot. However there are many things that can not be done using this module. For example:

  • You can not select a certain page. This could be very handy for example to include a certain piece of content from another page. If you are familiar with live _templates and content blocks then the next sniplet will illustrate my drift:
[[Module Listpage page="books:lord-of-the-rings"]]
%%content{2}%%
[[/module]]
  • You can not select pages of which the title starts with a certain character. The next sniplet will illustrate my drift:
[[Module Listpage category="books" title{1}="L"]]
%%title_linked%%
[[/module]]
  • You can not select on the content of data-field (yet). The next sniplet will illustrate my drift:
[[Module Listpage category="books" form_data{booktitle}="*Lord*"]]
%%form_data{booktitle}%%
[[/module]]

So…use tags!

The ListPages module however does have the possibility to select on tags. The bad thing about this is that you need to set tags to your pages, which can be a drag. So inspired by the question posed on the forum I made the following:
A kind of new page module that can interpret your title and accordingly set some tags automatically. For example:

Title Autotag Module Atribute
Lord of the rings. "_L" first
Lord of the rings. "lord of rings the" all
Lord of the rings. "lord-of-the-rings" unix

To make this work I use the possibilities of the API and made some external PHP-scripts. So how will you get this to work on your page/site? Simple!

Insert the following code in your page. This creates a new-page-button.
The URL in this codeblock is split over several lines to make it readable, however make sure that there are no linebreaks when you use this code, look at collapsible text under block for original code.

[[iframe http://artizen.be/api/form-create-starting-letter-page.php?
sitename=YOUR_SITE_NAME&
category=YOUR_CATEGORY&
parent=PARENT_FULL_NAME&
button=BUTTON_TEXT 
frameborder="0" scrolling="no" width="300px" height="40px"]]

Adjust the words in capitals to your own case :
YOUR_SiTE_NAME = your sitename (http:/ /SITE-NAME.wikidot.com)
YOUR_CATEGORY = the category where the page should be created.
YOUR_PARENT_FULL_NAME = if you want a parent page.
BUTTON_TEXT = text you wish on your button.
METHODE = first/all/unix not implemented yet

You can also adjust width and height of the Iframe.
TWO REQUIRED THINGS

  • I need to have permission to write pages on your site.
  • You need to set API-access in your admin:manage to "enabled"

In action:

Here is a list of titles starting with "L".

Lost in space tags: _l
Lord of the rings tags: _l

Here is a list of all the pages.

Lunar Landing tags:
Ben Hur tags:
Test tags:
The war of the worlds tags: _t
The thing tags: _t
Lost in space tags: _l
Lord of the rings tags: _l

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License