For more information... RTFM!

You are not logged in

Powered by Interchange version 5.7.0

Universal tag attributes

Universal attributes apply to all tags, though each tag specifies its own default for the attribute.  The code implementing universal attributes is external to the core routines that implement specific tags.


If this attribute is set true then the tag's output will be suppressed.  For example:

[calcn] return '[var SQLDSN]'; [/calcn]

The above would return the value of the SQLDSN variable because hide and reparse both default true for the [calcn] tag.

Second example:

[calcn hide=1] return '[var SQLDSN]'; [/calcn]

The above will produce no output at all.  Clearly the second example doesn't look very useful, but it stands as a graphic example of the feature.  The hide parameter is more useful in tags like [value].



This universal parameter was introduced in version 5.5.2, and is therefore not available for use with any earlier Interchange version.



With no text being returned, the reparse parameter's value will be ignored.


This attribute behaves differently depending upon whether the tag is a container or standalone tag.  A container tag is one which has an end tag.  For example:

[foo somearg="someval"] body text [/foo]

A standalone tag has no end tag.  For example:

[foobar somearg="someval"]

For container tags (interpolated): 

  • If true ("interpolate=1") then the Interchange tag parser will first process any tags within the body text before passing it to the enclosing tag.
  • If false ("interpolate=0") then the enclosing tag will receive the raw body text.

For standalone tags (reparsed): 

  • If true ("interpolate=1"), the server will process the output of the tag.  This is identical to the behaviour of the reparse attribute
The mixing of interpolate and reparse logic occurred because interpolate already worked this way when reparse was added to Interchange.  This may be fixed in a later release.

Assuming that the value of "name" is "Kevin", consider the following interpolation examples:

  1. [log interpolate=1][value name] was here[/log]
  2. [log interpolate=0][value name] was here[/log]

The first line would log "Kevin was here", whereas the second line would log "[value name] was here".

Reparsing example:

Suppose, on Sunday 29 January 2006, we set a scratchpad variable called "now", as follows:

[tmpn now][time]%A %d %B %Y[/time][/tmpn]

A call to [scratch foo] using interpolate=0 (the default for [scratch]), would expand as follows:

[scratch foo]
[time]%A %d %B %Y[/time]

and an interpolate=1 call would expand as follows:

[scratch name="foo" interpolate=1]
Sunday 29 January 2006

Note that I used [tmpn] to set the scratchpad value, in the above example, because [tmpn] does not interpolate its body text by default.  If I had used [tmp] or [seti] then the [time] tag in the body text would have been interpolated before the scratchpad value was set.


If true (reparse=1) then the parser will process any further Interchange tags found in the text output from the tag, otherwise they will be returned as plain text.

Reparse applies only to container tags (those with an end tag).  The interpolate attribute controls reparsing of the output of standalone tags.  The exception to this is the [include] tag, which reparses its output by default.

Most container tags will have their output re-parsed for more Interchange tags by default.  If you wish to inhibit this behaviour, you must explicitly set the "reparse=0" attribute.  Note that you will almost always want the default action.  The only container tags that don't have reparse set by default are [either] and [mvasp].


[tmpn name]Kevin[/tmpn]

1. [calcn]
       my $tagname = 'scratch';
       return "[$tagname name] was here.";

2. [calcn reparse=0]
       my $tagname = 'scratch';
       return "[$tagname name] was here.";

The above would create the following output:

  1. Kevin was here.
  2. [scratch name] was here.



If the hide parameter is set true then there will be no output text to reparse.

Last modified by: Kevin Walsh
Modification date: Wednesday 29 June 2011 at 1:21 AM (EDT)
Home  |  Legal nonsense  |  Privacy policy  |  Donations  |  Contact us