CTFP cust:Logic

Release 1.02 - ...

To allow more control over the physical storage of item data without writing custom ContentTypeHandlers or StorageHandlers, Smartsite iXperion introduces the logic section for edit item. The logic section contains VB Script to be executed when loading data for the editor ,but not for rendering (onload), before saving data (onbeforesave) and after saving data (onaftersave).

The DataEditor already had this possibility, where the logic section is an element in the metaxml. A logic section can be added to a content type by setting the cust:Logic ctfp on its Nr field. The value is an xml document fragment containing a <logic> element as its root:

XML CopyCode image Copy Code
<logic>
 <onload type="script"><![CDATA[
 ]]></onload>
 
 <onbeforesave type="script"><![CDATA[
 ]]></onbeforesave> 
 
 <onaftersave type="script"><![CDATA[
 ]]></onaftersave> 
</logic>

The script has access to the ScriptingContext, with the added properties Data, a SmartList of data fields being loaded or saved, Mode, either "add","edit" or "duplicate", Key, the Nr field of the item being edited.