Rebuilt HTML for 3.0.20 UNRELEASED with Ian's recent changes
[privoxy.git] / doc / webserver / user-manual / templates.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
3
4 <html>
5 <head>
6   <title>Privoxy's Template Files</title>
7   <meta name="GENERATOR" content=
8   "Modular DocBook HTML Stylesheet Version 1.79">
9   <link rel="HOME" title="Privoxy 3.0.20 User Manual" href="index.html">
10   <link rel="PREVIOUS" title="Filter Files" href="filter-file.html">
11   <link rel="NEXT" title=
12   "Contacting the Developers, Bug Reporting and Feature Requests" href=
13   "contact.html">
14   <link rel="STYLESHEET" type="text/css" href="../p_doc.css">
15   <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
16   <link rel="STYLESHEET" type="text/css" href="p_doc.css">
17   <style type="text/css">
18 body {
19   background-color: #EEEEEE;
20   color: #000000;
21   }
22   :link { color: #0000FF }
23   :visited { color: #840084 }
24   :active { color: #0000FF }
25   table.c3 {background-color: #E0E0E0}
26   span.c2 {font-style: italic}
27   hr.c1 {text-align: left}
28   </style>
29 </head>
30
31 <body class="SECT1">
32   <div class="NAVHEADER">
33     <table summary="Header navigation table" width="100%" border="0"
34     cellpadding="0" cellspacing="0">
35       <tr>
36         <th colspan="3" align="center">Privoxy 3.0.20 User Manual</th>
37       </tr>
38
39       <tr>
40         <td width="10%" align="left" valign="bottom"><a href=
41         "filter-file.html" accesskey="P">Prev</a></td>
42
43         <td width="80%" align="center" valign="bottom"></td>
44
45         <td width="10%" align="right" valign="bottom"><a href="contact.html"
46         accesskey="N">Next</a></td>
47       </tr>
48     </table>
49     <hr class="c1" width="100%">
50   </div>
51
52   <div class="SECT1">
53     <h1 class="SECT1"><a name="TEMPLATES" id="TEMPLATES">10. Privoxy's
54     Template Files</a></h1>
55
56     <p>All <span class="APPLICATION">Privoxy</span> built-in pages, i.e.
57     error pages such as the <a href="http://show-the-404-error.page" target=
58     "_top"><span class="QUOTE">"404 - No Such Domain"</span> error page</a>,
59     the <a href="http://ads.bannerserver.example.com/nasty-ads/sponsor.html"
60     target="_top"><span class="QUOTE">"BLOCKED"</span> page</a> and all pages
61     of its <a href="http://config.privoxy.org/" target="_top">web-based user
62     interface</a>, are generated from <span class=
63     "emphasis EMPHASIS c2">templates</span>. (<span class=
64     "APPLICATION">Privoxy</span> must be running for the above links to work
65     as intended.)</p>
66
67     <p>These templates are stored in a subdirectory of the <a href=
68     "config.html#CONFDIR">configuration directory</a> called <tt class=
69     "FILENAME">templates</tt>. On Unixish platforms, this is typically
70     <a href="file:///etc/privoxy/templates/" target="_top"><tt class=
71     "FILENAME">/etc/privoxy/templates/</tt></a>.</p>
72
73     <p>The templates are basically normal HTML files, but with place-holders
74     (called symbols or exports), which <span class=
75     "APPLICATION">Privoxy</span> fills at run time. It is possible to edit
76     the templates with a normal text editor, should you want to customize
77     them. (<span class="emphasis EMPHASIS c2">Not recommended for the casual
78     user</span>). Should you create your own custom templates, you should use
79     the <tt class="FILENAME">config</tt> setting <a href=
80     "config.html#TEMPLDIR">templdir</a> to specify an alternate location, so
81     your templates do not get overwritten during upgrades.</p>
82
83     <p>Note that just like in configuration files, lines starting with
84     <tt class="LITERAL">#</tt> are ignored when the templates are filled
85     in.</p>
86
87     <p>The place-holders are of the form <tt class="LITERAL">@name@</tt>, and
88     you will find a list of available symbols, which vary from template to
89     template, in the comments at the start of each file. Note that these
90     comments are not always accurate, and that it's probably best to look at
91     the existing HTML code to find out which symbols are supported and what
92     they are filled in with.</p>
93
94     <p>A special application of this substitution mechanism is to make whole
95     blocks of HTML code disappear when a specific symbol is set. We use this
96     for many purposes, one of them being to include the beta warning in all
97     our user interface (CGI) pages when <span class=
98     "APPLICATION">Privoxy</span> is in an alpha or beta development
99     stage:</p>
100
101     <table class="c3" border="0" width="100%">
102       <tr>
103         <td>
104           <pre class="SCREEN">
105 &lt;!-- @if-unstable-start --&gt;
106
107   ... beta warning HTML code goes here ...
108
109 &lt;!-- if-unstable-end@ --&gt;
110 </pre>
111         </td>
112       </tr>
113     </table>
114
115     <p>If the "unstable" symbol is set, everything in between and including
116     <tt class="LITERAL">@if-unstable-start</tt> and <tt class=
117     "LITERAL">if-unstable-end@</tt> will disappear, leaving nothing but an
118     empty comment:</p>
119
120     <table class="c3" border="0" width="100%">
121       <tr>
122         <td>
123           <pre class="SCREEN">
124 &lt;!--  --&gt;
125 </pre>
126         </td>
127       </tr>
128     </table>
129
130     <p>There's also an if-then-else construct and an <tt class=
131     "LITERAL">#include</tt> mechanism, but you'll sure find out if you are
132     inclined to edit the templates ;-)</p>
133
134     <p>All templates refer to a style located at <a href=
135     "http://config.privoxy.org/send-stylesheet" target="_top"><tt class=
136     "LITERAL">http://config.privoxy.org/send-stylesheet</tt></a>. This is, of
137     course, locally served by <span class="APPLICATION">Privoxy</span> and
138     the source for it can be found and edited in the <tt class=
139     "FILENAME">cgi-style.css</tt> template.</p>
140   </div>
141
142   <div class="NAVFOOTER">
143     <hr class="c1" width="100%">
144
145     <table summary="Footer navigation table" width="100%" border="0"
146     cellpadding="0" cellspacing="0">
147       <tr>
148         <td width="33%" align="left" valign="top"><a href="filter-file.html"
149         accesskey="P">Prev</a></td>
150
151         <td width="34%" align="center" valign="top"><a href="index.html"
152         accesskey="H">Home</a></td>
153
154         <td width="33%" align="right" valign="top"><a href="contact.html"
155         accesskey="N">Next</a></td>
156       </tr>
157
158       <tr>
159         <td width="33%" align="left" valign="top">Filter Files</td>
160
161         <td width="34%" align="center" valign="top">&nbsp;</td>
162
163         <td width="33%" align="right" valign="top">Contacting the Developers,
164         Bug Reporting and Feature Requests</td>
165       </tr>
166     </table>
167   </div>
168 </body>
169 </html>