HTP

htp on-line reference : IMAGEURL

Table of Contents
  Introduction
  License
  Tutorial
  Usage
  HTP Tags
    ALTTEXT
    BLOCK
    BLOCKDEF
    DEF
    FILE
    IF
    INC
    IMG
  > IMAGEURL
    OPT
    OUTPUT
    QUOTE
    SET
    UNDEF
    UNSET
    USE, $
    WHILE
    <!---
  History
  Wish list
  Bugs

syntax

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

synopsis

IMAGEURL declares an URL replacement that is used for size lookups in any IMG tag. This definitions takes effect only if the IMGXY 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.

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.

For example:

  <[ref]imageurl url="http://my.domain.org/" path="./">
  <[ref]imageurl url="other.domain.org/" path="./">

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

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

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

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

  <[ref]img src="/image.gif"> and <[ref]img src="/test/image.gif"> are mapped to
  /var/www/htdocs/image.gif and /var/www/test/image.gif, resp.

If IMAGEURL is specified with a URL but no PATH attribute, it is treated as an undefine, and is removed.

Since this is useful for a number of images used throughout a set of documents, IMAGEURL is most appropriate in an include file or a default file.

In addition to WIDTH and HEIGHT, htp can also (semi-)automatically add an ALT text attribute to IMG tags.

  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 Fri Aug 31, 2007