docs.roxen.comBack to normal mode
DocsRoxenWebServer 6.1Web Developer ManualIf Tags
Copyright  2019, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com

<if defined></if>

Provided by module: Tags: RXML tags

Tests if a certain RXML define is defined by use of the <define> tag, and in that case tests its value. This is an Eval plugin.


Attributes

defined="define"

Choose what define to test.

The define should be provided as type&#0;name-of-define, i.e. the type and the name separated by a NUL (ASCII 0) character. Currently there are two alternatives:

  • tag&#0;name-of-define

  • if&#0;name-of-define

<define tag="hello-world">Hello world</define> <define container="say-hello">Hello, <contents/></define> <define if="person">Matt</define> <if defined="tag&#0;hello-world"> <div><hello-world/>!!</div> </if> <if defined="tag&#0;say-hello"> <div><say-hello>Matt</say-hello></div> </if> <if defined="if&#0;person"> <div> <if person="Matt">Yes, it's Matt!</if> <else>No Matt</else> </div> </if> <if defined="tag&#0;non-defined-thing"><non-defined-thing/></if> <else><div>&lt;non-defined-thing/&gt; is not defined</div></else>
Hello world!!
Hello, Matt
Yes, it's Matt!
<non-defined-thing/> is not defined