]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/README
Moved from templates.
[SourceForge/phpwiki.git] / themes / default / templates / README
1 $Id: README,v 1.1 2002-01-17 20:57:41 dairiki Exp $
2
3 PhpWiki distinguishes between three different templates:
4
5 - template for browsing pages (default: browse.html)
6   This template is used when viewing Wiki pages.
7   
8 - template for editing pages (default: editpage.html)
9   This template is used when users edit a page by clicking on
10   the EditText link.
11
12 - template for plain messages from PhpWiki (default: message.html)
13   This template is used when displaying search results, or when
14   displaying error messages.
15
16   
17 The location of the template files is defined in lib/config.php
18 The specification is relative to the index.php script.
19
20
21 =========
22 Tue Sep 18 12:00:12 PDT 2001 Jeff Dairiki <dairiki@dairiki.org>
23
24 The rest of this file is currently obsolete, and should be ignored.
25 The template situation is in a state of flux, and will probably be
26 changed again very soon.  See lib/Template.php for more, but mostly
27 just "stay tuned" for details.
28
29 =========
30
31 Template files are regular HTML files, which contain special
32 placeholders. Placeholders are surrounded by '###'.
33 You must not use '###' for other purposes.
34
35
36 Following placeholders are provided by PhpWiki:
37
38 ###SCRIPTURL###
39         This is the URL of the main PhpWiki script.
40         All URL's referring to the Wiki itself should use this placeholder.
41
42 ###PAGE###
43         The page title. Any special HTML characters are replaced by their
44         entities. Do not use this placeholder in links. Use ###PAGEURL###
45         instead.
46
47 ###CONTENT###
48         The actual page content. This is either the Wikipage itself,
49         the search result, or a message text.
50
51 ###USERID###
52         The userid of the current users.  For non-authenticated users,
53         the userid is the host name or IP number of the user.
54
55 ###LOGO###
56         URL of the phpwiki logo image.
57
58 ###RCS_IDS###
59         The RCS ids of the php source files which contributed to the current
60         page.
61
62 ###BROWSE_PAGE###
63         The URL to use to browse the current page.
64
65 ###ACTION###
66         The leading part of the URL for performing an action on the current page.
67         Eg. <a href="###ACTION###edit">Edit this page</a>.
68
69 ###BROWSE### 
70         The leading part of the URL for browsing to another page.
71         Eg. <a href="###BROWSE###FindPage">Edit this page</a>.
72
73 ###BASE_URL###
74         The base URL for the current page.
75
76 Conditional placeholders:
77
78 Placeholders that test a condition and depending on it include/omit
79 certain HTML. These placeholders may be nested. The general syntax
80 looks like this:
81
82 Line by line:
83 ###IF xxx###
84         If condition 'xxx' is false, this line is omitted.
85 ###IF !xxx###
86         If condition 'xxx' is true, this line is omitted.
87 Block:
88 ###IF:xxx### .... ###ENDIF:xxx###
89         If condition 'xxx' is false, then everything between the start
90         and end placeholder is omitted.
91 ###IF:!xxx### .... ###ENDIF:!xxx###
92         If condition 'xxx' is true, then everything between the start
93         and end placeholder is omitted.
94
95 Conditions to test:
96
97 ADMIN   If the current user is an admin. Used in e.g. browse template
98         to display admin buttons at the top.
99
100 ANONYMOUS
101         If the current user is not authenticated.
102
103 COPY    If page has a copy in the archive. Usually used to display/omit
104         the EditCopy link in the editpage template.
105
106 LOCK    If current page is locked and thus cannot be edited.
107
108 MINOR_EDIT_CHECKBOX
109         If the current user is the same as the last editor of this
110         page, this will contain the complete HTML for a checkbox,
111         which, when checked will prevent a backup copy from being made.
112
113         If the current user is different than the last editor, 
114         MINOR_EDIT_CHECKBOX will be blank.
115
116 For examples see browse.html and editpage.html
117
118
119
120 The following placeholders are not available for the 'MESSAGE' template:
121
122 ###PAGEURL###
123         Page title encoded for use in URLs.
124
125 ###LASTMODIFIED###
126         Date when the page was last modified.
127
128 ###LASTAUTHOR###
129         Author of latest modification. Usually this is the hostname or
130         the IP address.
131
132 ###VERSION###
133         Revision number of the page.
134         Note: this is also used for detecting concurrent updates to a page.
135         See hidden input field in EDITPAGE template for how to use it.
136
137 ###HITS###
138         The hit count of the current page.
139
140 ###RELATEDPAGES###
141         The related pages list for the current page.
142
143 Examples:
144
145 <A HREF="###BROWSE###HomePage">the entry (default) page</A>
146 <A HREF="###BROWSE_PAGE###">the current page</A>
147 <A HREF="###BROWSE###FindPage">the FindPage page</A>
148 <head><title>PhpWiki Page: ###PAGE###</title></head>
149
150 See the default templates for more examples.