Logic Tags
Tag variable


This tag stores an editable shared variable using the key and value supplied in the tag attributes. This tag can also be used inside the collection tag, in which case the key attribute is not necessary and the name value pairs will be stored directly in the parent collection. The key attribute is required otherwise. It is stored in Portlet Request scope by default. This variable can be used in attribute value replacement or with the value tag.

Example:
<pt:logic.variable pt:key="test" pt:value="my value"/>
would store the value 'my value' as an editable shared variable using the key 'test'.

<pt:logic.collection pt:key="teststringcollection">
<pt:logic.variable pt:value="my string data"/>
<pt:logic.variable pt:value="my other string data"/>
</pt:logic.collection><pt:logic.variable pt:key"test" pt:value="my value" pt:encode="1"/>
would html encode and store the value 'my value' as an editable shared variable using the key 'test'.


Tag Information
Tag Namevariable

Attributes
NameTypeRequiredDefault ValueDescription
keystringfalsenullThe key used to store the variable in memory. This attribute is required unless this tag is being used inside a collection tag. If this attribute is present and this tag is being used inside a collection tag, this attribute will take precedence and the data will be stored using the key specified in the attribute.
valuestringtruenullThe variable value.
scopestringfalseportlet requestThe scope used to store the variable. See the Logic tag library description for details about valid scope arguments.
encodeintfalse0Specify how to encode the URL title or not. 0: No encoding. Not encoding user entered string is a potential security risk as users could insert javascript that gets executed on the page. 1: HTML encoding for titles displayed directly on the page. 2: URL encoding for titles used in URLs. 3: Javascript encoding for titles used in Javascript.


Copyright 2005 Plumtree Software, Inc.