1 ! Brief Example of Creating Your Own Theme
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 $Theme = new Theme('NewName');
11 * or if you have to override some default Theme methods
12 class Theme_NewName extends Theme;
14 $Theme = new Theme_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');
28 Only one template is called, ususally the "html.tmpl" template,
29 which includes all other templates then.
31 Theme templates are regular xhtml, but the php parts within "<?" and "?>"
32 are treated especially by phpwiki. HTML entities within the php parts
33 should be created by our HtmlElement methods, which create well-formed
35 Pure HTML entities, e.g. <? echo "<br>" ?> will be escaped to <br>.
37 You can easily embed other templates by your own, e.g. <?= Template('body') ?>
40 * by the master action (html and htmldump), which include most other
41 plugins in a hierarchical manner,
42 * by certain actions (editpage) or plugins (e.g. info, userprefs,
44 * by certain pagetypes (e.g. wikiblog, comment, wikiforum)
47 When you write your own templates or change existing ones, you might
48 easily destroy XHTML validity of the generated pages. By using
49 the various HTML() methods within a plugin's php code it is guaranteed
50 to produce validating XHTML, by using custom templates not.