Questions tagged [taxonomy-terms]

"Taxonomy" refers to Drupal's content classification mechanism, organised into vocabularies and terms.

Filter by
Sorted by
Tagged with
0
votes
1answer
31 views

Have a child node inherit taxonomy from a parent during /node/add?

In Drupal 7, I have two content types: Parent Events with tags (like "outdoors" or "popular" or "suitable for kids"). "Tags" are taxonomy terms in a vocabulary,...
8
votes
3answers
3k views

How can I hide the entity ID on an autocomplete widget?

I have an autocomplete widget for a taxonomy entity reference. Every term shows its entity ID between parentheses; plus, if the term name contains spaces, it appears between quotes, e.g. "Lorem ...
0
votes
1answer
534 views

How to programmatically manage taxonomies?

I'm working on a project with this requirement: there will be a couple of custom content types where many fields comes from taxonomies references. Many of these taxonomies have plenty of terms (50+). ...
1
vote
1answer
25 views

Why taxonomy term view is showing only a single content?

I'm working on customizing some templates on an existing Drupal 8 site. I was about to start working on the taxonomy term page but noticed only a single content is showing in it. I already checked and ...
1
vote
1answer
219 views

taxonomy_term entity loadByProperties depth not found

The terms returned contain depth as a Term object attribute. $vocabulary = 'category'; $entity_manager = \Drupal::entityTypeManager(); $entity_storage = $entity_manager->getStorage('taxonomy_term');...
0
votes
3answers
2k views

Remove duplicate records from views feed display for node with multiple grouped terms from one vocabulary

I have an RSS feed display in a view, and one of the fields in the view is a multi-value taxonomy reference field. The feed settings have a "Grouping field" setting, and I've chosen that field (and I ...
8
votes
7answers
6k views

How to import taxonomy with hierarchy?

We're upgrading our site from D7 to D8, which has vocabulary containing multi-level parent-child hierarchy. The list is too long (around 5K-10K terms) to import manually. We've tried using migrate in ...
0
votes
1answer
44 views

Limit views exposed filter options to terms with associated nodes of content type X

I have a module which limits the options in a views exposed filter to terms which have associated nodes. The code is based on this answer: How can I limit the exposed filters to only display values ...
0
votes
0answers
30 views

Render content to multiple nodes from one input

I'm looking to create a dropdown of country selects each with two fields: field_item_title and field_button_link across multiple nodes. The content is populated by repeating nested paragraph fields. (...
1
vote
3answers
2k views

How to create a view of hierarchical taxonomy terms and their nodes?

I'd like to create an HTML sitemap viewable by a human. I mention that I'd like to keep the hierarchy (tree structure of categories with subcategories) like the following: - TERM_A - Node a - ...
1
vote
1answer
125 views

How can I use Migrate API to migrate taxonomy with an unknown level of parent child relationships in tact?

I have a JSON file with an entry that looks like this: "taxonomy": "abc/historical_controls/abc2000_2013" In my YML file I have it mapped like this: field_abc_asset_taxonomy_auto: - ...
2
votes
2answers
5k views

How do I get the taxonomy term's path alias?

I have come up with a need to show a node term's URL alias using plain php in drupal 8 but I can't figure out how to do it. In my custom module, I want to get /fruits/apples in a variable upon loading ...
0
votes
2answers
186 views

How to programmatically associate a taxonomy term to a field

I'm trying to import user profiles data from a JSON file. Several fields are entity reference to vocabularies. I'm able to create a new taxonomy term entity in the universities vocabulary bundle ...
0
votes
1answer
40 views

How to make a facet search on a taxonomy term contained in a paragraph contained in a content type?

On Drupal 8, I try to make a facet on a taxonomy term contained in a paragraph entity contained in a content type. Is it possible? My stack : Druapl 8.9.0 + Search API 8.x-1.17 + Facets 8.x-1.5 In ...
-1
votes
2answers
26 views

Looking for a solution to add taxonomy after user submitted a node?

I want users to be able to publish content without having to associate it with a specific taxonomy term. They only have access to taxonomy tags. I would like to be able to assign content to categories ...
1
vote
1answer
1k views

Checking for string in variable fails in twig

