plugin:templateconfhelper
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
plugin:templateconfhelper [2011-03-07 03:06] – sf | plugin:templateconfhelper [2018-05-15 19:37] – Aleksandr | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- plugin ---- | ---- plugin ---- | ||
- | description: | + | description: |
author | author | ||
email : sf@notomorrow.de | email : sf@notomorrow.de | ||
type : action helper | type : action helper | ||
- | lastupdate : 2011-03-05 | + | lastupdate : 2015-05-16 |
- | compatible : 2010-11-07 " | + | compatible : 2014-09-29 |
depends | depends | ||
conflicts | conflicts | ||
similar | similar | ||
tags : template farm | tags : template farm | ||
- | downloadurl: | + | |
+ | downloadurl: | ||
bugtracker : https:// | bugtracker : https:// | ||
sourcerepo : https:// | sourcerepo : https:// | ||
+ | donationurl: | ||
+ | |||
+ | screenshot_img: | ||
+ | |||
---- | ---- | ||
Line 23: | Line 28: | ||
:!: This is a beta release. The functions included or their use might be a security risk | :!: This is a beta release. The functions included or their use might be a security risk | ||
- | you can install the plugin using the [[plugin: | + | You can install the plugin using the [[plugin: |
+ | |||
+ | Or checkout the source on GitHub: | ||
- | or checkout the source on github: | ||
git clone git:// | git clone git:// | ||
- | ===== features | + | ===== Features |
* template inheritance, | * template inheritance, | ||
- | * template switcher action plugin, later version might include template tags or user-settings-page extension --[[# | + | * template switcher action plugin, later version might include template tags or user-settings-page extension -- [[# |
* template images via fetch.php -- [[# | * template images via fetch.php -- [[# | ||
* cascading template path, templates can be stored outside dokuwiki directory if you use [[devel: | * cascading template path, templates can be stored outside dokuwiki directory if you use [[devel: | ||
- | ===== examples | + | ===== Examples |
An example template making use of css iheritance could look like this: | An example template making use of css iheritance could look like this: | ||
{{ http:// | {{ http:// | ||
- | < | + | |
+ | < | ||
[stylesheets] | [stylesheets] | ||
layout.css | layout.css | ||
Line 66: | Line 73: | ||
</ | </ | ||
+ | ===== Templateaction ===== | ||
+ | Changes template based on users Selection via GET and saves it in the Session. | ||
+ | ==== Parameter ==== | ||
- | ===== templateaction ===== | + | * '' |
- | changes | + | |
- | ==== parameter | + | ==== Functions |
- | * $_GET[utpl] | + | |
- | ==== functions ==== | + | |
- | | + | * '' |
- | * save_session( $var, $false ) - save utpl to session | + | * '' |
- | * save_user( $var, $val ) - #DUMMY | + | * '' |
- | * tpl_switch( $tpl ) - change style after init.php has been run | + | * '' |
- | * tpl_loadconfig( $tpl ) - reload config for template, called on switch | + | |
- | ===== fetchaction | + | ===== Fetchaction |
- | uses FETCH_MEDIA_STATUS event to hook into fetch.php. This allows to have template files outside of webroot. | + | |
+ | Uses FETCH_MEDIA_STATUS event to hook into fetch.php. This allows to have template files outside of webroot. | ||
+ | |||
+ | ==== Parameter ==== | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
- | ==== parameter ==== | ||
- | * $_GET[mode] | ||
- | * $_GET[template /^[\w-]*$/ - template dir to search for the file | ||
a nginx rewrite rule to fix path used in templates | a nginx rewrite rule to fix path used in templates | ||
+ | |||
rewrite ^/ | rewrite ^/ | ||
+ | |||
or with nicer path | or with nicer path | ||
+ | |||
rewrite ^/ | rewrite ^/ | ||
- | ===== inheritance | + | ===== Inheritance |
+ | |||
+ | The custom '' | ||
- | The custom css.php and the functions in // | ||
* template, existing dokuwiki template setting possibly overwritten by template switch | * template, existing dokuwiki template setting possibly overwritten by template switch | ||
- | * default_tpl, | + | * '' |
- | * base_tpl, new config setting for fallback template | + | * '' |
- | For the main.php the default is hardcoded in dokuwiki.php. So for templates to overwrite the main.php they have to exist in the dokuwiki //lib/tpl/// directory. Fallback is always | + | For the '' |
- | ==== configuration | + | ==== Configuration |
- | The base_tpl can be configured using the DokuWiki configuration manager available in the admin menu. | + | |
- | ^ '' | + | The '' |
- | Cascade Path is an extension to the cascade config values | + | ^ '' |
- | The plugin has a hardcoded cascade path wich is used if the // | + | Cascade Path is an extension to the cascade config values |
- | $config_cascade['template_dir'] = array( | + | |
- | | + | |
- | ); | + | |
- | ==== example ==== | + | The plugin has a hardcoded cascade path wich is used if the '' |
- | Example cascade path for inc/ | + | <code php> |
- | $version | + | $config_cascade[' |
- | $farmdir | + | ' |
+ | ); | ||
+ | </ | ||
+ | |||
+ | ==== Example ==== | ||
+ | |||
+ | Example cascade path for '' | ||
+ | |||
+ | <code php> | ||
+ | $version | ||
+ | $farmdir | ||
+ | |||
+ | $config_cascade[' | ||
+ | ' | ||
+ | ' | ||
+ | #' | ||
+ | ); | ||
+ | </ | ||
- | $config_cascade[' | ||
- | ' | ||
- | ' | ||
- | #' | ||
- | ); | ||
{{ http:// | {{ http:// | ||
- | to allow animals to overwrite template php files a main.php like this can be used in the default_tpl or base_tpl in dokuwiki | + | |
+ | To allow animals to overwrite template php files a '' | ||
<file php main.php> | <file php main.php> | ||
- | | + | <?php |
- | tpl_include( ' | + | tpl_include( ' |
</ | </ | ||
- | ===== preload | + | ===== Preload |
- | This is a rather creative apporach to hook into css.php. The templateaction plugin class deffinition includes | + | This is a rather creative apporach to hook into '' |
- | If the template_path cascade config has not been set. Defaults are made up for a standard dokuwiki setup. | + | If the '' |
- | ===== helper | + | ===== Helper |
- | ==== confutils | + | ==== ConfUtils |
- | * getConfigPath( $type, $file ) - find file in cascade_config[$type] | + | |
- | ==== template | + | * '' |
- | * tpl_include( $file, $t=false ) - use getConfigPath to include file from cascade_config[' | + | |
+ | ==== Template | ||
+ | |||
+ | * '' | ||
* ... some undocumented and likely to change functions for use in templates | * ... some undocumented and likely to change functions for use in templates | ||
- | ==== css ==== | + | ==== CSS ==== |
- | include | + | |
+ | Include | ||
+ | |||
+ | ===== Changes ===== | ||
+ | |||
+ | {{rss> | ||
+ | |||
+ | ===== FAQ ===== | ||
- | ===== changes | + | ===== ToDo ===== |
- | {{rss> | + | |
- | ===== faq ===== | + | * Exclude or document template helper functions |
+ | * Add template switcher for user settings | ||
+ | * Publish some templates | ||
- | ===== todo ===== | + | ===== Discussion |
- | * exclude or document template helper functions | + | |
- | * add template switcher for user settings | + | |
- | * publish some templates | + | |
- | ===== discussion ===== | + | Let me know if you use this or not. I ll try to provide some of my templates that make use of this functions. |
- | * let me know if you use this or not. I ll try to provide some of my templates that make use of this functions. | + | |
plugin/templateconfhelper.txt · Last modified: 2018-06-06 00:22 by Klap-in