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