Important Tags in Fatwire with usage examples

Posted: December 17, 2012 in Fatwire
Tags: , , , , , , , ,

Earlier, in one of my posts, we have discussed some of the important tags in Fatwire. We will now see them in detail, along with their usages as well.

render:satellitepage

This tag is used to insert another page as a pagelet. This page is something which has been created by a siteentry. We can pass arguments to the page using render:argument tag. This tag will invoke the page specified by the pagename parameter of this tag.

Example:

<render:satellitepage pagename=”Sample\Header”>

</render:satellitepage>

render:callelement

Say if I want to call someother element from my page, to perform some logic, we can use this render:callelement tag. This tag will invoke the element specified in the elementname parameter.

Here, elementname is a required field, and scoped is an optional field. The possible values for scoped field are local, stacked, global.

Example:

<render:callelement elementname=”Sample\BusinessLogic” scoped=”global”>
<render:argument name=”variable1″ value=”value” />
calltemplate>

render:calltemplate

If I want to call another template from my template, to display some pagelet / perform some logic, then we should use this render:calltemplate tag. This tag will invoke the template specified in the tname /  tid field.

Here, we have three required fields : site, slotname, tid.

The optional fields are as follows: tname, ttype, c, cid, context, style

The style field helps us in determining whether this tag is going to invoke the template as a pagelet or as an element. The possible values of style field are: pagelet, element, embedded. If embedded is the value of style field, then the template is going to be called as a pagelet, without being cached as an independent page in satellite server.

Example:

<render:calltemplate
site='<%=ics.GetVar(“site”)%>’
slotname=”MainBodySlot”
tid='<%=ics.GetVar(“tid”)%>’
ttype=’Template’
c='<%=ics.GetVar(“c”)%>’
cid='<%=ics.GetVar(“cid”)%>’
tname'<%=ics.GetVar(“templateName”)%>’ >
<render:argument name=”variable1″ value=”value” />
</render:calltemplate>

asset:load

This tag queries the database for the asset which is specified in the type field, along with the objectid. Then loads the asset into the memory. This tag is to be used only with Basic assets. Or else, performance issues may arise. To load flex assets, use assetset:setasset tag.

Example:

<asset:load name=”sample” type=”sampleassettype” field=”samplefield” value=”value” site=”sitename” deptype=”exists” />

asset:get

This tag gets a single attribute value from the asset, which has been loaded earlier into the memory using asset:load

Example:

outputVariable” />

asset:scatter

Retrieves and scatters all the field values from the object loaded in the memory using asset:load

Example:   scatter vs get
<asset:scatter name=”MainArticle” prefix=”main” />
<ics:getvar name=”first:name”/>,

<asset:load name=”NewsSectionFront” type=”Page” field=”name” value=”News” site='<%=ics.GetVar(“site”)%>’/>
<asset:get name=”NewsSectionFront” field=”name” />
<asset:get name=”NewsSectionFront” field=”description” />
<ics:getvar name=”name”/>,

 asset:children

After loading the asset with asset:load, the asset:children tag is used to load the children of that particular asset. This tag queries the AssetRelationTree table and builds the children list.

Example:

This code retrieves the page assets that has been associated under LatestNews association with the parent. This code is to be used only after asset:load.

<asset:children name=”HomePage” list=”LatestPages” objectype=”page” code=”LatestNews”/>

This code retrieves the page assets that have been associated under LatestNews association with the asset specified in the assetid field. This code can be used without loading the asset:

<asset:children type=”Page” assetid='<%=ics.GetVar(“cid”)%>’ list=”LatestNewQuery” objectype=”Query” code=”LatestNews”/>

 More tags along with usage on the way…

Stay Tuned…

Advertisements

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