Support for contextual editing of fields on the page
See original GitHub issueContextual editing of individual schema fields on the page is often desirable, especially for string fields, and could begin with string field support.
The syntax might look like:
apos.contextField(data.piece, 'title', 'h1')
This would result in minimal markup, to avoid breaking wysiwyg experiences the way a full schema form would. The h1
tag would be contenteditable
, which is hopefully not a choice we’ll regret because no editing UI other than typing text would be allowed. min
, max
and required
would need custom implementation. Markup would need to be escaped and de-escaped, and changes would need to lead to debounced ajax save operations, possibly including changes of the URL (without refresh).
The type
of the doc and the type
of the field would be looked up in the schema to determine what to do, and an informative error thrown if the situation cannot be handled. For instance: at the beginning at least, this probably won’t work for fields of widgets, nested properties, non-string fields, etc.
Something intelligent has to be done if the user presses ENTER in a string
field that doesn’t have textarea: true
.
It would be nice if the helper name was just apos.field
, but in 2.x that is too likely to conflict with a module name at project level. Perhaps in 3.x.
cc @abea
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top GitHub Comments
An objection to
element
is that you can’t put classes on it. We could addattributes
to address that.On Mon, Apr 29, 2019 at 1:14 PM Tom Boutell tom@punkave.com wrote:
–
Thomas Boutell, Chief Software Architect P’unk Avenue | (215) 755-1330 | punkave.com
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.