Logic Tags
Tag collection


This tag creates a data collection (a collection of variables, such as data objects) and stores it as an editable shared variable using the key supplied in the tag attributes. It is stored in in Portlet Request scope by default. The variable is only stored after this tag is finished processing it's contents. The collection tag does not append to a pre-existing collection, but will just overwrite it instead. To clear a collection, simply use this tag with no data or variable tags inside it. This collection variable can be used with the foreach tag. This tag will process nested tags to populate the data collection, but will not output any HTML. This tag also creates a temporary editable shared variable stored using the key collection. Be careful not to create a collection with different types of variables, such as string variables and data objects.

Example:
<pt:logic.collection pt:key="testcollection">
<pt:logic.data url="http://www.myco.com" name="My company"/>
<pt:logic.data url="http://www.otherco.com" name="Other company"/>
</pt:logic.collection>

<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>


Tag Information
Tag Namecollection
Related Child Tag(s)data variable

Attributes
NameTypeRequiredDefault ValueDescription
keystringtruenullThe key used to store the data collection in memory.
scopestringfalseportlet requestThe scope used to store the data collection. See the Logic tag library description for details about valid scope arguments.


Copyright 2005 Plumtree Software, Inc.