Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/reference/field-types/object.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,27 @@ contactInfo: {
|`requiredIf` | Object | `{}` | Conditions to meet before the field is required. [See the guide for details.](/guide/conditional-fields) |
|`hidden` | Boolean | `false` | If `true`, the field is hidden |
|`readOnly` | Boolean | `false` | If `true`, prevents the user from editing the field value
|`options` | Object | `{}` | Optional configuration, see below |

<!-- TODO: The following settings are likely to return, but are not yet implemented. -->
<!-- |contextual | Boolean | `false` | If `true`, it will prevent the field from appearing in the editor modal | -->

### `options`

Object fields have additional settings configured in an `options` object:

#### `flat`

**Type:** Boolean

Setting `flat: true` will remove the visual nesting (left border, indentation) of sub properties within an object. Use in conjunction with `hideLabel` to give your object's schema the appearance of being discreet fields.

#### `hideLabel`

**Type:** Boolean

Setting `hideLabel: true` will hide the top-level field label and begin the schema with the contents of the object. Use in conjunction with `flat` to give your object's schema the appearance of being discreet fields.

## Configuring the array field schema

`object` field schemas are generally configured the same way as the module's overall field schema is configured. The module's schema is configured in its `fields` section's `add` subsection. Similarly, array field schema are configured in a `fields` property, using its `add` subproperty to configure the actual fields. Both use the field names as keys in the `add` object. Both can contain all field types, including nested `object` fields.
Expand Down
8 changes: 4 additions & 4 deletions docs/reference/modules/widget-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ These are options to *the module itself*, so they apply to *every* instance of t
| [`preview`](#preview) | Boolean | Allow for in-context preview during widget edit. |
| [`scene`](#scene) | String | **Deprecated.** Can specify that this widget type requires logged-in assets. |
| [`template`](#template) | String | The Nunjucks template name to render. |
| [`width`](#width) | String | Define the size of the widget modal. |
| [`width`](#width) | String | Define the size of the widget modal. Defaults to `window`. Can also accept `one-third`, `two-thirds`, `half`, and `full` |
| [`origin`](#origin) | String | Define the position of the widget modal (left or right). |

### `className`
Expand Down Expand Up @@ -219,7 +219,8 @@ The name of the template in the `views` folder of the module that should be rend
### `width`

The size of the widget modal can be configured via this option:
- `undefined` (default): the widget modal width is set to 540px.
- `"window"` (default): the widget modal will be a floating window that be moved and resized.
- `"one-third"`: the widget modal width is set to 540px.
- `"half"`: the widget modal takes 50% of the screen.
- `"two-thirds"`: the widget modal takes 66% of the screen.
- `"full"`: the widget modal takes 100% of the screen.
Expand All @@ -230,8 +231,7 @@ No matter what, the widget modal width will take 100% of the screen for screens

### `origin`

Choose the side from where the widget modal will open:
`left` or `right` (default).
Choose the side from where the widget modal will open. If left unset (default) Apostrophe will make a best guess based on the position of the widget on the page. If the widget appears in the left half of the screen, the widget modal is positioned on the right, and vice-versa. Also accepts `left` or `right`.

## Related documentation

Expand Down