1 == Brief Example of Creating Your Own WikiTheme ==
3 To create or modify one of the existing themes:
4 * Make a copy of one of the themes.
5 * Look through the default theme, and for any of those templates you
6 want to modify, duplicate them in your new theme folder with the
7 same directory structure and modify them there instead of the
9 * Fix the name in themeinfo.php:
10 $WikiTheme = new WikiTheme('NewName');
11 * or if you have to override some default WikiTheme methods
12 class WikiTheme_NewName extends WikiTheme;
14 $WikiTheme = new WikiTheme_NewName('NewName');
18 If you base your theme on the default theme instead of one of the
19 others, you can safely delete any files you DID NOT modify from the
20 original (so long as you keep the default theme!).
22 Review the themeinfo.php for any necessary changes, and add the name
23 of your theme to index.php.
24 define('THEME','NewName');
26 == Template Structure ==
28 Templates currently must use the .tmpl extension (simple PHP parsed files).
29 Other file extensions are reserved for future use (i.e. .tpl for Smarty or
30 .html for our old template expansion.)
32 Only one template is called, ususally the "html.tmpl" template,
33 which includes all other templates then.
35 WikiTheme templates are regular xhtml, but the php parts within "<?php" and "?>"
36 are treated especially by phpwiki. HTML entities within the php parts
37 should be created by our HtmlElement methods, which create well-formed
39 Pure HTML entities, e.g. <?php echo "<br>" ?> will be escaped to <br>.
41 You can easily embed other templates by your own, e.g. <?php echo Template('body') ?>
44 * by the master action (html and htmldump), which include most other
45 plugins in a hierarchical manner,
46 * by certain actions (editpage) or plugins (e.g. info, userprefs,
48 * by certain pagetypes (e.g. wikiblog, comment, wikiforum)
50 To include templates from other themes use this syntax:
51 <?php echo Template('default/search') ?>
52 includes the search template from the default theme.
55 When you write your own templates or change existing ones, you might
56 easily destroy XHTML validity of the generated pages. By using
57 the various HTML() methods within a plugin's php code it is guaranteed
58 to produce validating XHTML, by using custom templates not.
61 [[PhpWikiDocumentation]]