Rules use update.cfm to override the standard edit

Hi All,
Did a bit of searching around and didn’t find a clear solution for this so thought I’d share.

Unlike customising a Types edit form with edit.cfm, Rules require you to use the update.cfm webskin to create a custom edit form. Adding a bit of javascript is also needed to close the modal window once you’re finished as well.

<cfsetting enablecfoutputonly="true" />
    <cfimport taglib="/farcry/core/tags/formtools/" prefix="ft" />
    <!-- this will process the form -->
    <ft:processform action="Save" bHideForms="true">
    <ft:processFormObjects typename="#stObj.typename#" />

<!-- now do this to make the modal disappear when you're finished -->    
<ft:processform action="Save,Cancel" bHideForms="true">
        <script type="text/javascript">

<!-- displaying the form -->    
        <ft:object objectid="#stObj.objectid#" typename="ruleMyRule" lfields="heading,aFiles,catFiles,numItems"  />
        <ft:buttonPanel class="form-actions">
            <ft:button value="Save" class="fc-btn btn btn-primary"  />
            <ft:button value="Cancel" validate="false" />
    <cfsetting enablecfoutputonly="false" />