Posts Tagged ‘tags’


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.

Advertisements

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…


render:calltemplate

The render:calltemplate is one of the well know tag, which is frequently used by the fatwire coders. We will now see the syntax of this tag, and its usage.

USAGE:

This render:calltemplate tag is used when we would like to invoke a Template, or a CSElement, as either a PAGELET (A small part of the page), or an Element, for rendering an asset.

Though we have another tag  “render:callelement” to invoke CSElements, this render:callelement tag is used to invoke both Templates and CSElements as well.

SYNTAX:

The following is the JSP syntax of the render:calltemplate tag. This is in reference with the “Tag Reference” guide.

<render:calltemplate
        site="site name"
        slotname="name of slot"
        tid="caller Template or CSElement id"
       [ttype="caller Template or CSElement"]
       [c="asset type"]
       [cid="asset id"]
       [tname="target Template or CSElement name"]
       [context="context override"]
       [style="pagelet or element or embedded"]
       [variant="template variant name"]
       [packedargs="packed arguments"]>

   [<render:argument name="variable1" value="value1"/>]

</render:calltemplate>

We will now discuss the some important arguments which are specified above.

1. site:  This is a required field. This specifies the name of the site containing the Template to be invoked.

2. slotname: This is also a required field. This attribute defines an user friendly name for the “slot” that is being filled with the called template.

3. tid: This is also a required field. This specifies the id of the template in which this tag is located. If this tag is located in a CSElement, then the value of this attribute should be the id of the CSElement, and ttype should be set to CSElement.

4. context: This is an optional field. If c, cid, and tname are not specified, then this attribute value will be examined to determine which template to call and which asset to render using the specified template.

5. tname: This is an optional field. This field specifies the name of the Template to be called. Typeless templates must be prefixed with a ‘/’. This is required if c and cid are set. If these three attributes are not set, the called template will be determined by looking at context data.

6. style: This is an optional field. The possible values for this field are pagelet, element, embedded.

7. c: This is an optional field. This field specifies the asset type to be rendered by the called Template. The value of this attribute will be passed to the called code.

8. cid: This is an optional field. This field specifies the id of the asset to be rendered by the called Template. The value of this attribute will be passed to the called code. This is required if c is set.

Example usage of render:callelement:

<render:calltemplate tname='<%=ics.GetVar(“ViewTypeVar”)%>’
site='<%=ics.GetVar(“site”)%>’
tid='<%=ics.GetVar(“tid”)%>’
slotname=”PageView”
c='<%=ics.GetVar(“c”)%>’
cid='<%=ics.GetVar(“cid”)%>’
ttype=”Template”>
</render:calltemplate>

In our next post, we will learn how to deal with the “render:lookup” tag, which is frequently used in combination with “render:calltemplate” tag.