Part of the Feeds ecosystem · 38 projects
This plugin allows you to import taxonomy terms from a hierarchical structure, such as "Parent > Child > Grandchild," creating terms as needed. It ensures that imported terms are correctly placed within their designated vocabulary and hierarchy.
Feeds Tamper Term Hierarchy turns a category written as a path, such as Animals > Dogs > Food, into taxonomy terms during a Feeds import. It creates the levels that do not exist yet, each under the one before it, and the term reference field of the imported item gets the term at the end of the path. For catalogs, directories and any source that holds its categories as a path.
Features
- ๐ณ A hierarchy from a path. Each level of the path that does not exist yet is created under the level before it, in the vocabulary you choose.
- ๐ท๏ธ Names matched within their parent.
Animals > Dogs > FoodandAnimals > Cats > Foodgive two Food terms, one under each parent. Importing the same feed again finds the terms of the first run instead of duplicating them, and a new level under an existing branch creates only that level. - โ๏ธ Existing vocabularies. With Allow terms to be auto created off, a value whose terms do not exist is skipped instead of created. With Match the first term anywhere in the hierarchy on, a partial path such as
Dogs > Foodattaches to the Dogs already under Animals. - ๐ค Untidy sources. Spaces around each level are trimmed, and empty levels, as in
Animals > > Foodor a trailing delimiter, are skipped instead of saved as terms without a name. - โก Repeated categories looked up once. The plugin remembers the terms it has resolved, so rows that repeat a category do not query the database again: 300 rows repeating three paths made 7 term queries, one per distinct level.
Quick start
composer require drupal/feeds_tamper_term_hierarchy drush en feeds_tamper_term_hierarchy
- On your feed type's Mapping tab, map the column that holds the path to the term reference field, open its settings and set Reference by to Term ID.
- On the Tamper tab, add Import Taxonomy Terms Hierarchy to that column.
- Set the Input delimiter and the Vocabulary, and save.
- Import the feed. The vocabulary now holds every path as a hierarchy, and each item references the term at the end of its path.
The category column mapped to the Category field by term ID.
Good to know
- The plugin hands the mapping a term ID, so the target has to reference terms by Term ID. On the default, Term name, Feeds finds no term named after that number: the vocabulary gets the hierarchy, but the items are saved with the field empty, and with Autocreate entities on they are not imported at all.
- One value holds one path. When a column holds several, add Tamper's Explode plugin before this one, splitting on the separator between paths.
- Names are matched as Drupal compares them, without regard to case:
dogsfinds an existingDogs. - With Match the first term anywhere in the hierarchy on, when several terms share the first name of the path, the first match wins.
Additional requirements
- Drupal 10.2 or later, or Drupal 11.
- Tamper 1.0 or later.
- The Taxonomy module from Drupal core.
- Feeds Tamper and Feeds, to use it in a Feeds import.
Community documentation
- README: the settings, the mapping by term ID, and several paths in one column.
Supporting this module
Developed and maintained by Bloomidea. Bloomidea offers support and custom development for this module.
Ask your assistant about Feeds Tamper Term Hierarchy
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
- Tamper
- taxonomy Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
More in the Feeds ecosystem
Most installed first