I'm working on a twig template for use with a commerce product. Each product has a term applied to it like "Green Ball", "Yellow Ball", "Red Block", and "Purple Block". I'm trying to take the ...
0
votes
3answers
56 views

How can I delete a poorly named vocabulary?

I've created a couple of vocabularies programmatically, and accidentally included some spaces in the machine names (caused by bad data in an input CSV). I can't delete these vocabularies with ...
1
vote
1answer
24 views

how to add attributes of the parent taxonomy in the DOM?

I am displaying a taxonomy "category" on a node, a view of that node ,and a search facet. This taxonomy has 2 levels. How can i add to the rendered HTMLs, i guess using preprocessing hooks, ...
0
votes
1answer
36 views

List of parent and child taxonomies and related content

I would like to show in the front page a list of dishes. Like a real restaurant menu, I would like see: Wines -Whites --Product 1 --Product 2 -Reds --Product 3 --Product 4 Beers -...
0
votes
0answers
57 views

Alter webform-term-select options

I have a select input that's pulling it's options from one of our site's vocabularies. I'd like, however, to alter the options to include a data attribute based upon a custom field within the term. ...
1
vote
0answers
72 views

When using “Filter by an entity reference view,” can I enable the “Create referenced entities if they don't already exist” option?

I have an entity reference field for taxonomy terms on a node. The Default Reference method has the option Create referenced entities if they don't already exist. This lets me add new terms via the ...
1
vote
3answers
108 views

For content, what are the differences between nodes and terms

I am debating whether to use nodes or terms to store a large amount of content in Drupal. There are a lot of similarities between nodes and terms in Drupal 8/9: Both can add any type of field. Both ...
0
votes
1answer
389 views

Problem with node revisions and taxonomy terms

I have a content type with a number of fields including a checkbox which allows you to select one or more taxonomy terms. If I create a new version of a node, all the previous taxonomy terms are ...
2
votes
2answers
3k views

How do I get the current taxonomy term from the plug-in context?

