Category: Fatwire


Page asset provides Category for categorization purpose. In this article i will explain “how to create new Category for page assets”.

  • Login to system with admin rights
  • Go to Advance environment
  • Goto Admin > Asset Types > Page > Categories

Here we will find all association with page asset (see Figure 1)

Category

Figure 1 – Page Category

To create a new association, click on “Add New Category button”

Category

And fill the form (see Figure – 2)

CategoryForm

Figure 2 – Page Category creation form

Description: Information about this page category. Make it small and informative.
Category Code: This code will be used get the value. This is a 4 char value. Please do not put blank space.

  • Click “Add New Category” Button

Other Related Posts:
Fatwire – How to create new association with page asset

Fatwire initially provides some basic building assets, which we can use while setting up a site. Page, Query, Template, CSElement … is few of them.

Note: Fatwire treat every thing as asset (eg. Template)

Page asset is used to create site plan. We can define child parent relation ship within our site plan using page assets. It totally depends on our design how many level of hierarchy we will use. Its not possible to customize Fatwire provided assets (Page in our case), means we can’t introduce new attributes with these assets. But Fatwire provide a provision to create association. Using association, we can associate any asset type with our page asset.

I have divided this article in two parts:
1. How to create association with page asset
2. How to access associated assets

1. How to create association with page asset?

  • Login to system with admin rights
  • Go to Advance environment
  • Goto Admin > Asset Types > Page > Asset Associations
    Here we will find all association with page asset (see Figure 1)

    Figure 1 - Page associattions

    Figure 1 - Page associations

  • To create a new association, click on “Add New” and fill the form (see Figure 2)
    Figure 2 - Create new Association with Page asset

    Figure 2 - Create new Association with Page asset

    Name: Name of new association, please make it informative, we will be using this name to get the associated assets.
    Description: Description we want to provide. Can be same as name
    Child Asset: If we want to associate only specific asset type, then select that asset type from drop down. If any asset can be associated then leave it “Any”
    Page SubTypes: If we are using page subtypes and want this association with only some specific sub types, then select the sub type otherwise leave it “Any”
    Mirror Dependency Type: It’s a trade off and totally depends on business requirement. Select this value to Exact version if any change to the associated asset will require approval for publish of Page otherwise keep it Exists. I will suggest keeping it Exists.
    Multivalued Association: single valued / multivalued

  • Click “Add New Association” Button
  • We can find this new association on page creation form (eg. See Figure 3)

    Figure 3 - Page Creation Form with Associations

    Figure 3 - Page Creation Form with Associations

    NOTE: We can create number of associations with page assets

2. How to access associated assets?

We can use <asset:children … /> tag to get the associated assets. The syntax is as follows:

<asset:children type=”Page” assetid=’<%=ics.GetVar(“pageId”) %>’ list=”myList” code=”associationName” order=”nrank” />

Description:

type: asset type, “Page” in our case
assetid: Page asset id
list: named list which will refer to the fetched assets. We will use this list to get the asset ids
code: Give the name of association (which we have created)
order: “nrank” to return an ordered list. Applicable in case of multivalued association only.

We can use “myList” to get the associated assets. This list has two attributes (otype, oid)

otype: type of associated asset
oid: id of associated asset

Iterate through the list:

// Check for empty list. Its a common practice to avoid any error. Please see Common errors and their Prevention
<ics:if condition=’<%=null != ics.GetList(“myList”)&& ics.GetList(“myList”).hasData() %>’>
<ics:then>

<ics:listloop listname=”myList”>

<ics:listget listname=”myList” fieldname=”otype” output=”c” />
<ics:listget listname=”myList” fieldname=”oid” output=”cid” />

</ics:listloop>

</ics:then>
</ics:if>

Next Read :
Fatwire | How to create new Category with Page asset

  1. ics:listloop tag failure
  2. Invalid type specified: Page
  3. Need a ‘ID’ field & Need a ‘Type’ field
  4. ics:setvar missing or empty argument value
  5. Error: no object named <ObjectName>
  6. Error -101 in tag ics:selectto with table Template_Composition

1. Error: ics:listloop tag failure

Root Cause: This error occur if asset type [c] and/or asset Id [cid] passed to tag <assetset:setasset/> or <asset:load/> is NULL.

<ics:listloop listname=”myList”>

</ics:listloop>

Solution: Always apply null check before iterating a list.

<ics:if condition=’<%=null != ics.GetList(“myList”) && ics.GetList( “myList” ).hasData() %>’>
<ics:then>

<ics:listloop listname=myList”>

</ics:listloop>

</ics:then>
</ics:if>

