Declare Attribute Tags for Tags Within Tags

You must use the declareAttribute tag when you use an attribute tag in a field, and you use a site template to display that field on your website. The declareAttribute tag is required by the NetSuite tag replacement engine to display embedded tags.

Behind the scenes, the NetSuite tag replacement engine scans each page twice to identify the attributes you use in your custom HTML, and then render all the attributes properly on your web pages. The first time it scans a page, the tag replacement engine identifies the attributes used in each tag on the page. At this time, embedded tags are passed over. On the second pass, it replaces all the tags on the page, including tags that are embedded. Use the declareAttribute tag to point to embedded tags.

Using declareAttribute Tags

You can use declareAttribute tags in item/category templates or Hosted web pages.

For example, you may create an item drilldown template that contains an attribute tag for the detailed description field on an item record:

           <%=getCurrentAttribute('item','storedetaileddescription')%> 

        

The HTML in the detailed description field may contain an attribute tag for the item name:

           <%=getCurrentAttribute('item','storedisplayname')%> 

        

To display all the information in the detailed description field from the item record, you must use the declareAttribute tag for the item name in front of the Attribute tag for the detailed description field. For example:

          <%=declareCurrentAttribute('item','storedisplayname')%><%=getCurrentAttribute('item',
'storedetaileddescription')%>. 

        

Use the appropriate declareAttribute tag listed below to ensure the embedded tag is rendered properly in your site. Note that the declareAttribute tag takes the same parameters as its corresponding Attribute tag.

Syntax:

             <%=declareRecordAttribute('24',34,'custrecord80')%><%=getRecordAttribute('24',34,'custrecord85')%> 

        

Related Topics

General Notices