Important Tags in Fatwire – Part 1

Posted: February 7, 2012 in Fatwire
Tags: , , , , , ,

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…

Advertisements
Comments
  1. Roma says:

    Hi,

    I am new to fatwire. Please tell me how to print a variable on screen using fatwire?

    • KK says:

      Use the ics:getvar tag to get the variable from CS. Then print the variable in normal jsp format.

      Render:stream, String:Stream tags can also do the same work for you.

  2. praneta says:

    Very new to Fatwire ,
    Unable to make my site entry and no idea how to add CS Element to my page Content

    • KK says:

      Praneta… A couple of questions…

      1. Have you enabled the SITEENTRY for your site?
      2. What do you mean by adding CSElement to page content?

      CSElement is used to perform business logic, and not to render any asset. To render any type of assets, you must use templates.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s