Index < Previous     Next >
Directives [ ^ ]
INCLUDE
@INCLUDE name@
Include a template. The 'namè value is expanded by searching into the @DEFAULT_TMPLPATH@ directories a file with the wanted name and the extension specified with @DEFAULT_TMPL_EXTENSION@.
Config file
@DEFAULT_TMPLPATH=pub:my_templates:templates@
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@
Output file
MENU
hhh iii jjj kkk lll mmm

DRINKS
aaa bbb ccc ddd eee fff ggg
IF/ELSE/ENDIF
@IF test@ ... [@ELSE@ ...] @ENDIF@
Test Description Example
var It's true if the variable "var" is defined (it's value is something different from an empty string).
@IF MYVAR@
!var It's true if the variable "var" is not defined (it's value is an empty string).
@IF !MYVAR@
var == "val" It's true only if the value associated to the variable "var" is equal to the value specified by "val".
@IF MYVAR == "some value"@
var != "val" It's true only if the value associated to the variable "var" is different from the value specified by "val".
@IF MYVAR != "another value"@
Is a simple if/else 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
$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
@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 (a @DEFAULT_TMPLPATH@ entry) and the extension (@DEFAULT_TMPL_EXTENSION@).
TAIL
@TAIL tmpl@
Same as @HEAD@ but works only on the footer template (@DEFAULT_TAIL@) and doesn't need to precede the $Date$ tag.
INLINE/ENDINLINE
@INLINE@
...
@ENDINLINE@
Allows perl code inlined within raw sources.
^ Top < Previous     Next >