![]() |
| > Home > Documentation > Latest documentation > Looping tags and sub-tags > PREFIX-change |
|
PREFIX-changeSummary
DescriptionSets up a breaking sequence that occurs when the contents of the [condition] VALUE [/condition] change. The most common use is a category break to nest or place headers. The region is only output when a field or other repeating value between [condition] and [/condition] changes value. This allows indented lists similar to database reports to be easily formatted. The repeating value must be a tag interpolated in the search process, such as [PREFIX-field] or [PREFIX-field table column]. If you need access to Interchange tags then you can use [PREFIX-calc] with a $Tag-foo() (Perl) call. Of course, this will only work as you'd expect if the search results are properly sorted. The "marker" parameter is mandatory, and is also arbitrary; Any "marker" can be selected, as long as the name same name is used in both the start and end tags. The value to be tested is contained within a [condition] VALUE [/condition] tag pair. The [PREFIX-change] tag also processes an optional "[else]...[/else]" block, which can be used to output some text when the VALUE has not changed. Here is a simple example for a search list that has a field category and subcategory associated with each item:
The above should put out a table that only shows the category and subcategory once, while showing the name for every product. The " " will prevent "empty" cells from messing up the table display. You should also know that this loop sub-tag will nest. For example:
Closing tag syntaxThe closing tag syntax is slightly different from most other container tags. Most container tags use a format such as "[tagname params]...[/tagname]", whereas this loop sub-tag uses "[tagname param]...[/tagname param]". For example:
|
| Home | Legal nonsense | Privacy policy | Contact us |