plugin:templateconfhelper
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
plugin:templateconfhelper [2011-03-06 15:53] – created 85.181.35.174 | plugin:templateconfhelper [2018-06-06 00:22] (current) – Klap-in | ||
---|---|---|---|
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: | + | |
- | bugtracker : http:// | + | downloadurl: |
- | sourcerepo : http:// | + | bugtracker : https:// |
- | donationurl: | + | sourcerepo : https:// |
+ | donationurl: | ||
+ | |||
+ | screenshot_img: | ||
---- | ---- | ||
===== Installation ===== | ===== Installation ===== | ||
- | :!: This plugin helps developing and managing templates. It does not add any functioanlity | + | :!: This plugin helps developing and managing templates. It does not add any functionality |
:!: 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:plugin|Plugin | + | Search and install the plugin using the [[plugin:extension|Extension |
- | | + | |
- | 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 --[[templateaction]] | + | * template switcher action plugin, later version might include template tags or user-settings-page extension -- [[#templateaction]] |
- | * template images via fetch.php -- [[fetchaction]] | + | * template images via fetch.php -- [[#fetchaction]] |
* 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 67: | Line 75: | ||
</ | </ | ||
+ | ===== 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 patch | + | |
+ | or with nicer path | ||
rewrite ^/ | rewrite ^/ | ||
- | ===== inheritance | + | ===== Inheritance |
- | The custom css.php and the functions in // | + | |
- | * template, dokuwiki template setting possibly overwritten by template switch | + | |
- | * default_tpl, | + | |
- | * base_tpl, fallback template | + | |
- | For the main.php the default is hardcoded | + | The custom '' |
- | Cascade Path is an extension to the cascade config values in dokuwiki | + | * template, existing |
+ | * '' | ||
+ | * '' | ||
- | Example cascade path for inc/ | + | For the '' |
- | $version | + | |
- | $farmdir | + | ==== Configuration ==== |
+ | |||
+ | The '' | ||
+ | |||
+ | ^ '' | ||
+ | |||
+ | Cascade Path is an extension to the cascade config values in dokuwiki init. It can be set in '' | ||
+ | |||
+ | The plugin has a hardcoded cascade path wich is used if the '' | ||
+ | |||
+ | <code php> | ||
+ | $config_cascade[' | ||
+ | ' | ||
+ | ); | ||
+ | </ | ||
+ | |||
+ | ==== 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 ===== | ===== FAQ ===== | ||
- | ===== Todo ===== | + | ===== ToDo ===== |
- | * exclude | + | |
- | * add template switcher for user settings | + | * Exclude |
- | * publish | + | * Add template switcher for user settings |
+ | * Publish | ||
===== Discussion ===== | ===== 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. | ||
plugin/templateconfhelper.1299423195.txt.gz · Last modified: 2011-03-06 15:53 by 85.181.35.174