]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - templates/README
Efficiency patch from Gary Benson <gary@inauspicious.org>: don't compute
[SourceForge/phpwiki.git] / templates / README
1 $Id: README,v 1.3 2000-11-08 16:19:01 ahollosi Exp $
2
3 PhpWiki distinguishes between four 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 editing references (default: editlinks.html)
13   This template is used when users edit references of a page
14   by clicking on the EditLinks link on the EditText page.
15
16 - template for plain messages from PhpWiki (default: message.html)
17   This template is used when displaying search results, or when
18   displaying error messages.
19
20   
21 The location of the template files is defined in lib/config.php
22 The specification is relative to the index.php script.
23
24 Template files are regular HTML files, which contain special
25 placeholders. Placeholders are surrounded by '###'.
26 You must not use '###' for other purposes.
27
28
29 Following placeholders are provided by PhpWiki:
30
31 ###SCRIPTURL###
32         This is the URL of the main PhpWiki script.
33         All URL's referring to the Wiki itself should use this placeholder.
34
35 ###PAGE###
36         The page title. Any special HTML characters are replaced by their
37         entities. Do not use this placeholder in links. Use ###PAGEURL###
38         instead.
39
40 ###CONTENT###
41         The actual page content. This is either the Wikipage itself,
42         the search result, or a message text.
43
44 ###ALLOWEDPROTOCOLS###
45         Protocols allowed for external links and references.
46         Default: http|https|mailto|ftp|news|gopher
47
48
49 Conditional placeholders:
50
51 Placeholders that test a condition and depending on it include/omit
52 certain HTML. These placeholders may be nested. The general syntax
53 looks like this:
54
55 Line by line:
56 ###IF xxx###
57         If condition 'xxx' is false, this line is omitted.
58 ###IF !xxx###
59         If condition 'xxx' is true, this line is omitted.
60 Block:
61 ###IF:xxx### .... ###ENDIF:xxx###
62         If condition 'xxx' is false, then everything between the start
63         and end placeholder is omitted.
64 ###IF:!xxx### .... ###ENDIF:!xxx###
65         If condition 'xxx' is true, then everything between the start
66         and end placeholder is omitted.
67
68 Conditions to test:
69
70 COPY    If page has a copy in the archive. Usually used to display/omit
71         the EditCopy link in the editpage template.
72
73 ADMIN   If the current user is an admin. Used in e.g. browse template
74         to display admin buttons at the top.
75
76 LOCK    If current page is locked and thus cannot be edited.
77
78 For examples see browse.html and editpage.html
79
80
81
82 The following placeholders are not available for the 'MESSAGE' template:
83
84 ###PAGEURL###
85         Page title encoded for use in URLs.
86
87 ###LASTMODIFIED###
88         Date when the page was last modified.
89
90 ###LASTAUTHOR###
91         Author of latest modification. Usually this is the hostname or
92         the IP address.
93
94 ###VERSION###
95         Revision number of the page.
96         Note: this is also used for detecting concurrent updates to a page.
97         See hidden input field in EDITPAGE template for how to use it.
98
99
100 Only for EditLinks:
101
102 ###1###, ###2###, ....
103         Placeholder for references. Up to NUM_LINKS placeholders will be
104         substituted. NUM_LINKS is defined in lib/config.php
105
106
107
108 Examples:
109
110 <A HREF="###SCRIPTURL###">the entry (default) page</A>
111 <A HREF="###SCRIPTURL###?###PAGEURL###">the current page</A>
112 <A HREF="###SCRIPTURL###?FindPage">the FindPage page</A>
113 <head><title>PhpWiki Page: ###PAGE###</title></head>
114
115 See the default templates for more examples.