Using legacy forms in iXperion

Release 1.0 - ...

Forms built with the Smartsite 5 form editor are still usable in iXperion through embedding.

First we need to set up a channel that uses the Smartsite Six (legacy) render engine. This is as simple as checking the UseSmartsiteCMSRendering box in the editor.

Use CMS rendering checkbox

Map the application page content type (or create a copy of application page, so you can set a more appropriate editProgId for body) to this channel with a rendertemplate as described here: http://support5.smartsite.nl/smartsite.dws?goto=8723 and here: http://support5.smartsite.nl/smartsite.dws?goto=12881

To get the preview to work in the form editor, map the forms content type to the legacy rendering channel as well. Then add the PreviewChannel="[channel code]" parameter to the Add Form and Edit Form actions. This will override the channel selected in the Options dialog when previewing forms.

Create an application page with the renderform macro on it and any Smartsite CMS specific handling:

<se type="renderform"
formid="27"
FeedbackMessage="Thank you for your input"
/>

Check that this page works in the CMS rendering channel.

To embed the form in an iXperion item use the embeduri macro:

Smartsite SXML CopyCode image Copy Code
<se:embeduri location="/cms/smartsite.dws?id=NAWFORM&amp;ch=mgr" 
usepostdata="true"
fixlinks="true"
save="headSection=this.headsection()"
/>

Use the predefined placeholders to pass the required includes and script to the embedding page:

Smartsite SXML CopyCode image Copy Code
<se:format condition="buffer.get('headSection') != null" inputdata="headSection">
 <se:rowformat expression="this.field('TagName')=='script' AND this.field('URL')!=''">
  {placeholder.addjavascriptinclude(this.field('URL'), ((this.field('Extra')!='') AND (convert.toboolean(string.isempty(this.field('Extra'),'false')))))}
 </se:rowformat>
 <se:rowformat expression="this.field('TagName')=='script' AND this.field('URL')==''">
  {placeholder.addjavascript(this.field('Data'))}
 </se:rowformat>
 <se:rowformat expression="this.field('TagName')=='link' AND this.field('Rel')=='stylesheet'">
  {placeholder.addcssinclude(this.field('URL'), this.field('Extra'))}
 </se:rowformat>
 <se:rowformat expression="this.field('TagName')=='style'">
  {placeholder.addcss(this.field('Data'))}
 </se:rowformat>
</se:format>

For ease of use, this format can be added as a config macro.

Finally, the onload method of the body element from the embedded page should be added to the embedding page. Make sure the functions have a different name at each level, or there will be a naming conflict. So for instance, if the default channel has a render template that uses onload="onLoad()", the Legacy Rendering channel could use onload="doOnload()". Adding the method call to the embedding onLoad method is done with:

Smartsite SXML CopyCode image Copy Code
{placeholder.addjavascriptonload("try { doOnload() } catch(e) {}")}