]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - doc/THEMES
THEMES creation and structure
[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, the "html.tmpl" template, which includes 
29 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 PhpWikiDocumentation