[ The Sunny Spot ] WPP v2.10 - The Web Preprocessor
Author : Marco Lamberto
Preprocessed by WPP
   Index < Previous    Next >   

  Directives [ ^ ]

@INCLUDE name@
Include a template. The 'name' value is expanded by adding the @DEFAULT_TMPLDIR@ value as prefix and the @DEFAULT_TMPL_EXTENSION@ as extension.
Config file
@DEFAULT_TMPLDIR=pub@
=
Output file
MENU
hhh iii jjj kkk lll mmm

DRINKS
aaa bbb ccc ddd eee fff ggg

Template pub/menu.tmpl
MENU
hhh iii jjj kkk lll mmm
Template pub/drinks/menu.tmpl
DRINKS
aaa bbb ccc ddd eee fff ggg
Source file
<!-- includes pub/menu.tmpl -->
@INCLUDE menu@

<!-- includes pub/drinks/menu.tmpl -->
@INCLUDE drinks/menu@

@IF {!}var@    ... { @ELSE@    ... } @ENDIF@
@IF var == "val"@    ... { @ELSE@    ... } @ENDIF@
@IF var != "val"@    ... { @ELSE@    ... } @ENDIF@
Is a simple if ... then implementation that made possible conditional inclusion and evaluation of html fragments.
In the first expression if var differs from empty string or a macro named var exists the code till @ELSE@ or @ENDIF@ is parsed and included.
It can be nested.

Source file
@IF SHOW_IMAGE@
   graphic map
@ELSE@
   text description
@ENDIF@

@IF !SHOW_IMAGE@
   text map
@ELSE@
  @IF IMAGE_DESC=="Test"@
     test
  @ENDIF@
  image
@ENDIF@

Notes

  • The previous versions of WPP used @FI@ instead of @ENDIF@, this version can handle both but remember that @FI@ is deprecated and could be removed in the future.
$Date$
This is the standard RCS $Date$ tag. The header file will be included only when this tag is reached.
That is because some variables contained into the header may need to be assigned to a particular value different from the default empty string !
Also if you don't use RCS (or CVS) you MUST use this tag, otherwise the header cannot be included.
The @DATE@ variable is assigned with the $Date$ tag value. If you don't use RCS this value is the making date.
@HEAD tmpl@
Use a different header from @DEFAULT_HEAD@. If 'tmpl' is omitted no header is included. This directive MUST precede the RCS $Date$ tag. The 'tmpl' is the filename without the leading templates directory (@DEFAULT_TMPLDIR@) and the extension (@DEFAULT_TMPL_EXTENSION@).
@TAIL tmpl@
Same as @HEAD@ but works only on the footer template (@DEFAULT_TAIL@) and doesn't need to precede the $Date$ tag.

   ^ Top < Previous    Next >   
Marco (LM) Lamberto lm@geocities.com
Revised: 1998/09/23 11:26:51
http://www.geocities.com/Tokyo/1474/wpp/manual_5.html
Preprocessed by WPP Graphics by GIMP