WARNING: This hack does not work anymore, but you can now handle mobile skins in a much proper way through the loadskin plugin.

Making dokuwiki handle mobile devices

Install some mobile template

Here are some mobile template you can download:

Fix dokuwiki

The main trick here is that dokuwiki uses a special function, ismobiledevice() to set a global environment variable called “ismobile”. This function is called in inc/common.php; unfortunatly, the templating stuff is handled by inc/init.php, which is called before. We need to fix it.

inc/init.php

Add the following somewhere before the template definition stuff:

require_once(DOKU_INC.'inc/common.php');
if (clientismobile())
    $conf['template'] = 'dokumobile';

Of course, if you installed minimal_mobile, the last line will be:

    $conf['template'] = 'minimal_mobile';