Strict Standards: Declaration of action_plugin_dlcount::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/dlcount/action.php on line 14

Strict Standards: Declaration of action_plugin_indexmenu::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/indexmenu/action.php on line 169

Strict Standards: Declaration of action_plugin_ipban::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/ipban/action.php on line 67

Strict Standards: Declaration of action_plugin_loglog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/loglog/action.php on line 82

Strict Standards: Declaration of action_plugin_navi::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/navi/action.php on line 46

Strict Standards: Declaration of action_plugin_uparrow::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/uparrow/action.php on line 69

Strict Standards: Declaration of action_plugin_userspagecreate::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/www/wiki/lib/plugins/userspagecreate/action.php on line 97

Strict Standards: Declaration of cache_instructions::retrieveCache() should be compatible with cache::retrieveCache($clean = true) in /home/www/wiki/inc/cache.php on line 289

Warning: Cannot modify header information - headers already sent by (output started at /home/www/wiki/lib/plugins/dlcount/action.php:14) in /home/www/wiki/inc/auth.php on line 312

Strict Standards: Only variables should be passed by reference in /home/www/wiki/doku.php on line 71

Warning: Cannot modify header information - headers already sent by (output started at /home/www/wiki/lib/plugins/dlcount/action.php:14) in /home/www/wiki/inc/actions.php on line 154
Templates [phpwcms-HowTo:wiki]

Strict Standards: Declaration of syntax_plugin_code::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, &$renderer, $data) in /home/www/wiki/lib/plugins/code/syntax.php on line 41

Strict Standards: Declaration of syntax_plugin_tip::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, &$renderer, $data) in /home/www/wiki/lib/plugins/tip/syntax.php on line 38

Templates

Have a look: Templates


System variables:

- $block['name']              // name:                      [Template name]
- $block['layout']            // layout:                    [layout-No.]

- $block['overwrite']         // settings:                  [default|Name of the PHP file in /template/inc_settings/template_default/]

- $block["css"]               // CSS file: Output into an array e.g. Array([0] => frontend.css [1] => nav_horiz_drop_down.css)
- $block['htmlhead']          // Content HTML head: <head> 

- $block['jslib']             // JS Library:                [Lib name]
- $block['jslibload']         // always load                [0|1] 
- $block['googleapi']         // use Google Ajax Lib        [0|1] 

- $block['frontendjs']        // load frontend.js (more for historical reasons) [0|1] 
- $block['jsonload']          // JS onload:                 [JS string]
- $block['feloginurl']        // FE LoginURL:               [url]

- $block['headertext']        // Content header:            [Content]
- $block['maintext']          // Content main:              [Content]
- $block['footertext']        // Content footer:            [Content]
- $block['lefttext']          // Content left:              [Content]
- $block['righttext']         // Content right:             [Content]

- $block['customblock_XXX']   // Content custom blocks XXX  [Content]

- $block['errortext']         // Content error:             [Content]


Mount a static file as a template in the "main:"

One way to use a file on the server as a template. Thus, the editing of the template via CMS is shifted to an FTP enabled editor.

Condition:/config/phpwcms/conf.inc.php

  • $phpwcms['allow_ext_init'] = 1;


In the directory template/inc_script/frontend_init/ we store the file template_inject01.php with the following content:

template_inject01.php

<?php
/*********************************************************************************************
* Backend Template main replace
* Replaces the the main template with the contents of the
* file "template/inc_script/template/main01.php".
* KH 07.01.2010
**********************************************************************************************/
 
// -------------------------------------------------------------------------------------------
// obligate check for phpwcms constants
  if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day."); }
// -------------------------------------------------------------------------------------------
 
if ($block['maintext'] == 'main01.php')
    $block['maintext'] = file_get_contents(PHPWCMS_TEMPLATE.'/inc_script/template/'.$block['maintext']);
 
?>


In this example the template file is called main01.php and is stored in the directory template/inc_script/template/.
The script looks in the template block “main:” whether the text main01.php is entered there. (And only this one).

In main01.php wird der Quelltext für “Haupt:” abgelegt ohne den öffnenden/schließenden PHP-Tag <?php .... ?>.

In main01.php the source code for “main:” is passed without the opening/closing PHP tag <?php .... ?>.

To speed up the query the presence of tags is not tested in the “main:” field.

This procedure should only be used in the development phase!!



Template: Embed the fields "header:", "footer:", "left:", "right:" in "main:"

Normally these fields aren't useful any more, because these fields with the layout variant rendering: “custom” will not be queried.
With a small replacer it is however possible to merge these input fields into the field “main:”.

We set the tags into the postions where the contents of these fields in the template “main:” will be merged.

  • {HEADERTEMP} = Content from “header:”
  • {FOOTERTEMP} = Content from “footer:”
  • {RIGHTTEMP} = Content from “right:”
  • {LEFTTEMP} = Content from “left:”

It may happen that some functions in the alternative fields will be processed by the system before being inserted into “main”. If so, please place the instructions directly into the “main:” field. Alternatively, the RT (SHOW_CONTENT :…..} could be used.

Condition:/config/phpwcms/conf.inc.php

  • $phpwcms['allow_ext_init'] = 1;


Please insert the file template_inject02.php with the following content into the folder template/inc_script/frontend_init/ :

template_inject02.php

<?php
/*********************************************************************************************
* Backend Template field replacer
* Replaces the placeholder {HEADERTEMP}, {FOOTERTEMP}, {LEFTTEMP}, {RIGHTTEMP} in "main"
* with the contents of the fields "header", "footer", "left", "right".
* KH 07.01.2010
**********************************************************************************************/
 
// -------------------------------------------------------------------------------------------
// obligate check for phpwcms constants
  if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day."); }
// -------------------------------------------------------------------------------------------
 
if (!empty($block['headertext']) )
    $block['maintext'] = str_replace('{HEADERTEMP}', $block['headertext'],$block['maintext']);
if (!empty($block['righttext']))
    $block['maintext'] = str_replace('{RIGHTTEMP}' , $block['righttext'], $block['maintext']);
if (!empty($block['footertext']))
    $block['maintext'] = str_replace('{FOOTERTEMP}', $block['footertext'],$block['maintext']);
if (!empty($block['lefttext']))
    $block['maintext'] = str_replace('{LEFTTEMP}'  , $block['lefttext'],  $block['maintext']);
 
?>


The self-defined “custom” blocks are addressed with (e.g. block name “BOX01” in page layout → blocks → custom:)

$block['customblock_BOX01']

To speed up the query the presence of tags is not tested in the “main:” field. It is your responsibility to use only tags, although the corresponding content is available in alternative fields.


Both methods can be combined.

english/technics/system-variables/templates.txt · Last modified: 2011/11/24 11:11 by Knut Heermann (flip-flop)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0

Strict Standards: Only variables should be passed by reference in /home/www/wiki/doku.php on line 79