The AIM rendertemplate
The AIM rendertemplate is used by the AIM scanning process to collect outgoing references.
It consists of two seperate parts:
- Raw, or static scan of AIM-enabled fields, using the aimscan macro
- Collecting dynamically created references by embedding the item in one or more channels
Smartsite SXML | Copy Code |
---|---|
<se:xmlprocessor xmlns:se="http://smartsite.nl/namespaces/sxml/1.0"> <se:parameters> <se:parameter name="xml"> <se:aim> <se:aimscan error="{buffer.set(scanError, string.xmlencode(this.error.message()))}" /> <se:references error="{buffer.set(renderError, string.xmlencode(this.error.message()))}" save="|buffer.set(channel, this.renderedchannel())|" /> </se:aim> </se:parameter> <se:parameter name="actions"> <se:collection> <se:member query="//references"> {sys.iif(buffer.exists(renderError), this.setattribute(renderError, $renderError) )} {sys.iif(buffer.exists(scanError), this.setattribute(scanError, $scanError) )} {sys.iif(buffer.exists(channel), this.setattribute(renderedChannel, string.concat(channel.name($channel), ' (', $channel , ')')))} </se:member> </se:collection> </se:parameter> </se:parameters> </se:xmlprocessor> |
The references macro will try to render each item once, using the list of channels provided in the channels property.
For each item, the first channel in which the item can be rendered will be used.
Smartsite SXML | Copy Code |
---|---|
<se:references channels="CHA" (...) |
You can add channel codes if you know that logic in specific channels in your site creates other references:
Smartsite SXML | Copy Code |
---|---|
<se:references channels="CHA,CHB" (...) |
If no channels property is provided, all browsable channels will be enumerated to find one in which to render each item.
Note that you can specify whether to skip static or dynamic AIM scanning as described above using the NoAim macro in any piece of SXML, and that you can determine whether a request is an AIM rendering request by using the request.isaimrequest() viper method.