====== Loadskin Plugin ====== ---- plugin ---- description: Change the skin/template/theme; admins can select templates per page/namespace, or users can select a template for the whole wiki author : Anika Henke (previous author: Michael Klier) email : anika@selfthinker.org type : action admin helper lastupdate : 2017-01-15 compatible : Lemming, Anteater, Rincewind, Angua, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Hrun, Detritus, Elenor of Tsort, Frusterick Manners, Greebo, Hogfather, Igor, Jack Jackrum depends : conflicts : similar : tags : template, skin, theme downloadurl: https://github.com/selfthinker/dokuwiki-plugin-loadskin/tarball/master bugtracker : https://github.com/selfthinker/dokuwiki-plugin-loadskin/issues sourcerepo : https://github.com/selfthinker/dokuwiki-plugin-loadskin/ ---- ===== Download and Installation ===== Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. > **:!: Important :!:** > If your DokuWiki is older than Angua or if the templates you are using it with are not up-to-date((i.e. if a template's code contains the ''DOKU_TPL'' or ''DOKU_TPLINC'' constant)), you have to make the following small change to DokuWiki's source code. Otherwise you might get partially (or completely) blank pages. Remove (or comment) the following lines in ''/inc/init.php'': // DEPRECATED, use tpl_basedir() instead if(!defined('DOKU_TPL')) define('DOKU_TPL', DOKU_BASE.'lib/tpl/'.$conf['template'].'/'); // DEPRECATED, use tpl_incdir() instead if(!defined('DOKU_TPLINC')) define('DOKU_TPLINC', DOKU_INC.'lib/tpl/'.$conf['template'].'/'); Fixing templates is easy. Just replace every ''DOKU_TPLINC'' with ''tpl_incdir()'' and every ''DOKU_TPL'' with ''tpl_basedir()'' ([[github>c4766956646b53ab644ec6ddbd17d9cba07cf872|see their deprecation]]). ===== Usage ===== This plugin can be used in two ways: * Admins can specify different templates for different wiki pages or namespaces. * Or users can use a select box for the whole wiki. Although you can use both ways together, it is advisable to only use one method or the other. Because otherwise you need to decide((with the ''preferUserChoice'' config setting)) which choice is the preferred one. ==== Admin way: Specify templates per namespace/page ==== {{ :plugin:plugin_loadskin_admin.png?direct&200}} The plugin comes with an admin component you'll find in the admin menu. Use it to specify the templates to be used for different wiki pages or namespaces. Pages not covered by one of these rules will still use the template specified by the template variable in the admin interface. ==== User way: Select template for whole wiki ==== {{:plugin:plugin_loadskin_switcher.png?direct&100 }} Alternatively the plugin can let the user choose the template for the whole wiki through a template switcher. Your users will need to **allow cookies** for that (otherwise the template won't switch permanently). ===== Configuration ===== ^''automaticOutput'' | Automatically output the template switcher on every page (turn this off if you don't want to show the template switcher or want to put it somewhere else) | ^''excludeTemplates''| Exclude templates from template switcher (comma-separated list) | ^''mobileSwitch'' | Show mobile template switcher (with only 1 normal and 1 mobile template)? | ^''mobileTemplate'' | Mobile template (if showing mobile template switcher) | ^''preferUserChoice''| Prefer user's template choice over admin's choice (turn this off to let the admin's choice have the preference) | ^''inheritInTranslations''| Inherit template choice per namespace inside a language namespace (when using the [[plugin:translation|translation plugin]]) | ^''allowInAdmin'' | Allow template choice to persist in admin section ((By default the admin section would otherwise always show the one template you selected in the configuration manager. With this option enabled you can go to a page with a different template (or select one from the template switcher) and then go to the admin section and it will show in that template which means you can configure it.)) | The template switcher is automatically put before the wiki content. If you like to put it somewhere else (e.g. near the login button or into the sidebar), you need to switch ''automaticOutput'' and put the following code into your template to wherever you like to display it: loadHelper('loadskin', true); echo $loadskinHelper->showTemplateSwitcher(); ?> The styling which come with the plugin will suit most templates when it's automatically put before the wiki content. But some templates might need a little help with [[devel:css#user styles]]. ===== Cookies ===== This plugin doesn't set any new cookies, but uses the ''[[faq:cookies#doku_prefs|DOKU_PREFS]]'' cookie which the DokuWiki core already uses. If a user uses the template switcher, it sets ''loadskinTpl'' to the chosen template. It also sets ''loadskinOrig'' to the original template which would show if nothing had been chosen. ===== Changelog ===== A complete changelog is available [[https://github.com/selfthinker/dokuwiki-plugin-loadskin/commits/|here]]. {{rss>https://github.com/selfthinker/dokuwiki-plugin-loadskin/commits/master.atom date}} ===== Discussion ===== You can report any issues on the [[https://github.com/selfthinker/dokuwiki-plugin-loadskin/issues|issue tracker]] and discuss anything on the separate [[plugin:loadskin:discussion]] page.