Field type
pin-map
A picture you click to place the block's repeater children on — touchpoints on a site map, hotspots on a product shot. The field stores only the picture; the pins belong to real child blocks. Single mode: one point per child. Grouped mode (pointsKey): each child has a repeater field of locations, so one card can sit at several places (pins 03a, 03b …). Opens as a popover from the sidebar: click the image to add a pin, click a pin first to add another location to its card, drag a pin to move it, Edit selects that child, × removes it.
Type: pin-map · Stored attribute type: object
Stored value
object — { id, url, alt, width, height }
Supports
- Media-library image chooser; the picture is drawn at its own aspect ratio so a click lands where the eye put it
- Click to add a repeater child with its point set; drag or arrow-key a dot to move it; remove from the list
- Each child's own
pointcontrol drags over the same picture (it finds the parent's image)
Config options
| Option | Type | Default | Description |
|---|---|---|---|
childBlock | string | The child block the map places. Defaults to the block type scoped to this block by its <Repeater allowedBlocks> marker. | |
pointKey | string | point | The child attribute (a point field) that holds where it sits. |
pointsKey | string | Grouped mode: the child's repeater field of locations. Each row holds its own {x, y}; a card with several rows gets lettered pins. Turns grouped mode on (pointKey is then unused). | |
rowPointKey | string | point | Grouped mode: the point sub-field inside a location row. |
rowLabelKey | string | area | Grouped mode: the sub-field naming a location in the popover list. |
labelKey | string | title | The child attribute shown as a card's name in the popover. |
Gotchas
- The block needs a
<Repeater>marker and the child needs apointfield named bypointKey— the map places children, it does not store pins itself. (For pins kept inside one field, usehotspots.) - The repeater it fills loses its canvas Add button — a card is added by clicking the map, where it belongs. Put
addButton="show"on the<Repeater>marker to keep it. - Render each child at
left:X%;top:Y%of a box with the image's aspect ratio — the value is a fraction of the picture, not of a cropped frame.
Example
{ "id": "ctrl_map",
"type": "pin-map",
"label": "Site map",
"attributeKey": "map",
"pointKey": "point",
"labelKey": "title" }Every field also takes the keys common to all fields.