{editfull:item_id:field_id:required:function:widget_type:widget_properties}

Description

Renders a ready-to-submit edit widget for one field of an item, WITH its label and help text. It is the labelled form of edit: same parameters, same behaviour, but editfull wraps the input in the full form row (label, the required asterisk, and the field help), while edit shows the bare widget only. Use it to build in-place editing forms - typically inside a slice or view template where an editor is logged in. The widget is pre-filled with the field current value and posts back to AA on submit. With an empty item_id the command edits the CURRENT item in context (the item being rendered in the loop). Without a field_id, or for a field that does not exist on the item slice, it renders nothing. By default it shows the widget configured for that field; pass widget_type to override it (for example sel, dte, chb) and widget_properties (a JSON object) to set options such as const_arr, name and input_help. editfull is never cached - it always reads the live item from the database.

Parameters

item_id optional default empty (current item)

Id of the item whose field you want to edit. Leave empty to edit the CURRENT item - the one being rendered in the surrounding view or slice loop.

field_id required default (none)

The 16-character field id to edit, such as headline........ or category......... Without it the command renders nothing.

required optional default empty (not required)

Set to 1 to mark the field required: the wrapper gets data-aa-required, the input gets the HTML required attribute, and the label shows an asterisk. Empty or 0 leaves it optional.

function optional default empty

A JavaScript function run after the widget is submitted (for live or ajax-style saving). Leave empty for a plain form input.

widget_type optional default empty (field default widget)

Override the widget used for the field. Empty uses the field configured widget. Pass a 3-letter widget code such as sel (drop-down), dte (date), chb (checkbox), txt (textarea).

widget_properties optional default empty

A JSON object of widget options. Common keys: name (overrides the label), input_help (overrides the help), and const_arr (value-to-label map for sel). Example: {"name":"Project name","input_help":"Fill it in"}.

Examples

virtual{editfull:3b615788d96378c28e368d7fb3d7a44a:headline........}
Expected
Headline of the news
Headline of the news
">Actual
Headline of the news
The labelled widget: a div.aa-widget wrapping a label (the field name, Headline), the input pre-filled with the field current value, and the field help below. This is the everyday use - put it in a view or slice template to let a logged-in editor change one field in place. The bare-widget form is edit (no label, no help).
virtual{editfull::headline........}
Expected
">Actual
An empty item_id means the CURRENT item - the one being rendered in the surrounding loop. So {editfull::headline........} (note the empty first segment) edits the headline of whichever item the view is on, with no hard-coded id. Output here shows the label and the current item value.
virtual{editfull:3b615788d96378c28e368d7fb3d7a44a:headline........:1}
Expected
...
...
">Actual
Headline of the news
A third segment of 1 marks the field required: the wrapper gets data-aa-required and the input gets the HTML required attribute (and the label shows the asterisk). The same field without it stays optional.
virtual{editfull:3b615788d96378c28e368d7fb3d7a44a:switch..........:::sel:{"const_arr":{"0":"no","1":"yes"}}}
Expected
">Actual
The fifth segment overrides the widget; here sel renders a drop-down instead of the field default. The sixth segment is a JSON object of widget options - const_arr maps stored value to label (0 to no, 1 to yes). The current value is pre-selected. Use this to present a coded field as a friendly picker. Note the empty third and fourth segments (required and function) before the widget type.
virtual{editfull:3b615788d96378c28e368d7fb3d7a44a:headline........::::{"name":"Project name","input_help":"Fill in the project name"}}
Expected
Fill in the project name
Fill in the project name
">Actual
Fill in the project name
The widget_properties JSON also overrides presentation: name replaces the label and input_help replaces the help text. Same field, friendlier wording for the editor. All four middle segments (required, function, widget_type) are empty here, so only the properties change.