Catch up on recent source changes.
[privoxy.git] / doc / webserver / user-manual / templates.html
1 <HTML
2 ><HEAD
3 ><TITLE
4 >Templates</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.64
8 "><LINK
9 REL="HOME"
10 TITLE="Privoxy User Manual"
11 HREF="index.html"><LINK
12 REL="PREVIOUS"
13 TITLE="The Filter File"
14 HREF="filter-file.html"><LINK
15 REL="NEXT"
16 TITLE="Contacting the Developers, Bug Reporting and Feature
17 Requests"
18 HREF="contact.html"><LINK
19 REL="STYLESHEET"
20 TYPE="text/css"
21 HREF="../p_doc.css"></HEAD
22 ><BODY
23 CLASS="SECT1"
24 BGCOLOR="#EEEEEE"
25 TEXT="#000000"
26 LINK="#0000FF"
27 VLINK="#840084"
28 ALINK="#0000FF"
29 ><DIV
30 CLASS="NAVHEADER"
31 ><TABLE
32 WIDTH="100%"
33 BORDER="0"
34 CELLPADDING="0"
35 CELLSPACING="0"
36 ><TR
37 ><TH
38 COLSPAN="3"
39 ALIGN="center"
40 >Privoxy User Manual</TH
41 ></TR
42 ><TR
43 ><TD
44 WIDTH="10%"
45 ALIGN="left"
46 VALIGN="bottom"
47 ><A
48 HREF="filter-file.html"
49 >Prev</A
50 ></TD
51 ><TD
52 WIDTH="80%"
53 ALIGN="center"
54 VALIGN="bottom"
55 ></TD
56 ><TD
57 WIDTH="10%"
58 ALIGN="right"
59 VALIGN="bottom"
60 ><A
61 HREF="contact.html"
62 >Next</A
63 ></TD
64 ></TR
65 ></TABLE
66 ><HR
67 ALIGN="LEFT"
68 WIDTH="100%"></DIV
69 ><DIV
70 CLASS="SECT1"
71 ><H1
72 CLASS="SECT1"
73 ><A
74 NAME="TEMPLATES"
75 >10. Templates</A
76 ></H1
77 ><P
78 > All <SPAN
79 CLASS="APPLICATION"
80 >Privoxy</SPAN
81 > built-in pages, i.e. error pages such as the 
82  <A
83 HREF="http://show-the-404-error.page"
84 TARGET="_top"
85 ><SPAN
86 CLASS="QUOTE"
87 >"404 - No Such Domain"</SPAN
88 >
89  error page</A
90 >, the <A
91 HREF="http://ads.bannerserver.example.com/nasty-ads/sponsor.html"
92 TARGET="_top"
93 ><SPAN
94 CLASS="QUOTE"
95 >"BLOCKED"</SPAN
96 >
97  page</A
98 >
99  and all pages of its <A
100 HREF="http://config.privoxy.org/"
101 TARGET="_top"
102 >web-based
103  user interface</A
104 >, are generated from <I
105 CLASS="EMPHASIS"
106 >templates</I
107 >. 
108  (<SPAN
109 CLASS="APPLICATION"
110 >Privoxy</SPAN
111 > must be running for the above links to work as
112  intended)</P
113 ><P
114 > These templates are stored in a subdirectory of the <A
115 HREF="config.html#CONFDIR"
116 >configuration
117  directory</A
118 > called <TT
119 CLASS="FILENAME"
120 >templates</TT
121 >. On unixish platforms,
122  this is typically
123  <A
124 HREF="file:///etc/privoxy/templates/"
125 TARGET="_top"
126 ><TT
127 CLASS="FILENAME"
128 >/etc/privoxy/templates/</TT
129 ></A
130 >.</P
131 ><P
132 > The templates are basically normal HTML files, but with place-holders (called symbols
133  or exports), which <SPAN
134 CLASS="APPLICATION"
135 >Privoxy</SPAN
136 > fills at run time. You can
137  edit the templates with a normal text editor, should you want to customize them.
138  (<I
139 CLASS="EMPHASIS"
140 >Not recommended for the casual user</I
141 >). Note that
142  just like in configuration files, lines starting with <TT
143 CLASS="LITERAL"
144 >#</TT
145 > are
146  ignored when the templates are filled in.</P
147 ><P
148 > The place-holders are of the form <TT
149 CLASS="LITERAL"
150 >@name@</TT
151 >, and you will
152  find a list of available symbols, which vary from template to template,
153  in the comments at the start of each file. Note that these comments are not
154  always accurate, and that it's probably best to look at the existing HTML
155  code to find out which symbols are supported and what they are filled in with.</P
156 ><P
157 > A special application of this substitution mechanism is to make whole
158  blocks of HTML code disappear when a specific symbol is set. We use this
159  for many purposes, one of them being to include the beta warning in all
160  our user interface (CGI) pages when <SPAN
161 CLASS="APPLICATION"
162 >Privoxy</SPAN
163 >
164  in in an alpha or beta development stage:</P
165 ><P
166 > <TABLE
167 BORDER="0"
168 BGCOLOR="#E0E0E0"
169 WIDTH="100%"
170 ><TR
171 ><TD
172 ><PRE
173 CLASS="SCREEN"
174 >&#60;!-- @if-unstable-start --&#62;
175
176   ... beta warning HTML code goes here ...
177
178 &#60;!-- if-unstable-end@ --&#62;</PRE
179 ></TD
180 ></TR
181 ></TABLE
182 ></P
183 ><P
184 > If the "unstable" symbol is set, everything in between and including
185  <TT
186 CLASS="LITERAL"
187 >@if-unstable-start</TT
188 > and <TT
189 CLASS="LITERAL"
190 >if-unstable-end@</TT
191 >
192  will disappear, leaving nothing but an empty comment:</P
193 ><P
194 > <TABLE
195 BORDER="0"
196 BGCOLOR="#E0E0E0"
197 WIDTH="100%"
198 ><TR
199 ><TD
200 ><PRE
201 CLASS="SCREEN"
202 >&#60;!--  --&#62;</PRE
203 ></TD
204 ></TR
205 ></TABLE
206 ></P
207 ><P
208 > There's also an if-then-else construct and an <TT
209 CLASS="LITERAL"
210 >#include</TT
211 >
212  mechanism, but you'll sure find out if you are inclined to edit the
213  templates ;-)</P
214 ><P
215 > All templates refer to a style located at
216  <A
217 HREF="http://config.privoxy.org/send-stylesheet"
218 TARGET="_top"
219 ><TT
220 CLASS="LITERAL"
221 >http://config.privoxy.org/send-stylesheet</TT
222 ></A
223 >.
224  This is, of course, locally served by <SPAN
225 CLASS="APPLICATION"
226 >Privoxy</SPAN
227 >
228  and the source for it can be found and edited in the
229  <TT
230 CLASS="FILENAME"
231 >cgi-style.css</TT
232 > template.</P
233 ></DIV
234 ><DIV
235 CLASS="NAVFOOTER"
236 ><HR
237 ALIGN="LEFT"
238 WIDTH="100%"><TABLE
239 WIDTH="100%"
240 BORDER="0"
241 CELLPADDING="0"
242 CELLSPACING="0"
243 ><TR
244 ><TD
245 WIDTH="33%"
246 ALIGN="left"
247 VALIGN="top"
248 ><A
249 HREF="filter-file.html"
250 >Prev</A
251 ></TD
252 ><TD
253 WIDTH="34%"
254 ALIGN="center"
255 VALIGN="top"
256 ><A
257 HREF="index.html"
258 >Home</A
259 ></TD
260 ><TD
261 WIDTH="33%"
262 ALIGN="right"
263 VALIGN="top"
264 ><A
265 HREF="contact.html"
266 >Next</A
267 ></TD
268 ></TR
269 ><TR
270 ><TD
271 WIDTH="33%"
272 ALIGN="left"
273 VALIGN="top"
274 >The Filter File</TD
275 ><TD
276 WIDTH="34%"
277 ALIGN="center"
278 VALIGN="top"
279 >&nbsp;</TD
280 ><TD
281 WIDTH="33%"
282 ALIGN="right"
283 VALIGN="top"
284 >Contacting the Developers, Bug Reporting and Feature
285 Requests</TD
286 ></TR
287 ></TABLE
288 ></DIV
289 ></BODY
290 ></HTML
291 >