docs.roxen.comView this page in a printer friendly mode
DocsRoxen2.2Web Site Creator ManualIf Tags
Copyright  2004, Roxen Internet Software
Suggestions, comments & compliments

<if accept>
<if client>
<if clientvar>
<if config>
<if cookie>
<if date>
<if defined>
<if domain>
<if exists>
<if expr>
<if false>
<if group>
<if internal-exists>
<if ip>
<if language>
<if match>
<if Match>
<if module>
<if pragma>
<if prestate>
<if referrer>
<if sizeof>
<if supports>
<if time>
<if true>
<if user>
<if variable>
<if Variable>


Provided by module: Tags: RXML 2 tags

<if> is used to conditionally show its contents.The <if> tag is used to conditionally show its contents. <else> or <elseif> can be used to suggest alternative content.

It is possible to use glob patterns in almost all attributes, where * means match zero or more characters while ? matches one character. * Thus t*f?? will match trainfoo as well as * tfoo but not trainfork or tfo. It is not possible to use regexp's together with any of the if-plugins.

The tag itself is useless without its plugins. Its main functionality is to provide a framework for the plugins.

It is mandatory to add a plugin as one attribute. The other attributes provided are and, or and not, used for combining plugins or logical negation.

<if variable=' > 0' and='' match=' is No'>

<if variable=' > 0' not=''>
  &; is less than 0
  &; is greater than 0

Operators valid in attribute expressions are: '=', '==', 'is', '!=', '<' and '>'.

The If plugins are sorted according to their function into five categories: Eval, Match, State, Utils and SiteBuilder.

The Eval category is the one corresponding to the regular tests made in programming languages, and perhaps the most used. They evaluate expressions containing variables, entities, strings etc and are a sort of multi-use plugins. All If-tag operators and global patterns are allowed.

<set variable='var.x' value='6'/>
<if variable='var.x > 5'>More than one hand</if>
More than one hand

The Match category contains plugins that match contents of something, e.g. an IP package header, with arguments given to the plugin as a string or a list of strings.

Your domain <if ip='130.236.*'> is </if>
<else> isn't </else>
Your domain isn't

State plugins check which of the possible states something is in, e.g. if a flag is set or not, if something is supported or not, if something is defined or not etc.

   Your browser
  <if supports='javascript'>
   supports Javascript version &client.javascript;
  <else>doesn't support Javascript</else>.
Your browser doesn't support Javascript.

Utils are additonal plugins specialized for certain tests, e.g. date and time tests.

  <if time='1700' after=''>
    Are you still at work?
  <elseif time='0900' before=''>
     Wow, you work early!
   Somewhere between 9 to 5.

SiteBuilder plugins requires a Roxen Platform SiteBuilder installed to work. They are adding test capabilities to web pages contained in a SiteBuilder administrated site.



Inverts the result (true->false, false->true).


If any criterion is met the result is true.


If all criterions are met the result is true. And is default.