]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_imagemap.xml
update license header text
[apache] / docs / manual / mod / mod_imagemap.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
7  Licensed to the Apache Software Foundation (ASF) under one or more
8  contributor license agreements.  See the NOTICE file distributed with
9  this work for additional information regarding copyright ownership.
10  The ASF licenses this file to You under the Apache License, Version 2.0
11  (the "License"); you may not use this file except in compliance with
12  the License.  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16  Unless required by applicable law or agreed to in writing, software
17  distributed under the License is distributed on an "AS IS" BASIS,
18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  See the License for the specific language governing permissions and
20  limitations under the License.
21 -->
22
23 <modulesynopsis metafile="mod_imagemap.xml.meta">
24
25 <name>mod_imagemap</name>
26 <description>Server-side imagemap processing</description>
27 <status>Base</status>
28 <sourcefile>mod_imagemap.c</sourcefile>
29 <identifier>imagemap_module</identifier>
30
31 <summary>
32     <p>This module processes <code>.map</code> files, thereby
33     replacing the functionality of the <code>imagemap</code> CGI
34     program. Any directory or document type configured to use the
35     handler <code>imap-file</code> (using either 
36     <directive module="mod_mime">AddHandler</directive> or
37     <directive module="core">SetHandler</directive>)
38     will be processed by this module.</p>
39
40     <p>The following directive will activate files ending with
41     <code>.map</code> as imagemap files:</p>
42
43     <example>AddHandler imap-file map</example>
44
45     <p>Note that the following is still supported:</p>
46
47     <example>AddType application/x-httpd-imap map</example>
48
49     <p>However, we are trying to phase out "magic MIME types" so we
50     are deprecating this method.</p>
51 </summary>
52
53 <section id="features"><title>New Features</title>
54
55     <p>The imagemap module adds some new features that were not
56     possible with previously distributed imagemap programs.</p>
57
58     <ul>
59       <li>URL references relative to the Referer: information.</li>
60
61       <li>Default <code>&lt;base&gt;</code> assignment through a new map
62       directive <code>base</code>.</li>
63
64       <li>No need for <code>imagemap.conf</code> file.</li>
65
66       <li>Point references.</li>
67
68       <li>Configurable generation of imagemap menus.</li>
69     </ul>
70 </section>
71
72 <section id="imapfile"><title>Imagemap File</title>
73
74     <p>The lines in the imagemap files can have one of several
75     formats:</p>
76
77     <example>
78       directive value [<var>x</var>,<var>y</var> ...]<br />
79       directive value "<var>Menu text</var>" [<var>x</var>,<var>y</var>
80       ...]<br />
81       directive value <var>x</var>,<var>y</var> ... "<var>Menu text</var>"
82     </example>
83
84     <p>The directive is one of <code>base</code>,
85     <code>default</code>, <code>poly</code>, <code>circle</code>,
86     <code>rect</code>, or <code>point</code>. The value is an
87     absolute or relative URL, or one of the special values listed
88     below. The coordinates are <code><var>x</var>,<var>y</var></code>
89     pairs separated by whitespace. The quoted text is used as the text of
90     the link if a imagemap menu is generated. Lines beginning with '#' are
91     comments.</p>
92
93     <section id="imapfile.directives"><title>Imagemap File Directives</title>
94       <p>There are six directives allowed in the imagemap file. The
95       directives can come in any order, but are processed in the
96       order they are found in the imagemap file.</p>
97
98       <dl>
99       <dt><code>base</code> Directive</dt>
100
101       <dd><p>Has the effect of <code>&lt;base href="<var>value</var>"&gt;
102       </code>. The non-absolute URLs of the map-file are taken relative
103       to this value. The <code>base</code> directive overrides
104       <directive module="mod_imagemap">ImapBase</directive> as set in a
105       <code>.htaccess</code> file or in the server configuration files.
106       In the absence of an <directive>ImapBase</directive> configuration
107       directive, <code>base</code> defaults to
108       <code>http://server_name/</code>.</p>
109       <p><code>base_uri</code> is synonymous with <code>base</code>.
110       Note that a trailing slash on the URL is significant.</p></dd>
111
112       <dt><code>default</code> Directive</dt>
113
114       <dd>The action taken if the coordinates given do not fit any
115       of the <code>poly</code>, <code>circle</code> or
116       <code>rect</code> directives, and there are no
117       <code>point</code> directives. Defaults to <code>nocontent</code>
118       in the absence of an <directive module="mod_imagemap"
119       >ImapDefault</directive> configuration setting, causing a status
120       code of <code>204 No Content</code> to be returned. The client
121       should keep the same page displayed.</dd>
122
123       <dt><code>poly</code> Directive</dt>
124
125       <dd>Takes three to one-hundred points, and is obeyed if the
126       user selected coordinates fall within the polygon defined by
127       these points.</dd>
128
129       <dt><code>circle</code></dt>
130
131       <dd>Takes the center coordinates of a circle and a point on
132       the circle. Is obeyed if the user selected point is with the
133       circle.</dd>
134
135       <dt><code>rect</code> Directive</dt>
136
137       <dd>Takes the coordinates of two opposing corners of a
138       rectangle. Obeyed if the point selected is within this
139       rectangle.</dd>
140
141       <dt><code>point</code> Directive</dt>
142
143       <dd>Takes a single point. The point directive closest to the
144       user selected point is obeyed if no other directives are
145       satisfied. Note that <code>default</code> will not be
146       followed if a <code>point</code> directive is present and
147       valid coordinates are given.</dd>
148       </dl>
149     </section>
150
151     <section id="imapfile.values"><title>Values</title>
152
153       <p>The values for each of the directives can any of the following:</p>
154
155       <dl>
156       <dt>a URL</dt>
157
158       <dd><p>The URL can be relative or absolute URL. Relative URLs
159       can contain '..' syntax and will be resolved relative to the
160       <code>base</code> value.</p>
161       <p><code>base</code> itself will not resolved according to the
162       current value. A statement <code>base mailto:</code> will
163       work properly, though.</p></dd>
164
165       <dt><code>map</code></dt>
166
167       <dd>Equivalent to the URL of the imagemap file itself. No
168       coordinates are sent with this, so a menu will be generated
169       unless <directive module="mod_imagemap">ImapMenu</directive> is set to
170       <code>none</code>.</dd>
171
172       <dt><code>menu</code></dt>
173       <dd>Synonymous with <code>map</code>.</dd>
174
175       <dt><code>referer</code></dt>
176
177       <dd>Equivalent to the URL of the referring document. Defaults
178       to <code>http://servername/</code> if no <code>Referer:</code>
179       header was present.</dd>
180
181       <dt><code>nocontent</code></dt>
182
183       <dd>Sends a status code of <code>204 No Content</code>,
184       telling the client to keep the same page displayed. Valid for
185       all but <code>base</code>.</dd>
186
187       <dt><code>error</code></dt>
188
189       <dd>Fails with a <code>500 Server Error</code>. Valid for all
190       but <code>base</code>, but sort of silly for anything but
191       <code>default</code>.</dd>
192       </dl>
193     </section>
194
195     <section id="imapfile.coords"><title>Coordinates</title>
196
197       <dl>
198       <dt><code>0,0 200,200</code></dt>
199
200       <dd>A coordinate consists of an <var>x</var> and a <var>y</var>
201       value separated by a comma. The coordinates are separated
202       from each other by whitespace. To accommodate the way Lynx
203       handles imagemaps, should a user select the coordinate
204       <code>0,0</code>, it is as if no coordinate had been
205       selected.</dd>
206       </dl>
207
208     </section>
209
210     <section id="imapfile.quotedtext"><title>Quoted Text</title>
211
212       <dl>
213       <dt><code>"<var>Menu Text</var>"</code></dt>
214
215       <dd><p>After the value or after the coordinates, the line
216       optionally may contain text within double quotes. This string
217       is used as the text for the link if a menu is
218       generated:</p>
219
220       <example>
221         &lt;a href="http://foo.com/"&gt;<var>Menu text</var>&lt;/a&gt;
222       </example>
223
224       <p>If no quoted text is present, the name of the link will be
225       used as the text:</p>
226
227       <example>
228         &lt;a href="http://foo.com/"&gt;http://foo.com&lt;/a&gt;
229       </example>
230
231       <p>If you want to use double quotes within this text, you have to
232       write them as <code>&amp;quot;</code>.</p></dd>
233       </dl>
234
235     </section>
236 </section>
237
238 <section id="example"><title>Example Mapfile</title>
239
240     <example>
241       #Comments are printed in a 'formatted' or 'semiformatted' menu.<br />
242       #And can contain html tags. &lt;hr&gt;<br />
243       base referer<br />
244       poly map "Could I have a menu, please?" 0,0 0,10 10,10 10,0<br />
245       rect .. 0,0 77,27 "the directory of the referer"<br />
246       circle http://www.inetnebr.com/lincoln/feedback/ 195,0 305,27<br />
247       rect another_file "in same directory as referer" 306,0 419,27<br />
248       point http://www.zyzzyva.com/ 100,100<br />
249       point http://www.tripod.com/ 200,200<br />
250       rect mailto:nate@tripod.com 100,150 200,0 "Bugs?"<br />
251     </example>
252
253 </section>
254
255 <section id="referencing"><title>Referencing your mapfile</title>
256
257     <example><title>HTML example</title>
258       &lt;a href="/maps/imagemap1.map"&gt;<br />
259       <indent>
260         &lt;img ismap src="/images/imagemap1.gif"&gt;<br />
261       </indent>
262       &lt;/a&gt;
263     </example>
264
265     <example><title>XHTML example</title>
266       &lt;a href="/maps/imagemap1.map"&gt;<br />
267       <indent>
268         &lt;img ismap="ismap" src="/images/imagemap1.gif" /&gt;<br />
269       </indent>
270       &lt;/a&gt;
271     </example>
272
273 </section>
274
275 <directivesynopsis>
276 <name>ImapMenu</name>
277 <description>Action if no coordinates are given when calling
278 an imagemap</description>
279 <syntax>ImapMenu none|formatted|semiformatted|unformatted</syntax>
280 <contextlist><context>server config</context><context>virtual host</context>
281 <context>directory</context><context>.htaccess</context></contextlist>
282 <override>Indexes</override>
283
284 <usage>
285     <p>The <directive>ImapMenu</directive> directive determines the
286     action taken if an imagemap file is called without valid
287     coordinates.</p>
288
289     <dl>
290       <dt><code>none</code></dt>
291       <dd>If ImapMenu is <code>none</code>, no menu is generated,
292       and the <code>default</code> action is performed.</dd>
293
294       <dt><code>formatted</code></dt>
295       <dd>A <code>formatted</code> menu is the simplest menu.
296       Comments in the imagemap file are ignored. A level one header
297       is printed, then an hrule, then the links each on a separate
298       line. The menu has a consistent, plain look close to that of
299       a directory listing.</dd>
300
301       <dt><code>semiformatted</code></dt>
302       <dd>In the <code>semiformatted</code> menu, comments are
303       printed where they occur in the imagemap file. Blank lines
304       are turned into HTML breaks. No header or hrule is printed,
305       but otherwise the menu is the same as a
306       <code>formatted</code> menu.</dd>
307
308       <dt><code>unformatted</code></dt>
309       <dd>Comments are printed, blank lines are ignored. Nothing is
310       printed that does not appear in the imagemap file. All breaks
311       and headers must be included as comments in the imagemap
312       file. This gives you the most flexibility over the appearance
313       of your menus, but requires you to treat your map files as
314       HTML instead of plaintext.</dd>
315     </dl>
316 </usage>
317 </directivesynopsis>
318
319 <directivesynopsis>
320 <name>ImapDefault</name>
321 <description>Default action when an imagemap is called with coordinates
322 that are not explicitly mapped</description>
323 <syntax>ImapDefault error|nocontent|map|referer|<var>URL</var></syntax>
324 <default>ImapDefault nocontent</default>
325 <contextlist><context>server config</context><context>virtual host</context>
326 <context>directory</context><context>.htaccess</context></contextlist>
327 <override>Indexes</override>
328
329 <usage>
330     <p>The <directive>ImapDefault</directive> directive sets the default
331     <code>default</code> used in the imagemap files. Its value is
332     overridden by a <code>default</code> directive within the
333     imagemap file. If not present, the <code>default</code> action
334     is <code>nocontent</code>, which means that a <code>204 No
335     Content</code> is sent to the client. In this case, the client
336     should continue to display the original page.</p>
337 </usage>
338 </directivesynopsis>
339
340 <directivesynopsis>
341 <name>ImapBase</name>
342 <description>Default <code>base</code> for imagemap files</description>
343 <syntax>ImapBase map|referer|<var>URL</var></syntax>
344 <default>ImapBase http://servername/</default>
345 <contextlist><context>server config</context><context>virtual host</context>
346 <context>directory</context><context>.htaccess</context></contextlist>
347 <override>Indexes</override>
348
349 <usage>
350     <p>The <directive>ImapBase</directive> directive sets the default
351     <code>base</code> used in the imagemap files. Its value is
352     overridden by a <code>base</code> directive within the imagemap
353     file. If not present, the <code>base</code> defaults to
354     <code>http://<var>servername</var>/</code>.</p>
355 </usage>
356 <seealso><directive module="core">UseCanonicalName</directive></seealso>
357 </directivesynopsis>
358
359 </modulesynopsis>