xTxT Documentation

Param

Defines an externally-supplied value that can be used within the xTxT document.

/param NAME
DEFAULT-VALUE

Attributes

ID
(required) The unique identifier is required for this element, as it gives the param a reference name.
CONTENT
(required) The default value for the param, if a value was not supplied by the host. This is required to ensure that the param has an initialized value.

Usage

In general, the param value is declared, and then referenced by name in the content of other elements, by inserting the param name in curly braces {}.

References are not case-sensitive.

Works With

Only certain elements support parameter input;

Examples

/param animal
chicken

Referenced with;

Why did the {animal} cross the road?

Would generate (by default);

Why did the chicken cross the road?

If however the parameter "animal" is assigned the value "cow" by the xTxT host, then it would instead render as;

Why did the cow cross the road?

Notes

Bracket type names (for clarification)

How are parameters passed into the document?

The parameter is fed in from the xTxT hosting environment, based on its design. If the host is a WebCMS such as Miru , then the parameter may be set through the URI querystring, e.g.;

http://mysite.com/myxtxtdocument?animal=donkey