2. Error: Invalid type specified: Page

Root Cause: This error occurred, If type passed to <assetset:setasset /> tag is a basic asset eg. Page. As Page asset is basic type asset. And this tag is meant to load Flex Asset.
This code will give “Invalid type specified: Page” error:

<ics:setvar name=”c” value=”Page“/>
<ics:setvar name=”cid” value=”123456789″/>
<assetset:setasset name=”asset” type=’<%=ics.GetVar(“c”)%>’ id=’<%=ics.GetVar(“cid”)%>’ />

Solution: Check asset type and use <asset:load> tag for basic assets.

<ics:setvar name=”c” value=”Page“/>
<ics:setvar name=”cid” value=”123456789″/>

<ics:if condition=’<%=“Page”.equals(ics.GetVar(“c”)) %>’>
<ics:then>

<asset:load name=”AsscAsset” type=’<%=ics.GetVar(“c”)%>’ objectid=’<%=ics.GetVar(“cid”)%>’/>

</ics:then>
<ics:else>

<assetset:setasset name=”AsscAsset” type=’<%=ics.GetVar(“c”)%>’ id=’<%=ics.GetVar(“cid”)%>’ />

</ics:else>
</ics:if>

3. Error: Need a ‘ID’ field & Need a ‘Type’ field

Root Cause: This error occur if we try to iterate through an uninitialized list.
Solution: We should put NULL check on c and/or cid in such a situation where there is possibility for NULL value.

<ics:if condition=’<%=ics.GetVar(“c”) != null && ics.GetVar(“cid”) != null %>’>
<ics:then>

<assetset:setasset name=”myAsset” type=’<%=ics.GetVar(“c”)%>’ id=’<%=ics.GetVar(“cid”)%>’/>

</ics:then>
</ics:if>

4. Error: ics:setvar missing or empty argument value

Root Cause: This error occur if we try to set null as value in <ics:setvar /> tag.
Solution: Set some Default value for variable at the top of the page or Write code in a manner so that no chance to NullPointer, NumberFormat … exception.

5. Error: no object named <ObjectName>

Root Cause: This error occurred when asset loaded is NULL and we are trying to get data from the object.

<asset:load name=”TestObject” type=’<%=ics.GetVar(“c”) %>’ objectid=’<%=ics.GetVar(“cid”) %>’ />
<asset:get name=”TestObject” field=”id” output=”asset:cid”/>

Solution: Put NULL check on object before getting data out of it.

<asset:load name=”TestObject” type=’<%=ics.GetVar(“c”)%>’ objectid=’<%=ics.GetVar(“cid”) %>’ />
<ics:if condition=’<%=ics.GetObj(“TestObject”) != null %>’>
<ics:then>

<asset:get name=”TestObject” field=”id” output=”asset:cid”/>

</ics:then>
</ics:if>

6. Error: Error -101 in tag ics:selectto with table Template_Composition

Root Cause: If there is no record found for SQL for tag <ics:selectto/>, then it returns (-101) Error code.
Solution: I will suggest to use SQL query (using <ics:sql /> tag) instead of <ics:selectto/>. Also Its always good to use SQL query (with join in 3-4 tables) instead of <asset:load> tags … Its a trade off and you are the best person to decide which one to use.

Caching is always a broad topic in any design. Every CMS/Framework provides its own ways to implement cache. I am using Fatwire 7 CMS. Fatwire provide 2 level of caching:

  1. Content Server Cache (CSCache)
  2. Satellite Server Cache (SSCache)

Note: I will use CS and SS for Content Server and Satellite Server.

Let’s have a look how fatwire serve a request:

  • Every time a user (End user) hit a page (A), the request goes to SS
    SS check if the requested page/pagelete is available in its cache. If the requested page/pagelate is available in SS cache, then it servers the requested page back to end user (E,F) otherwise SS request CS to provide it the requested page/pagelete (C)
    CS check if the requested page/pagelete is available in its cache. If the requested page/pagelate is available in CS cache, then it servers the requested page back to SS (D) otherwise CS follow the following steps:

    • CS process the code (Templates/CSElements) to generate the requested page/pagelete.
    • Cache* the page/pagelete on CS
    • Return the output to SS (D)
  • Now, SS cache* the processed page/pagelete and return the complete page back to requested user (E,F)

* Its not necessary that we cache every page/pagelete. If a page is cached but it’s internally calling number of uncached Elements (CSElements/Templates) then the cached page save the call for that element instead of html output. So every time a user request for a page, these uncached elements will got evaluated on CS.

Follow

Get every new post delivered to your Inbox.