HTP

Source code: ref/imageurl.htp

Table of Contents
  htp.def
  macros.def
  htp.htt



<BLOCK syntax>
<imageurl url="imageurl" [ path="path/in/local/filesystem" ]>
</BLOCK>

<BLOCK synopsis>

<STRONG>IMAGEURL</STRONG> declares an URL replacement that is used for
size lookups in any <A HREF="img.html">IMG</A> tag. This definitions
takes effect only if the <A HREF="opt.html">IMGXY</A> option is
enabled.  Beacause htp can't lookup files in the world wide web
you have to map absolute image URLs to a directory in
the local file system.

<P>
When an IMG tag is encountered where htp has to insert width and
height the defined URL replacements will be taken into account (later
definitions take precedence to earlier): For each defined imageurl it
checks (case-insensitive) if it is a prefix of the image's SRC
attribute. If it matches this prefix is replaced by the given PATH.
If no IMAGEURL matches the SRC is considered as relative link and
looked up in the current directory.

<P>
For example:

<htpcode>
  <imageurl url="http://my.domain.org/" path="./">
  <imageurl url="other.domain.org/" path="./">

  If this line: <img src="logo.gif">
  becomes this after processing: <img src="logo.gif" width="16" height="16">
  (no URL replacement)

  Then this line: <img src="http://my.domain.org/logo.gif">
  becomes this after processing:  
  <img src="http://my.domain.org/logo.gif" width="16" height="16">
  (using filename "./logo.gif")

  But this line: <img src="http://other.domain.org/logo.gif">
  remains unchanged
  (no prefix match!)

  Order is important; last IMAGEURL tag takes precedence:
  <imageurl url="/" path="/var/www/htdocs/">
  <imageurl url="/test/" path="/var/www/test/">

  <img src="/image.gif"> and <img src="/test/image.gif"> are mapped to
  /var/www/htdocs/image.gif and /var/www/test/image.gif, resp.
</htpcode>
<P>
If IMAGEURL is specified with a URL but no PATH attribute, it is treated as
an undefine, and is removed.
<P>
Since this is useful for a number of images used throughout a set of documents,
IMAGEURL is most appropriate in an <A HREF="file.html">include file</A> or a
<a href="default.html">default file</a>.
<P>
In addition to WIDTH and HEIGHT, htp can also (semi-)automatically add
an <a href="alttext.html">ALT text</a> attribute to
<a href="img.html">IMG</A> tags.

</BLOCK>

  page source
  htp project
  htp homepage
hosted by
SourceForge.net
HTML coding Powered by htp
htp on-line reference / http://htp.sourceforge.net/ref/
Authors: Jim Nelson, Jochen Hoenicke, Michael Möller.
Maintainers: Jochen Hoenicke.

Copyright © 1995-96 Jim Nelson.
Copyright © 2001-2003 Jochen Hoenicke.
Permission to reproduce and distribute this hypertext document granted according to terms described in the License section.

last updated Tue Feb 22, 2011