2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
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
14 http://www.apache.org/licenses/LICENSE-2.0
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.
23 <modulesynopsis metafile="mod_imagemap.xml.meta">
25 <name>mod_imagemap</name>
26 <description>Server-side imagemap processing</description>
28 <sourcefile>mod_imagemap.c</sourcefile>
29 <identifier>imagemap_module</identifier>
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>
40 <p>The following directive will activate files ending with
41 <code>.map</code> as imagemap files:</p>
43 <highlight language="config">
44 AddHandler imap-file map
47 <p>Note that the following is still supported:</p>
49 <highlight language="config">
50 AddType application/x-httpd-imap map
53 <p>However, we are trying to phase out "magic MIME types" so we
54 are deprecating this method.</p>
57 <section id="features"><title>New Features</title>
59 <p>The imagemap module adds some new features that were not
60 possible with previously distributed imagemap programs.</p>
63 <li>URL references relative to the Referer: information.</li>
65 <li>Default <code><base></code> assignment through a new map
66 directive <code>base</code>.</li>
68 <li>No need for <code>imagemap.conf</code> file.</li>
70 <li>Point references.</li>
72 <li>Configurable generation of imagemap menus.</li>
76 <section id="imapfile"><title>Imagemap File</title>
78 <p>The lines in the imagemap files can have one of several
82 directive value [<var>x</var>,<var>y</var> ...]<br />
83 directive value "<var>Menu text</var>" [<var>x</var>,<var>y</var>
85 directive value <var>x</var>,<var>y</var> ... "<var>Menu text</var>"
88 <p>The directive is one of <code>base</code>,
89 <code>default</code>, <code>poly</code>, <code>circle</code>,
90 <code>rect</code>, or <code>point</code>. The value is an
91 absolute or relative URL, or one of the special values listed
92 below. The coordinates are <code><var>x</var>,<var>y</var></code>
93 pairs separated by whitespace. The quoted text is used as the text of
94 the link if a imagemap menu is generated. Lines beginning with '#' are
97 <section id="imapfile.directives"><title>Imagemap File Directives</title>
98 <p>There are six directives allowed in the imagemap file. The
99 directives can come in any order, but are processed in the
100 order they are found in the imagemap file.</p>
103 <dt><code>base</code> Directive</dt>
105 <dd><p>Has the effect of <code><base href="<var>value</var>">
106 </code>. The non-absolute URLs of the map-file are taken relative
107 to this value. The <code>base</code> directive overrides
108 <directive module="mod_imagemap">ImapBase</directive> as set in a
109 <code>.htaccess</code> file or in the server configuration files.
110 In the absence of an <directive>ImapBase</directive> configuration
111 directive, <code>base</code> defaults to
112 <code>http://server_name/</code>.</p>
113 <p><code>base_uri</code> is synonymous with <code>base</code>.
114 Note that a trailing slash on the URL is significant.</p></dd>
116 <dt><code>default</code> Directive</dt>
118 <dd>The action taken if the coordinates given do not fit any
119 of the <code>poly</code>, <code>circle</code> or
120 <code>rect</code> directives, and there are no
121 <code>point</code> directives. Defaults to <code>nocontent</code>
122 in the absence of an <directive module="mod_imagemap"
123 >ImapDefault</directive> configuration setting, causing a status
124 code of <code>204 No Content</code> to be returned. The client
125 should keep the same page displayed.</dd>
127 <dt><code>poly</code> Directive</dt>
129 <dd>Takes three to one-hundred points, and is obeyed if the
130 user selected coordinates fall within the polygon defined by
133 <dt><code>circle</code></dt>
135 <dd>Takes the center coordinates of a circle and a point on
136 the circle. Is obeyed if the user selected point is with the
139 <dt><code>rect</code> Directive</dt>
141 <dd>Takes the coordinates of two opposing corners of a
142 rectangle. Obeyed if the point selected is within this
145 <dt><code>point</code> Directive</dt>
147 <dd>Takes a single point. The point directive closest to the
148 user selected point is obeyed if no other directives are
149 satisfied. Note that <code>default</code> will not be
150 followed if a <code>point</code> directive is present and
151 valid coordinates are given.</dd>
155 <section id="imapfile.values"><title>Values</title>
157 <p>The values for each of the directives can be any of the
163 <dd><p>The URL can be relative or absolute URL. Relative URLs
164 can contain '..' syntax and will be resolved relative to the
165 <code>base</code> value.</p>
166 <p><code>base</code> itself will not be resolved according to the
167 current value. A statement <code>base mailto:</code> will
168 work properly, though.</p></dd>
170 <dt><code>map</code></dt>
172 <dd>Equivalent to the URL of the imagemap file itself. No
173 coordinates are sent with this, so a menu will be generated
174 unless <directive module="mod_imagemap">ImapMenu</directive> is set to
175 <code>none</code>.</dd>
177 <dt><code>menu</code></dt>
178 <dd>Synonymous with <code>map</code>.</dd>
180 <dt><code>referer</code></dt>
182 <dd>Equivalent to the URL of the referring document. Defaults
183 to <code>http://servername/</code> if no <code>Referer:</code>
184 header was present.</dd>
186 <dt><code>nocontent</code></dt>
188 <dd>Sends a status code of <code>204 No Content</code>,
189 telling the client to keep the same page displayed. Valid for
190 all but <code>base</code>.</dd>
192 <dt><code>error</code></dt>
194 <dd>Fails with a <code>500 Server Error</code>. Valid for all
195 but <code>base</code>, but sort of silly for anything but
196 <code>default</code>.</dd>
200 <section id="imapfile.coords"><title>Coordinates</title>
203 <dt><code>0,0 200,200</code></dt>
205 <dd>A coordinate consists of an <var>x</var> and a <var>y</var>
206 value separated by a comma. The coordinates are separated
207 from each other by whitespace. To accommodate the way Lynx
208 handles imagemaps, should a user select the coordinate
209 <code>0,0</code>, it is as if no coordinate had been
215 <section id="imapfile.quotedtext"><title>Quoted Text</title>
218 <dt><code>"<var>Menu Text</var>"</code></dt>
220 <dd><p>After the value or after the coordinates, the line
221 optionally may contain text within double quotes. This string
222 is used as the text for the link if a menu is
226 <a href="http://example.com/"><var>Menu text</var></a>
229 <p>If no quoted text is present, the name of the link will be
230 used as the text:</p>
233 <a href="http://example.com/">http://example.com</a>
236 <p>If you want to use double quotes within this text, you have to
237 write them as <code>&quot;</code>.</p></dd>
243 <section id="example"><title>Example Mapfile</title>
246 #Comments are printed in a 'formatted' or 'semiformatted' menu.<br />
247 #And can contain html tags. <hr><br />
249 poly map "Could I have a menu, please?" 0,0 0,10 10,10 10,0<br />
250 rect .. 0,0 77,27 "the directory of the referer"<br />
251 circle http://www.inetnebr.example.com/lincoln/feedback/ 195,0 305,27<br />
252 rect another_file "in same directory as referer" 306,0 419,27<br />
253 point http://www.zyzzyva.example.com/ 100,100<br />
254 point http://www.tripod.example.com/ 200,200<br />
255 rect mailto:nate@tripod.example.com 100,150 200,0 "Bugs?"<br />
260 <section id="referencing"><title>Referencing your mapfile</title>
262 <example><title>HTML example</title>
263 <a href="/maps/imagemap1.map"><br />
265 <img ismap src="/images/imagemap1.gif"><br />
270 <example><title>XHTML example</title>
271 <a href="/maps/imagemap1.map"><br />
273 <img ismap="ismap" src="/images/imagemap1.gif" /><br />
281 <name>ImapMenu</name>
282 <description>Action if no coordinates are given when calling
283 an imagemap</description>
284 <syntax>ImapMenu none|formatted|semiformatted|unformatted</syntax>
285 <default>ImapMenu formatted</default>
286 <contextlist><context>server config</context><context>virtual host</context>
287 <context>directory</context><context>.htaccess</context></contextlist>
288 <override>Indexes</override>
291 <p>The <directive>ImapMenu</directive> directive determines the
292 action taken if an imagemap file is called without valid
296 <dt><code>none</code></dt>
297 <dd>If ImapMenu is <code>none</code>, no menu is generated,
298 and the <code>default</code> action is performed.</dd>
300 <dt><code>formatted</code></dt>
301 <dd>A <code>formatted</code> menu is the simplest menu.
302 Comments in the imagemap file are ignored. A level one header
303 is printed, then an hrule, then the links each on a separate
304 line. The menu has a consistent, plain look close to that of
305 a directory listing.</dd>
307 <dt><code>semiformatted</code></dt>
308 <dd>In the <code>semiformatted</code> menu, comments are
309 printed where they occur in the imagemap file. Blank lines
310 are turned into HTML breaks. No header or hrule is printed,
311 but otherwise the menu is the same as a
312 <code>formatted</code> menu.</dd>
314 <dt><code>unformatted</code></dt>
315 <dd>Comments are printed, blank lines are ignored. Nothing is
316 printed that does not appear in the imagemap file. All breaks
317 and headers must be included as comments in the imagemap
318 file. This gives you the most flexibility over the appearance
319 of your menus, but requires you to treat your map files as
320 HTML instead of plaintext.</dd>
326 <name>ImapDefault</name>
327 <description>Default action when an imagemap is called with coordinates
328 that are not explicitly mapped</description>
329 <syntax>ImapDefault error|nocontent|map|referer|<var>URL</var></syntax>
330 <default>ImapDefault nocontent</default>
331 <contextlist><context>server config</context><context>virtual host</context>
332 <context>directory</context><context>.htaccess</context></contextlist>
333 <override>Indexes</override>
336 <p>The <directive>ImapDefault</directive> directive sets the default
337 <code>default</code> used in the imagemap files. Its value is
338 overridden by a <code>default</code> directive within the
339 imagemap file. If not present, the <code>default</code> action
340 is <code>nocontent</code>, which means that a <code>204 No
341 Content</code> is sent to the client. In this case, the client
342 should continue to display the original page.</p>
347 <name>ImapBase</name>
348 <description>Default <code>base</code> for imagemap files</description>
349 <syntax>ImapBase map|referer|<var>URL</var></syntax>
350 <default>ImapBase http://servername/</default>
351 <contextlist><context>server config</context><context>virtual host</context>
352 <context>directory</context><context>.htaccess</context></contextlist>
353 <override>Indexes</override>
356 <p>The <directive>ImapBase</directive> directive sets the default
357 <code>base</code> used in the imagemap files. Its value is
358 overridden by a <code>base</code> directive within the imagemap
359 file. If not present, the <code>base</code> defaults to
360 <code>http://<var>servername</var>/</code>.</p>
362 <seealso><directive module="core">UseCanonicalName</directive></seealso>