Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
public:dokuwiki_goes_mobile [2010/04/25 15:57] – created Nico | public:dokuwiki_goes_mobile [2015/03/12 21:24] (current) – no more dirty hack :) Nico | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | **WARNING**: | ||
+ | |||
====== Making dokuwiki handle mobile devices ====== | ====== Making dokuwiki handle mobile devices ====== | ||
===== Install some mobile template ===== | ===== Install some mobile template ===== | ||
Line 6: | Line 8: | ||
===== Fix dokuwiki ===== | ===== Fix dokuwiki ===== | ||
The main trick here is that dokuwiki uses a special function, ismobiledevice() to set a global environment variable called " | The main trick here is that dokuwiki uses a special function, ismobiledevice() to set a global environment variable called " | ||
- | ==== doku.php ==== | ||
- | Swap the 2 following include lines to load common.php before init.php: | ||
- | < | ||
- | require_once(DOKU_INC.' | ||
- | require_once(DOKU_INC.' | ||
- | </ | ||
==== inc/ | ==== inc/ | ||
Add the following somewhere before the template definition stuff: | Add the following somewhere before the template definition stuff: | ||
< | < | ||
+ | require_once(DOKU_INC.' | ||
if (clientismobile()) | if (clientismobile()) | ||
$conf[' | $conf[' | ||
</ | </ | ||
- | ==== lib/ | + | |
- | these files don't call common.php, so let's add it (before init.php): | + | Of course, if you installed [[http://www.dokuwiki.org/ |
< | < | ||
- | require_once(DOKU_INC.'inc/ | + | $conf['template'] = 'minimal_mobile'; |
- | require_once(DOKU_INC.'inc/ | + | |
</ | </ |