If element

If element

It is possible to specify, that some design elements should only be included if a certain condition is met. For that you could use the If element as described below. A more advanced option is to use the select element.

You can insert an If element with this icon:

selectedImg

The icon is found by clicking the '+' icon to reveal the second row of design elements:


The setup of the If element is shown below:


The condition is setup as a standard XPath expression, which is expected to return a boolean (true or false). You can click the magnifying glass to insert references to a sample XML file, variables and/or internal functions.

If you insert a condition for a spooled file, then you should consider activating the relative mode and setup an anchor line to make it easier to use the ng:spoolMapRel function if needed.

If the condition is true, then the elements placed in the sub-folder of the If element are executed:


The If element has no 'else' option. If you want that functionality, then you should check out the select element.

 

You can find help regarding how to build up a valid condition in this video:



    • Related Articles

    • Comment element

      You can use the comment element to document the structure and changes to templates. To insert a comment in your template you need to insert the comment element with this icon: You find this icon by clicking the '+' icon to reveal the second row of ...
    • Select element

      In the designer there are two conditional elements: The If element and this, the select element. The select element is an advanced version of the If element, that makes it possible to branch out to different sub-folders with elements, depending on ...
    • Cell element

      When you insert a table element in the designer, then each block of the table is referred to in InterFormNG2 as a cell. There is no limit the the element types, that you can insert inside a cell; you can even insert a table in a cell. So most of the ...
    • Bookmark element

      You can make InterFormNG2 add a bookmark element in the output PDF with the Bookmark design element. The element only has an effect on merges into PDF. You can decide, if the bookmarks should be shown when the PDF file is opened and to which level ...
    • Page element

      The page element in InterFormNG2 is the container of all the physical elements, that build up the output. A new template is created with a page element as you need that in order to generate any output at all. You insert an additional page element ...