Skip to content
  1. Extras
  2. PageBuilder
  3. Field types
  4. Pro
  5. relation

Field relation

Version: Pro.

Why this type

Modal picker with search, not manual id. SearchAction for ms3 and custom connectors. Data stores id and pagetitle, not full resource.

When to use

  • Link to About page or MS3 product
  • One related resource in section
  • Internal link with readable title in chunk

Tips

Multiple resources use multirelation. XPDO class id without modal is combo.

Similar types

Schema

json
{
  "name": "product",
  "type": "relation",
  "label": "Product",
  "searchAction": "mgr/ms3/products/search",
  "tab": "Content",
  "width": 100,
  "active": true
}

Value

Object { id, pagetitle, … }.

Section data

Key product in the section data (picker stores only the selection):

json
{
  "product": {
    "id": 42,
    "pagetitle": "About us"
  }
}
  • Manager search may show uri and context_key, but data stores id and pagetitle.

Chunk example

fenom
{if $product.id}
  <span class="related">{$product.pagetitle|escape}</span>
{/if}

Common properties

For fields with name that are stored in the section data:

KeyTypeRoleCMP
tabstringGroup subtitle in the inspectoryes
width25–100Field width as % of the row (flex)yes
descriptionstringHint under the labelyes
defaultanyInitial value for a new sectionyes
activeboolfalse hides the field in the inspectoryes
requiredboolRequired on publish (draft still saves)yes
  • Also: searchAction for a custom connector (e.g. ms3).

See fields overview.

See also