When on a node, the following annotation will obtain the node from the context: /** * @Condition( * id = "node_type", * label = @Translation("Node Bundle"), * context = { * "node" = @...
1
vote
1answer
3k views

How to get term alias in twig templates

I have created a block to show the sibling terms of the term being viewed. In the twig template I am looping through the terms to display the names linked to their respective pages. Now I unable to ...
0
votes
1answer
17 views

Different custom view per taxonomy

I'm currently working on my first Drupal 8 project and while many things are now integrated in the core, others still stump me (for example restoring options to now bare bones CKEditor requires like 4 ...
0
votes
2answers
177 views

How can I export and then import taxonomy terms?

So I built my own custom entity type (we'll call it notes). And on my notes I have fields that use taxonomy terms, however when it comes to exporting the data out on individual fields, it shows the ...
-1
votes
1answer
38 views

Is there a way to create a list of Vocabulary (Replicate this page: /admin/structure/taxonomy)

I have created a custom layout and in that i want to show the content of this page -> /admin/structure/taxonomy. Please suggest if there is any way out. Thanks
1
vote
1answer
47 views

How can I change which view wins over two using the same path?

I have two views in Drupal 8. The standard Taxonomy term (content) view, path: /taxonomy/term/% My custom view for just one term at path: /term-alias When I go to my custom term, I see the view for ...
0
votes
1answer
33 views

View to display all child taxonomy terms

I have a content type called "Unit Staff" with a term reference field called "Department". I also have a vocabulary called "Person" which is using a paragraph field ...
0
votes
2answers
138 views

Display only taxonomy parents from an entity reference field

Is there a taxonomy entity reference field formatter to display only taxonomy parents from hierarcherical taxonomy elements ? Else what could be the way to display, from an entity reference field, ...
0
votes
0answers
10 views

Views aggregation for taxonomy based results in views working

I have created a view which lists contacts and groups them by office. However some contacts show up multiple times (I'd assume that is since some use taxonomy for their job titles, and some have more ...
0
votes
0answers
151 views

Taxonomy terms and vocabulary in form selection

I 'm trying to insert vocabulary terms in my form Only one term appears, but there are more of it. Here is my code in .module file <?php use Drupal\Core\Form\FormStateInterface; /** * ...
0
votes
1answer
56 views

Hierarchy of content types with taxonomy as parent

What would be the best way to implement a hierarchical structure like this: (A) Taxonomy term from single vocabulary (B) Some content type with parent of type A (C) Some content type with parent of ...
4
votes
3answers
6k views

How do I theme the teaser?

As shown in the picture, I have the teaser view of a taxonomy term (Virtual Tour) which shows the node title, the node summary, the submission date, and an image added in an image field. What I would ...
0
votes
1answer
23 views

Include referenced term's custom fields in node view with content display

I have a taxonomy term reference field in a node (D8). I have a content (node) view that needs to use a content display rather than fields. The term is selected, but not the custom fields that have ...
4
votes
1answer
4k views

Show parent taxonomy term in view

I have taxonomy countries list with cities Czech Republic - Prague - Brno Germany - Berlin Then I have content type position where I am using this taxonomy as select list. Now I need to create ...
38
votes
6answers
28k views

Programmatically create a term?

I'm attempting to add a lot of terms (~200) to a vocabulary, but I can't find any import modules that are updated for Drupal 8, and it seems the functions for doing this in Drupal 7 don't exist in ...
1
vote
3answers
2k views

Output taxonomy term in views unformatted using twig

I'd like to output taxonomy terms as html classes for view-rows in the views unformatted template for Drupal 8. My code: {% if title %} <h3>{{ title }}</h3> {% endif %} ...
5
votes
2answers
1k views

Error when viewing list of taxonomy terms

I'm getting an "unexpected error" when I try to view a list of taxonomy terms. I recently updated to 8.7, though I have a feeling the problem has been around since before the update. Here's the error ...
3
votes
1answer
4k views

How do I get all children's taxonomy term IDs? [closed]

How do I get all children's taxonomy term IDs in Drupal 8? $tree = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadTree($vid); uses the taxonomy term name, not the taxonomy term ...
0
votes
1answer
159 views

Migrating content with referenced taxonomy field is to be migrated by term name

Is it possible to migrate content with term reference fields, but instead of referencing terms by their tid they are referenced by their term name? instead of this: field_tags: plugin: ...
1
vote
0answers
17 views

Using Taxonomy in drupal

I need to create a custom form with a vendor dropdown ("Vendor A", "Vendor B") and a list box with multiple options belongs to selected vendor. Once a user select Vendor from dropdown, list box will ...
0
votes
0answers
22 views

Display taxonomy field in view on content page [duplicate]

Using Drupal 8.8.1, I am trying to display taxonomy fields in views on content pages tagged with that taxonomy. Essentially the content page would have an image header from the taxonomy image field, ...
0
votes
3answers
24 views

Creating a view which lists all taxnomy terms and the number they appear in a content type?

So i have a taxonomy called Product Warnings, and it has around 10 terms. This taxonomy is referenced in several content types (Small products, Large products, etc), and can be selected multiple times ...
1
vote
1answer
1k views

print custom image field for taxonomy page (page--taxonomy.html.twig) template

How do I load an image from a taxonomy custom field into a custom location on the taxonomy page template? It's easy to accomplish it when the image is in a node. The following code works for images, ...
0
votes
0answers
9 views

How do I restrict access to a taxonomy/term page?

My drupal expert left, and I found my taxonomy term page is visible. I found this possible solution on your site, but can you tell me how to restrict the access please? 14 A lightweight solution is ...
-2
votes
1answer
104 views

Creating content with a hierarchy

I want to create hierarchical content in Drupal, and I am trying to decide between nodes and terms. What I want to do I want to implement books. Each piece of content may be a book (containing ...
1
vote
1answer
692 views

How to trigger a rule if a node has a certain Taxonomy term?

I'm trying to create a rule using Rules that will apply a watermark to an image within a node (using the ImageCache Actions module) if that given node has a specific Taxonomy term. For example, nodes ...
0
votes
1answer
29 views

How do we fetch the list of all content types refererencing a particular taxonomy vocabulary?

I am trying to delete a taxonomy vocabulary but before doing that, I want to know if there is any content type with a field referencing a taxonomy vocabulary. My first thought was using a view, but ...

1
4 5
6
7 8
71