Customized Archetypes edit form with only one of the fields

I recently had a need for an "administration screen" for an AT-based content that would give the administrators just one field to edit and following that edit, change the workflow state of that piece of content.

Usually, to limit the fields visible in the edit form, I would give those fields different write permissions. Obviously, in this case this was not possible, so I had to take another path. Easiest way to achieve my goal was something like this:

        <metal:body use-macro="body_macro" >
          <metal:block fill-slot="widgets">
            <metal:fieldMacro use-macro="python:here.widget('end_date', mode='edit')" />
          </metal:block>
        </metal:body>
[actions]
action.success = traverse_to:string:workorder_schedule_content_edit
action.success..form_add = traverse_to:string:add_reference
action.success..cancel = traverse_to:string:go_back
action.failure = traverse_to:string:workorder_schedule_edit

From here onward things are easy. Add workorder_schedule_content_edit.cpy form controler script, and its metadata file to point back to the content_edit file.

Comments