Connecting Entries to Pages
FieldtypeEntries connects ProcessWire pages to Entries blueprints and Managed Tables. Under Setup -> Fields -> Add New Field, Entries provides three one-click field presets (FieldtypeEntries::getFieldSetups()): Entry: Reference, Entry: Embedded, and Entry: Managed Table.
Choosing a binding mode
Section titled “Choosing a binding mode”Each ProcessWire page owns its own dedicated root EntryItem (page_id = $page->id). Use this for page-specific specs, hero settings, or repeatable blocks owned by that page.
- Set
bindingModetoembedded. - Leave
blueprintTypeblank to auto-match a blueprint matching$field->name, or point to a specific blueprint or@fieldset:<name>. - Enable
hideWrap = 1to blend the blueprint fields into the page editor without an extra outer fieldset border.
Each ProcessWire page links to one or more shared records from one or more Entries Collections (such as ports, seasons, or amenities).
- Set
bindingModetoreferenceand select one blueprint (blueprintType) or multiple (blueprintTypes: ['ports', 'anchorages']). - Choose
derefAs:FieldtypeEntries::DEREF_ARRAY(0):EntryArray(always iterable)FieldtypeEntries::DEREF_SINGLE_OR_NULL(1):?EntryItemFieldtypeEntries::DEREF_SINGLE_OR_EMPTY(2):EntryItem(NullEntryItemwhen empty, safe for$page->port->title)
- Configure
trashEntryRefs(TRASH_REFS_KEEP = 0keeps UUIDs so restoring from Trash restores the link;TRASH_REFS_REMOVE = 1strips trashed UUIDs) andallowUnpub(0hides unpublished items when formatted;1keeps them selectable and visible). - Optionally attach a
pivotBlueprintto store per-link attributes alongside each reference.
Connect a ProcessWire page directly to records in a high-volume Managed Table ($entries->tables()).
- Set
bindingModetotable. - Specify
tableHandlepointing to your declared table blueprint.
Filtering selectable entries (findItemsSelector)
Section titled “Filtering selectable entries (findItemsSelector)”In Reference Mode, constrain which records editors can pick using:
blueprintTypes: Allow records from multiple collections (['ports', 'anchorages']).parent_id: Forhierarchical: truecollections, restrict options to children of a specific root UUID.findItemsSelectorwith dynamic=page.fieldinterpolation: Filter choices using values on the currently edited ProcessWire page:country=page.countryresolves$page->country(supportingEntryItem::id,Page::id, or scalar values).season_code=page.charter_season.codetraverses nested properties on the current page.
Editor widgets (InputfieldEntries and native selectors)
Section titled “Editor widgets (InputfieldEntries and native selectors)”On the field’s Input tab, choose between the interactive React workspace or native ProcessWire selection inputs:
- Interactive React Workspace (
InputfieldEntries): Supports five display styles (picker,table,cards,kanban,calendar),tableColumns,cardColumns(1..4),previewImageField,hideSelected, inline creation (addable), modal quick-edit (allowQuickEdit), inline publish toggle (allowStatusToggle), and one-click clone (allowQuickClone). - Native ProcessWire delegates:
- Single-value:
InputfieldSelect,InputfieldRadios,_InputfieldTextTags - Multi-value:
InputfieldAsmSelect,InputfieldCheckboxes,InputfieldSelectMultiple,InputfieldTextTags
- Single-value:
- Custom labels: Set
labelFieldName(orlabelFieldName = '.'withlabelFieldFormat = '{title} ({port_code}) - {country.title}').
Adding a FieldtypeEntries field
Section titled “Adding a FieldtypeEntries field”-
Open Setup -> Fields -> Add New Field, pick one of the Entry: presets (or choose Entries (
FieldtypeEntries)), name your field, and click Save. -
On the Details tab, select the Binding Mode, target blueprint(s),
derefAs,minItems/maxItems, and optionalpivotBlueprint. -
On the Input tab, choose the widget style, label format, and
findItemsSelector. -
Save the field and add it to your template under Setup -> Templates.
Programmatic field setup (EntriesField)
Section titled “Programmatic field setup (EntriesField)”<?php
declare(strict_types=1);
namespace ProcessWire;
$fields = $this->wire()->fields;
/** @var EntriesField $field */$field = $fields->get('departure_port') ?? $this->wire(new EntriesField());$field->name = 'departure_port';$field->label = 'Departure Port';$field->type = $this->wire()->modules->get('FieldtypeEntries');$field->setBlueprint('ports');// Multi-blueprint or hierarchical scoping:// $field->setBlueprints(['ports', 'anchorages'])->setParent($rootUuid);$field->derefAs = FieldtypeEntries::DEREF_SINGLE_OR_EMPTY;$field->inputfieldWidget = 'cards';$field->cardColumns = 3;$field->labelFieldFormat = '{title} ({port_code})';$field->addable = true;$field->allowQuickEdit = true;$field->allowStatusToggle = true;$field->allowQuickClone = true;
$fields->save($field);Querying ProcessWire pages by entry subfields
Section titled “Querying ProcessWire pages by entry subfields”FieldtypeEntries integrates directly with $pages->find(), including system subfields (.id, .name, .status, .count) and same-row @ pivot correlation:
<?php
declare(strict_types=1);
namespace ProcessWire;
// Embedded or referenced entry subfields$yachts = $pages->find('template=yacht, charter_rates.season=high, charter_rates.price<=20000, limit=24');
// Negative, empty, and count queries$nonLow = $pages->find('template=yacht, charter_rates.season!=low, limit=24');$unassigned = $pages->find('template=yacht, charter_rates.season="", limit=24');$multiRate = $pages->find('template=yacht, charter_rates.count>=2, limit=24');
// Same-row correlation on pivot references$doubleJacuzzi = $pages->find('template=yacht, @amenities.target.name=jacuzzi, @amenities.quantity>=2, limit=24');Find every page referencing a specific collection entry with $item->referencingPages('template=yacht').
Hooking InputfieldEntries
Section titled “Hooking InputfieldEntries”Customize selectable options or rendered labels dynamically in site/ready.php:
InputfieldEntries::getSelectableItems(?Page $page = null, string $filterSelector = ''): EntryArrayInputfieldEntries::renderItemLabel(EntryItem $item): string