LassoScript Utility
Basics Browse Detail

[Define_Tag] ... [/Define_Tag]

Tag Link [Define_Tag] ... Category Custom Tag
Type Container Source Available No
Support Preferred Version 5.0
Change Unchanged Data Source Any
Output Type None Security None
Implementation Internal Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0


[Define_Tag] ... [/Define_Tag] defines a new custom Lasso tag. The body of the container tag defines the operations that will be performed each time this tag is called. The new tag can be called immediately after the closing [/Define_Tag].

If the second parameter is -Async then an asynchronous tag will be created. This tag cannot return results to the current format file. It is executed in a separate thread after the current format file is finished processing.

Tags which are defined in format files placed in the LassoStartup folder upon startup can be used within any format file processed by Lasso.


[Define_Tag: 'Tag Name']
... Tag Body...

Define_Tag: 'Tag Name';
... Tag Body...

[Define_Tag: 'Tag Name', -Async]
... Tag Body...


Required Parameters
Tag Name The name of the tag to be defined.
Optional Parameters
-Async If specified then the tag will spawn a new thread and execute asynchronously.
-Container Specifies that the custom tag is a container tag.
-RPC Specifies that the custom tag should be made available as a remote procedure call through RPC.LassoApp.
-Required Names a required parameter for the tag. The parameter will be available as a local variable within the tag.
-Optional Names an optional parameter for the tag. If the parameter is specified it will be available as a local variable within the tag.
-Criteria The criteria specifies a condition which must be satisifed for the tag to run. The value is an expression which is run within the context of the tag and should return True or False.
-Priority The priority specifies whether a custom tag should replace a currently defined tag with the same name or should be placed before or after it in the calling order. Value should be Replace, High, or Low.
-Type Specify after a -Required or -Optional parameter in order to set a constraint on the type for that parameter.
-ReturnType Specifies a constraint on the type of the return value from the tag.
-Description An optional description for the tag.
-Looping Specifies that the tag is a looping container tag. The [Loop_Count] will be set automatically each time [Run_Children] is called.
-Namespace The namespace in which to install the tag.
-Atomic Specifies that the tag should run atomically. Only one instance of that tag will be allowed to run. Any other page loads or threads that call the tag will block until the first instance has finished running.
-Copy Specifies that the preceding -Required or -Optional parameter should be copied rather than passed by reference.
-EncodeNone Specifies that the return value of the tag should not be encoded by default. If this keyword is not specified then the return value will be HTML encoded by default.
-Privileged Specifies that the custom tag should run with the privileges of the current user rather than with the privileges of the user who ultimately calls the custom tag.
-SOAP Specifies that the tag should be made available to remote Web servers as a SOAP operation.The tag can then be accessed through RPC.LassoApp. The -Type and -ReturnType tags must be used to specify parameter and return types.


To define a custom tag to send an email to the system administrator:

Use the [Define_Tag] ... [/Define_Tag] tags to create a tag that calls the [Email_Send] tag. The following example sends an email with information about the current page to

[Define_Tag: 'Email_Administrator']
  [Email_Send: -Host='',
    -Subject='Custom Tag',
    -Body=(Server_Date) + ' ' + (Server_Time) + ' ' + (Client_IP)]