lomaxarchive / custom_feeds_target
Provides custom Feeds target plugins for EDTF and Typed Relation fields
Package info
github.com/lomaxarchive/custom_feeds_target
Type:drupal-module
pkg:composer/lomaxarchive/custom_feeds_target
Requires
- drupal/controlled_access_terms: *
- drupal/feeds: *
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-02 21:15:35 UTC
README
Provides two custom Feeds target plugins so CSV/XML/etc. imports can map directly into:
- EDTF fields (Extended Date/Time Format)
- Typed Relation fields (provided by Controlled Access Terms)
Both plugins are auto-discovered by Feeds for any field of the matching type — no extra configuration is needed to make them available, they just show up as target options in a Feed type's mapping UI.
Requirements
- Feeds
- Controlled Access Terms
(provides the
typed_relationfield type)
Installation
Install as you would any other Drupal module. See the Drupal documentation on installing modules for further information.
EDTF target
Maps a source value straight onto an EDTF field's value property. No
extra configuration — add the mapping in the Feed type's mapping UI like
any other field target.
Typed Relation target
Typed Relation fields store two things per value: a referenced entity
(target_id) and a relation type (rel_type, e.g. relators:aut or
schema:spouse). This target plugin looks up (or optionally creates) the
referenced entity and figures out the relation type, then sets both.
Different typed_relation fields can be configured with entirely different
sets of relators and different allowed target bundles — for example, a
repository item's "Contributor(s)" field
(node.islandora_object.field_linked_agent) uses MARC relator codes
(relators:aut, relators:pht, ...) and only allows Person/Corporate
Body, while a taxonomy term's "Related Entities" field
(taxonomy_term.*.field_relationships) uses a different, schema.org-based
set of relators (schema:spouse, schema:memberOf, ...) that can vary
per bundle, and also allows referencing Family terms. This plugin reads
the relator list and allowed bundles from whichever field a given mapping
actually targets, so the options shown in the mapping UI (and the
shortcode lookup described below) always match that field's real
configuration.
Source value format
The target expects a target_id value in one of two forms:
Name— just the name of the entity to reference.Name;shortcode— the name, followed by a semicolon and a short code (e.g.Jane Smith;aut, orAcme Records;funder). The shortcode is matched (case-insensitively) against the part of each relator key after its colon (relators:aut→aut,schema:funder→funder) to pick the relation type automatically, when no static "Relation Type" is configured on the mapping (see below).
Mapping configuration
When adding a Typed Relation mapping, in addition to the standard Feeds target options (Reference by, Autocreate entity), this plugin adds:
- Relation Type — pick a fixed relator to use for every value in this
mapping, or leave it on "Use shortcode from metadata" to derive the
relator per-value from the
;shortcodesuffix in the source data (see above). The options listed here always come from the specific field this mapping targets. - Bundle — the taxonomy vocabulary to search (and, if "Autocreate
entity" is enabled, create terms in) when resolving the
Namepart of each value. The options listed here are the bundles the field is actually configured to allow referencing.
If a value's shortcode doesn't match any relator configured on the field, a warning is logged and the first relator configured on the field is used as a fallback.
Changelog
See CHANGELOG.md for a history of notable changes.