From: <var...@us...> - 2021-11-19 18:28:42
|
Revision: 10662 http://sourceforge.net/p/phpwiki/code/10662 Author: vargenau Date: 2021-11-19 18:28:39 +0000 (Fri, 19 Nov 2021) Log Message: ----------- Update doc/THEMES Modified Paths: -------------- trunk/doc/THEMES Modified: trunk/doc/THEMES =================================================================== --- trunk/doc/THEMES 2021-11-19 18:01:13 UTC (rev 10661) +++ trunk/doc/THEMES 2021-11-19 18:28:39 UTC (rev 10662) @@ -6,39 +6,42 @@ want to modify, duplicate them in your new theme folder with the same directory structure and modify them there instead of the originals. -* Fix the name in themeinfo.php: +* Fix the name in ##themeinfo.php##: + {{{ $WikiTheme = new WikiTheme('NewName'); -* or if you have to override some default WikiTheme methods + }}} +* or if you have to override some default ~WikiTheme methods + {{{ class WikiTheme_NewName extends WikiTheme; ... $WikiTheme = new WikiTheme_NewName('NewName'); + }}} - -Note: +Note: \\ If you base your theme on the default theme instead of one of the others, you can safely delete any files you DID NOT modify from the original (so long as you keep the default theme!). -Review the themeinfo.php for any necessary changes, and add the name -of your theme to index.php. +Review the ##themeinfo.php## for any necessary changes, and add the name +of your theme to ##index.php##. + {{{ define('THEME','NewName'); + }}} == Template Structure == -Templates currently must use the .tmpl extension (simple PHP parsed files). -Other file extensions are reserved for future use (i.e. .tpl for Smarty or -.html for our old template expansion.) +Templates must use the ##.tmpl## extension (simple PHP parsed files). -Only one template is called, usually the "html.tmpl" template, +Only one template is called, usually the ##html.tmpl## template, which includes all other templates then. -WikiTheme templates are regular xhtml, but the php parts within "<?php" and "?>" -are treated especially by phpwiki. HTML entities within the php parts -should be created by our HtmlElement methods, which create well-formed +~WikiTheme templates are regular HTML, but the PHP parts within "<?php" and "?>" +are treated especially by ~PhpWiki. HTML entities within the PHP parts +should be created by our ~HtmlElement methods, which create well-formed HTML objects. -Pure HTML entities, e.g. <?php echo "<br>" ?> will be escaped to <br>. +Pure HTML entities, e.g. {{{<?php echo "<br>" ?>}}} will be escaped to ##<br>##. -You can easily embed other templates by your own, e.g. <?php echo Template('body') ?> +You can easily embed other templates by your own, e.g. ##<?php echo Template('body') ?>## Templates are used * by the master action (html and htmldump), which include most other @@ -48,14 +51,20 @@ * by certain pagetypes (e.g. wikiblog, comment, wikiforum) To include templates from other themes use this syntax: + {{{ <?php echo Template('default/search') ?> + }}} includes the search template from the default theme. Warning! When you write your own templates or change existing ones, you might -easily destroy XHTML validity of the generated pages. By using -the various HTML() methods within a plugin's php code it is guaranteed -to produce validating XHTML, by using custom templates not. +easily destroy HTML validity of the generated pages. By using +the various HTML() methods within a plugin's PHP code it is guaranteed +to produce validating HTML, by using custom templates not. +== Theme switching == + +If you change the theme in your user preferences, you might need to run an upgrade to create the pages that are needed by the theme. For example, the wikilens theme needs the page ##LeftbarContent## (located in ##themes/wikilens/pgsrc/LeftbarContent##). + ---- [[PhpWikiDocumentation]] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |