Logic Tags
Tag stringexpr


This tag evaluates whether or not two strings are equal and stores the result as a boolean in memory. Case must match. It is designed to work with the logic.if tag.

Example:
<pt:logic.variable pt:key="title" pt:value="Administrator"/>
<pt:logic.stringexpr pt:expr="($title) == Administrator" pt:key="boolvalue"/>
<pt:logic.if pt:expr="$boolvalue">
 <pt:logic.iftrue>
  This is displayed if expr evaluates to true.
 </pt:logic.iftrue>
 <pt:logic.iffalse>
   This is displayed if expr evaluates to false.
 </pt:logic.iffalse>
</pt:logic.if>


Tag Information
Tag Namestringexpr

Attributes
NameTypeRequiredDefault ValueDescription
exprstringtruenullA tag variable, followed by a space and a string comparator, and then another space and a string value or another tag variable. The tag variable must be in $ attribute notation surrounded by parentheses. The following operators are allowed: '==' and '!='.
keystringtruenullThe key used to store the result in memory.
scopestringfalseportlet requestThe scope used to store the result in memory. See the Logic tag library description for details about valid scope arguments.


Copyright 2005 Plumtree Software, Inc.