-
Notifications
You must be signed in to change notification settings - Fork 17
feat: Form element custom rendering in Content Fragment Editor #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
930fec4
f3c2464
a833bd3
72bddad
8112179
0c2be7a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
--- | ||
title: Custom form element rendering - AEM Content Fragments Editor Extensibility | ||
title: Form elements custom rendering - AEM Content Fragments Editor Extensibility | ||
description: Learn how to customize a form field rendering in AEM Content Fragments Editor | ||
contributors: | ||
- https://github.com/AdobeDocs/uix | ||
--- | ||
|
||
# Custom form element rendering | ||
# Form elements custom rendering | ||
|
||
This feature allows third-party developer to build custom input UI for specific fields or types of fields. | ||
|
||
|
@@ -67,14 +67,31 @@ function CustomField() { | |
} | ||
``` | ||
|
||
## API Reference | ||
## API reference | ||
|
||
| Field | Type | Required | Description | | ||
|--------------|-----------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| url | `string` | ✔️ | URL of the page to load in the iframe that will replace the original field. The URL must have the same origin as the extension declaring the rules for field replacement. | | ||
| pathExp | `string` | | RegExp for "fragment content" path | | ||
| modelPathExp | `string` | | RegExp for "fragment content model" path | | ||
| fieldTypeExp | `string` | | RegExp for field type | | ||
| fieldNameExp | `string` | | RegExp for field name | | ||
### Override rules definition API | ||
|
||
Allowed values in `getDefinitions` when registering override rules. | ||
|
||
| Field | Type | Required | Description | | ||
|----------------|-----------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `url` | `string` | ✔️ | URL of the page to load in the iframe that will replace the original field. The URL must have the same origin as the extension declaring the rules for field replacement. | | ||
| `pathExp` | `string` | | RegExp for "content fragment" path. | | ||
| `modelPathExp` | `string` | | RegExp for "content fragment model" path. | | ||
| `fieldTypeExp` | `string` | | RegExp for field type. | | ||
| `fieldNameExp` | `string` | | RegExp for field name. | | ||
|
||
At least one valid expression must be specified: `pathExp`, `modelPathExp`, `fieldTypeExp`, or `fieldNameExp`. | ||
|
||
### Host API | ||
|
||
Methods that can be called on the `conn.host.field` object during rendering logic implementation. | ||
|
||
| Method | Description | | ||
|-----------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| `getModel(): Object` | Return Content Fragment Model for the currently edited Content Fragment. | | ||
| `getDefaultValue(): mixed` | Returns the initial value for the input we are replacing. | | ||
| `getValidationState(): invalid|valid` | Returns the validation state value for the input we are replacing. | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it string with two possible values or a boolean? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| `onValidationStateChange(Function callback): void` | Accepts a callback that will be called when the validation state changes for the input we are replacing. | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is a callback signature? Does it accept any arguments? |
||
| `onChange(Function callback): void` | Accepts a callback that will be called when the value of the input we are replacing changes. | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is a callback signature? Does it accept any arguments? |
||
| `setHeight(number|"auto" height): void): void` | Sets the height value of the frame in which custom UI for the input we are replacing is rendered. A number of pixels, a CSS value, or the string auto. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we describe at least major fields of the object?