**This is an old revision of the document!**
Table of Contents
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.
doku.php
Swap the 2 following include lines to load common.php before init.php:
require_once(DOKU_INC.'inc/common.php'); require_once(DOKU_INC.'inc/init.php');
inc/init.php
Add the following somewhere before the template definition stuff:
if (clientismobile()) $conf['template'] = 'dokumobile';
lib/exe/css.php, lib/exe/js.php
these files don't call common.php, so let's add it (before init.php):
require_once(DOKU_INC.'inc/common.php'); require_once(DOKU_INC.'inc/init.php');