Tag Loops

 

A tag loop is a template file construct which allows you to iterate through the collection of a tags that CodeGen has information about. In order to use tag loops you must be generating code based on a repository structure that has at least one field tag defined.

Tag loops are delimited by a matching pair of <TAG_LOOP> and </TAG_LOOP> tags that surround the template code to be inserted for each tag. The code between the opening and closing tags is repeated for each tag in the structure.

Tag loop tokens are tokens that can only be used within a tag loop:

Tag Loop Expansion Tokens

Tag Loop Expression Tokens

There are two types of tag loops, called multi-line tag loops, and in-line tag loops.

Multi-Line Tag Loops

Multi-line tag loops occur when the opening and closing tag loop tags appear on separate lines in a template file, and delimit one or more entire lines of template code, like this:

[code]

<TAG_LOOP>
code
</TAG_LOOP>

[code]

Multi-line tag loops generate one or more lines of output code for each tag that is processed.

In-Line Tag Loops

In-line tag loops exist when the opening and closing tag loop tags appear on the same line in a template file, and delimit part of a line of template code, like this:

[code] <TAG_LOOP> code </TAG_LOOP> [code]

In-line tag loops generate code into the current output line.

 

 

 


Copyright © 2018  Synergex International, Inc.