Skip to content
HomePagesHomePages template kit

collectionForSlot

Which `COLLECTIONS` entry, if any, a slot definition is bound to.

Which COLLECTIONS entry, if any, a slot definition is bound to.

Keys on the SOURCE alone — no slot-type literal involved: a slot is collection-bound iff its source is direct and names a COLLECTIONS field. That a bound slot’s item must be a record (a list carrying fields) is the authoring gate’s business (@homepages/section-contracts), not this key.

Import from @homepages/template-kit.

function collectionForSlot(slot: { type?: string; source?: { kind?: string; field?: string; }; }): CollectionField | null
Name Type Required Description
slot `{
type?: string;
source?: {
kind?: string;
field?: string;
};

}` | required | |

"units" | "comparables" | "contacts" | null — The collection field name, or null when the slot’s source is not kind:"direct" or names a field outside COLLECTIONS.