Posts Tagged ‘Important’


IMPORTANT TAGS IN FATWIRE (Continuation):

In this article, we are going to discuss the TAGS  IN FATWIRE THAT LOG DEPENDENCIES The following are the tags that log dependencies.

The render:logdep Tag:

This is the most common tag, that every Fatwire programmer knows. This tag is used in situations, in which your code can obtain an asset’s data without actually loading the asset.In such a case, be sure to log the compositional dependency yourself with the render:logdep tag. According to the Developer’s guide, “Use the RENDER.LOGDEP tag if your template uses tags that obtain an asset’s data without loading the asset, such as ASSET.CHILDREN.”

At the beginning of the element for each CSElement asset, you include the following line of code:
<render:logdep cid=”Variables.eid” c=”CSElement”/>

At the beginning of the element for a Template asset, the render.logdep statement would be as follows:
<render:logdep cid=”Variables.tid” c=”template”/>

When you try to create a Template or a CSElement, Content Server automatically includes an appropriate render:logdep statement in the code.

The following is the syntax for logdep:

JSP Syntax:

<render:logdep asset=”asset name” cid=”asset id” c=”asset type”/>

XML Syntax:

<RENDER.LOGDEP ASSET=”asset name” CID=”asset id” C=”asset type”/>

The render:unknowndeps Tag:

Use the <render:unknowndeps/> tag when there are dependent assets but that there is no way to predict the identities of those assets because they came from a query or change frequently. You use this tag to cover those coding situations in which you truly cannot determine what the dependent assets might be.

When a compositional dependency is set to “unknown,” it means the page must be regenerated during each Export to Disk publishing session and updated in the page caches after each Mirror to Server publishing session, whether it needs it or not. This tag causes the page or pagelet to be regenerated at every publish because the dependencies cannot be determined. This means that you should use this tag sparingly.

This tag logs a compositional dependency of “unknown” for the rendered page.

The following is the syntax for logdep:

JSP Syntax:

<render:unknowndeps/>

XML Syntax:

<RENDER.UNKNOWNDEPS/>

You must use this tag carefully because the more pages that must be regenerated, the longer it takes to publish your site.


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…


IMPORTANT TAGS IN FATWIRE:

These days, I’m much concentrating on how to work with the TAGS available in FATWIRE. The TAGS which we are going to discuss now are basic and very important tags in Fatwire programming. As it is not possible for me to discuss all these tags in a single post, we will discuss them in different articles followed by this article.

Lets start..

1. Content Server Context tag:

This is the tag that Creates the Content Server Context. This is the first tag , and also the last tag of the JSP or XML. What ever the code that falls between these tags, should be rendered by the content server.  The Full form of FTCS tag is Future Tense Content Server tag.

JSP Syntax:

<ftcs1_0:ftcs>
———–

</ftcs1_0:ftcs>

XML Syntax:

<FTCS>

———-

</FTCS>

2. Tag for displaying the value of a variable:

The tag for displaying the value of a variable is given below for both xml and jsp. It displays the value of a variable, session variable, built-in, etc.

JSP Syntax:

<ics:getvar
name=”variableName”/>

XML Syntax:

<CSVAR
NAME=”variableName”/>

Example:

String l_C =<ics:getvar name=”c”/>     // Gets the value of “c”, i.e., the asset type, and returns the value to a string variable.

String l_C = ics.GetVar(“c”);    // Similar kind of Usage in different form

3. Tag for setting the value of a variable:

SETVAR is the tag for setting the value of a content server variable. The syntax is given below for both xml and jsp:

JSP Syntax:

<ics:setvar
name=”variableName”
value=”variableValue”/>

XML Syntax:

<SETVAR
NAME=”variableName”
VALUE=”variableValue”/>

Example:

<ics:setvar name=”errno” value=”0″/>

4. Tag for setting the session variable:

SETSSVAR is the tag for setting a session variable. The syntax is given below for both xml and jsp:

JSP Syntax:

<ics:setssvar
name=”variableName”
value=”variableValue”/>

XML Syntax:

<SETSSVAR
NAME=”variableName”
VALUE=”variableValue”/>

Example:

<ics:setssvar name=”preferred_locale”  value='<%=ics.GetVar(“default:locale:id”)%>’/>

We will see more tags in the upcoming posts..

Stay tuned…