For more information... RTFM!
NAVIGATION
PAGES THAT LINK HERE
ACCOUNT LOGIN

You are not logged in

Powered by Interchange version 5.7.0

goto

Skips a part of the page content between [goto name] and [label name].

Summary

  • [goto name if]
  • [label name]

Parameter Description Default
name The name set in the corresponding [label] marker. none
if Allow the redirection to be dependent on the outcome of a logical test. none

Example

ICML example

Example where the "if" condition is true

Start text
[goto name=foo if=1]
Middle text
[label foo]
End text
Start text
End text

Example where the "if" condition is false

Start text
[goto name=bar if=0]
Middle text
[label bar]
End text
Start text
Middle text
End text

Description

Skips the part of the page content between the [goto name] tag and the [label name] marker.

The correspondingly named [label] marks the part of the page to which the [goto] tag should skip.  Note that the [label] marker is not an end tag, but simply a marker for the end of the text to skip.  If no correspondingly named [label] exists on the page, or you don't provide a "name" parameter, then all of the text from the [goto] to the end of the file will be skipped.

Warning

Warning

If you are using [goto] in a page file then you must ensure that each of your [goto] tags has a correspondingly named [label] tag.  If you are not careful then your page template/layout will suffer, or worse, your page might not display at all.

Skipping to the end of a file due to a blank/mismatched "name" is perfectly acceptable for use in non-page files, such as "etc/log_transaction", as long as you intended for this to happen.  Again, be very careful when skipping blocks of code with [goto] and [label] tags.

Warning

Warning

Skipping container end tags with [goto] is likely to break your page.

Note

Note

The [goto] tag is not interpreted in the standard way, so you cannot use the "$Tag->goto()" Perl syntax.  See the Interchange tag parsing order section for more information.

Parameters

name

This should match the name set in a [label] marker.  The [label] marker must appear after the [goto] tag to prevent loops.

if

Condition for [goto].  If the argument to "if" is true then the tag will skip the text between the [goto] and the [label].

For example, because of the false "if" parameter value, the following [goto] will not cause the ICML parser to a skip to the corresponding [label]

[tmpn go]0[/tmpn]
[goto name="foobar" if="[scratch go]"]

Body text (not skipped).

[label foobar]

Category:  Interchange tags
Last modified by: Kevin Walsh
Modification date: Monday 2 July 2007 at 10:43 PM (CDT)
Home  |  Legal nonsense  |  Privacy policy  |  Donations  |  Contact us