IMPORTANT TAGS IN FATWIRE (Continuation):
In this article, we are going to discuss the PROGRAMMING CONSTRUCT TAGS IN FATWIRE. Lets start..!
IF/THEN/ELSE:
This is one of the most common tag used by the object oriented programmers. The working of the construct is similar to that of other language constructs (like java,c, c++,etc). However, it has a different syntax compared to others. Lets see the syntax.
JSP Syntax:
<ics:if condition=”logical expression”>
<ics:then>
tags or text
</ics:then>
<ics:else>
tags or text
</ics:else>
</ics:if>
XML Syntax:
<IF COND=”LOGICAL_EXPRESSION”>
<THEN>
tags or text
</THEN>
<ELSE>
tags or text
</ELSE>
</IF>
Example:
<ics:if condition='<%=ics.GetList(“a:mypage”) == null%>’>
<ics:then>
No values available for this attribute
</ics:then>
<ics:else>
<ics:listloop listname=”a:mypage”>
<ics:listget listname=”a:mypage” fieldname=”value” output=”mypage_id”/>
</ics:listloop>
</ics:else>
</ics:if>
LOOP:
This is the looping construct of FATWIRE. This tag is used to iterate through items in a list. Remember that excess code within these tags affects the performance of the template. Lets see the syntax.
JSP Syntax:
<ics:listloop listname=”some list” [maxrows=”number of loops”] [startrow=”start row”] [endrow=”end row”]/>
XML Syntax:
<LOOP [FROM=”START”] [COUNT=”LOOP_TIMES”] [LIST=”LIST_NAME”] [UNTIL=”END”]>
…
</LOOP>
Example:
<ics:listloop listname=”a:mypage”>
<ics:listget listname=”a:mypage” fieldname=”value” output=”mypage_id”/>
</ics:listloop>
We will see the TAGS THAT LOG DEPENDENCIES in the upcoming posts..
Stay tuned…