asset:load is used to load basic assets and complex assets like Page, Collection, Query etc.
- Load the basic asset (using
asset:loadtag) - Scatter the loaded basic asset (using
asset:scattertag) OR get the loaded basic asset (usingasset:gettag) - Retrieve information after scattering the asset via
prefix:attributename(usingics:getvartag)
If you know asset type(c) and asset id (cid). This is basically used to retrieve information from the basic asset usually to render on page.
Following example shows retrieving name after the basic asset is loaded and scattered.
<asset:load name="anyName" type='<%=ics.GetVar("c")%>' objectid='<%=ics.GetVar("cid") %>' flushonvoid="true" />
<asset:scatter name="anyName" prefix="asset" />
<ics:getvar name="asset:attribute_name" />OR
<asset:load name="anyName" type='<%=ics.GetVar("c")%>' objectid='<%=ics.GetVar("cid")%>' flushonvoid="true" />
<asset:get name="anyName" field="attribute_name" output="outputVariable"/>
<ics:getvar name="outputVariable" />If you know asset type, a field, value and site. This is generally used to get association using asset:children tag after the asset is loaded.
<asset:load name="anyName" type='<%=ics.GetVar("c")%>' field="attribute_name" value="attribute_value" site='<%=ics.GetVar("site")%>'/>
<asset:get name="anyName" field="attribute_name" output="outputVariable"/>
<ics:getvar name="outputVariable"/><ASSET.LOAD NAME="assetName" TYPE="assetType" OBJECTID="object.id" FLUSHONVOID="true" / >
<ASSET.SCATTER NAME="assetName" PREFIX="variablePrefix" />
<CSVAR NAME="Variables.variablePrefix:attribute_name"/>
<ASSET.LOAD NAME="assetName" TYPE="assetType" FIELD="fieldName" VALUE="fieldValue " SITE="siteName" />
<ASSET.GET NAME="assetName" FIELD="fieldName" OUTPUT="outputVariable" />
<CSVAR NAME="Variables.variablePrefix:attribute_name"/>JSP Documentation for asset:load
XML Documentation for ASSET.LOAD