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