htp on-line reference : Metatags

table of contents
  Introduction
  Usage
  Files
  Concepts
   Macros
   Metatags
   GLOBAL and EXPAND
  HTP Tags
  History
  Wish list
  Bugs

Metatags allow for HTML-like tags to be defined and later inserted anywhere in documents. They are similar to macros, but much more powerful. Unlike macros, which simply expand into text and/or tags, metatags expand intelligently. In essence, htp's functionality can be extended without modifying the program.

Metatags are defined with the DEF and BLOCKDEF tags and undefined with the UNDEF tag. Please read these sections for a more technical explanation of the definition syntax.

As an example, to create a tag to combine the <B> (bold) and <I> (italic) tags:

    <DEF NAME="BOLDITALIC">
    <B><I>
    </DEF>

    <DEF NAME="/BOLDITALIC">
    </I></B>
    </DEF>

    <BOLDITALIC>this text is bold and italic</BOLDITALIC>

The above example can also be coded as a block macro with the BLOCKDEF tag. A block macro will automatically take care of the start and its corresponding end tag. The html code surrounded by these tags is stored into a macro named BLOCK before the macro code is expanded. This variable can be expanded at the right location with the USE tag.

    <BLOCKDEF NAME="BOLDITALIC">
    <B><I>
    <USE BLOCK>
    </I></B>
    </BLOCKDEF>

This is a simple example. More sophisticated tags accept parameters. The OPTION parameter lets multiple metatag parameters be named and expanded inside the DEF block:

    <DEF NAME="SHAREDIMG" OPTION="NAME ALT">
    <IMG SRC="/home/sharedimages/${NAME}" ALT="${ALT}">;
    </DEF>

    <SHAREDIMG NAME="bubble.gif" ALT="Bubble image">

To make defined metatags available to all htp documents, place them in a common include file, or more convieniently, in the htp default file.

htp project

htp homepage

hosted by
SourceForge.net Logo

htp on-line reference / http://htp.sourceforge.net/ref/
Authors: Jim Nelson, Jochen Hoenicke, Michael Möller.
Maintainers: Jochen Hoenicke, Michael Möller.

Copyright © 1995-96 Jim Nelson.
Copyright © 2001-2002 Jochen Hoenicke, Michael Möller.
Permission to reproduce and distribute this hypertext document granted according to terms described in the Introduction

last updated Mon May 27, 2002