]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - doc/THEMES
wording
[SourceForge/phpwiki.git] / doc / THEMES
1 ! Brief Example of Creating Your Own Theme
2
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
8   originals.
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;
13   ...
14   $Theme = new Theme_NewName('NewName');
15
16
17 Note:
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!).
21
22 Review the themeinfo.php for any necessary changes, and add the name
23 of your theme to index.php.
24   define('THEME','NewName');
25
26 ! Template Structure
27
28 Only one template is called, ususally the "html.tmpl" template, 
29 which includes all other templates then.
30
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 
34 HTML objects. 
35 Pure HTML entities, e.g. <? echo "<br>" ?> will be escaped to &lt;br&gt;.
36
37 You can easily embed other templates by your own, e.g. <?= Template('body') ?>
38
39 Templates are used
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, 
43   addcomment, ...) or 
44 * by certain pagetypes (e.g. wikiblog, comment, wikiforum)
45
46 Warning!
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.
51
52 ----
53 PhpWikiDocumentation