Dokuwiki modifications and improvements

If I feel a modification to tweak the look and feel or functionality is worth documenting it will end up here.

Have you ever tried to link to a well known site, e.g. Twitter, Youtube, Facebook or whatever and wanted to add the sites icon to that link? With dokuwiki, this would end in quite an ugly look: you'll have to insert the icon as an image what inevitably tends to end up with a badly aligned icon. Additionally, your link will have the world-icon for external links attached by default. Not really satisfying.

The solution is to use interwiki links. When I came across this feature I immediately thought this would be a cool way to link to my Twitter profile in a way that looks quite good. You can use interwiki links to pep up any sort of links - all you have to do is edit the config and upload a suitable icon for the link. But that makes only sense for a rather small amount of links, probably only the most important ones you want to make stand out.

So here's how the dokuwiki syntax for the special Twitter interwiki-link looks like:

[[twitter>twitter|@twitter]]

and that's the result:

@twitter with a link to https://twitter.com/twitter

Before you can use the syntax above we'll have to do a few customizations.

You will find all the fine information at https://www.dokuwiki.org/interwiki - I'll just compress this information here:

  1. create or modify interwiki.local.conf
  2. upload your icon(s) to the right place
  3. use your new interwiki-link on any page within your dokuwiki
  4. make sure there are no caching issues

In more detail:

  • To prevent losing your added InterWiki shortcuts after an upgrade, you should add new ones to interwiki.local.conf (create this file in your conf directory if it doesn't exist already)
interwiki.local.conf
twitter   https://twitter.com/
  • Interwiki icons should have a size of 16×16 pixels, be in PNG or GIF format, and be named after the shortcut. So your next step is to fetch a icon from somewhere or create your own.
  • Then copy your icon (named twitter.png in this case) to the following directory: <dokuwiki_root>/lib/images/interwiki
  • If your icon does not show up after adding your first interwiki link this usually has to do with caching. It may actually be enough to invalidate the CSS caching by re-saving in the config manager ('re-saving' is pressing the save button of config manager without need to changing any config setting). If this doesn't work visit the original dokuwiki page to investigate further.

Mediamanager

I want any access to the mediamanager limited to registered users.

To achieve that goal I had to change to following lines for the Arctic Template:

arctic/main.php
// snip
// move to line 233
// tpl_button('media');
 
if(isset($INFO['userinfo'])){ tpl_button('media'); }
 
// move to line 238
// tpl_actionlink('media');
 
if(isset($INFO['userinfo'])){ tpl_actionlink('media'); }
 
// snap

See: https://www.dokuwiki.org/media_manager#problems

wiki/modifications.txt · Last modified: 2015-10 by tb
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready