{formedit:form_id:item_id}

Description

Renders an inline AJAX edit form for an EXISTING item, built from a saved AA form definition. The first argument, form_id, is the object id of a form created in Forms administration (it lists which fields to show and how). The second argument, item_id, is the long id of the item to edit; when omitted, the form edits the current item in context (for example the item rendered by a view). The command returns an empty string when form_id is missing or names no saved form, or when the item cannot be found. It is never cached: the output is a live editing widget, so examples here are illustrative. To render an empty form that ADDS a new item, use form instead of formedit.

Parameters

form_id required default (empty string)

Object id of a saved AA form (created in Forms administration). The form definition lists which fields to show and how. If empty or naming no saved form, the command renders nothing.

item_id optional default the current item in context

Long id of the item to edit. When omitted, the form edits the current item in context (for example the item rendered by a view or item template). If it names no existing item, the command renders nothing.

Examples

virtual{formedit:}
Expected(an inline AJAX edit fieldset for item ITEM_ID, built from the saved form FORM_ID)
Canonical use: FORM_ID is the object id of a form created in Forms administration; ITEM_ID is the long id of the item to edit. Here FORM_ID and ITEM_ID are placeholders, so nothing is rendered.
virtual{formedit:}
Expected(an inline AJAX edit fieldset for the current item in context, built from form FORM_ID)
With item_id omitted the form edits the item in the current context - the typical form inside a view or item template.
test[{formedit:}]
Expected[]
Actual[]
Called without a form id the command produces an empty string - useful as a guard.
test[{formedit:not-a-real-form-id}]
Expected[]
Actual[]
An id that names no saved form (and no item to edit) yields an empty string.