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