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
654 views

Migrate multiselect taxonomy values from node with csv

I want to import companies with csv into Drupal 8 with migrate_source_csv module. CSV: company_name,company_categories,company_size "Dummy Name","Category 1";"Category 2","2 people" How to ...
0
votes
3answers
2k views

How to get term by path or alias?

I've seen this question posted many places, but no answers - or relevant answer. i.e. how to get term object or ID from path or alias e.g. /cat/subcat or /taxonomy/term/6??
0
votes
1answer
1k views

Taxonomy terms with conditional field

50 terms and each term needs to have radiobuttons or "other". Food - o in price - o extra price Drinks - o in price - o extra price WiFi - o in price - o extra price So "in price" and "extra price"...
0
votes
1answer
419 views

Export and Import Taxonomies and Extra Fields

I created extra field in Login Form, I Installed even Extra Module (address) and create Taxonomies Now I want to Export these configurations to another Drupal. This Drupal is the Clone of the main ...
1
vote
1answer
655 views

Display parent term based on child term in views

I have a vocabulary with the following structure: Vocabulary Parent term 1 Child term 1.1 Child term 1.1.1 Child term 1.2 Child term 1.2.1 Parent term 2 Child term 2.1 ...
2
votes
3answers
892 views

How to hide specific term/field value on the node?

Is there a way to hide a specific taxonomy terms (specific field values) on the node? (not hiding field/vocabulary altogether, just some values). For instance, there is vocabulary "Location" with a ...
3
votes
2answers
705 views

Create a Views that displays all unused taxonomy terms

I found this article about how to create a Views to display all active taxonomy terms: https://www.drupal.org/node/770782 I want to achieve the exact contrary: Get a list of all terms that are not ...
0
votes
1answer
390 views

Is it possible to disable (or reject) selection of parent terms in taxonomy reference fields at node creation or edit?

for instance, for a particular Vocab. and User Role.. Is it possible to achieve that in code? That parent terms will be rendered only as labels and not checkboxes? Thanks.
1
vote
2answers
393 views

Display a block based on the term reference field of the current node

What I'm trying trying to do sounds fairly simple, but I can't get my head around it. I'm having 2 taxonomy vocabularies: machinery and batteries (both created with NAT for all that matters), and 2 ...
0
votes
2answers
906 views

Facets hierarchical taxonomy terms not working

I use the Facet module version 8.x-1.x-dev. I have a list of taxonomy terms with parents and childs. The taxonomy term facet is an Entity reference field. I can't get the hierarchical structure ...
2
votes
3answers
1k views

How to add a taxonomy term value as a class?

I am trying to target a specific div with CSS. But for that, I need a unique class in order to target a specific taxonomy term. I look at this question, but that doesn't work as it will target all ...
0
votes
1answer
368 views

Block showing Parent Taxonomy Term of current Node

Ok my taxonomy is setup like this: Holiday Cards Trees Bears Religious So the goal is to display a node belonging to 'Trees' but in that node I need to have a block that shows the Parent Item of '...
0
votes
1answer
46 views

Changing the layout of a Taxonomy Term Page

By default my taxonomy term page lists all articles using this term in 2-columns. I would like to change it to a 1-column layout. (1) I have created a custom display layout for the taxonomy group: (2)...
3
votes
1answer
3k views

How can you show taxonomy child terms on the parent term page?

I am trying to figure out if there is a way to modify the default taxonomy view so it shows nodes tagged with that particular term (already done) plus all children of the taxonomy term you are viewing....
0
votes
0answers
36 views

How can I migrate taxonomy data from an outdated site?

I have a site building with an old version of D8. The site can not run up and all I get is a backup sql file. So I'm creating a new D8 site with the latest version, trying to restore the data. When I ...
1
vote
4answers
2k views

Programmatically create a taxonomy and attach a field to it

I created a vocabulary using the following code. $vocab = entity_create('taxonomy_vocabulary', array( 'name' => 'vocab_name', 'vid' => 'vocab_id', 'description' => 'description' )); $...
2
votes
1answer
81 views

How can I add a new field from config inside hook_update_N? [duplicate]

I have to add taxonomy by php code. Taxonomy has to got 2 fields. I added new function to test_taxonomy.install, and it seems to work: function taxonomy_update_8805() { $config_path = 'modules/...
-1
votes
1answer
26 views

How do I get the taxonomy term name?

I added a taxonomy field inside a view. I need to show the term name on the page in a grouped way, like this. taxonomy term1 name title1 content1 title2 content2 taxonomy term2 name title1 ...
1
vote
1answer
67 views

With Commerce Product taxonomy term view, is there a way to have page title set to the translated term title?

The only way to have the taxonomy term name in the title of a taxonomy term Commerce Products view page I've found so far is the example view in the estore theme (I still don't get how tid which ...
1
vote
1answer
20 views

Contextual filter based on base level of taxonomy

I've been trying to get the following working for a couple of hours: I have a views block, it displays a single content type. The content type has a taxonomy field. The taxonomy items are structured ...
0
votes
0answers
27 views

Parent terms aren't recognized

I have a term migration with an SQL source (WordPress) but the parent term is not properly set when imported into Drupal. Config: id: wp_terms_my_terms label: WordPress Terms: My Terms migration_group:...
0
votes
1answer
29 views

How do I re-create a built-in view?

I duplicated a view before making changes, but it didn't save and I'd changed most of the view settings before I realised I was working on the original. How can I recreate the standard taxonomy view? ...
0
votes
1answer
36 views

How to classify a view by letter?

I have tags (taxonomy terms) and created a tags pageview. I want to sort my tags alphabetically and group them by letter of the alphabet. How can I do this? Thank you I want a single page. I don't ...
0
votes
3answers
626 views

View listing related nodes by taxonomy term

I have a content type representing a book. Each book as a genre (SciFi, Fantasy, Thriller ...) and I would like to expose, on the page of a book some books sharing the same genre. I created a view ...
0
votes
0answers
41 views

If I have 2 same name taxonomy term which is used with nodes. how to set only one instead of both?

I have 2 taxonomy terms with the same name (knight(2) and knight(6)) in my Drupal 8 Project; both terms have been used with nodes. I want to replace knight(6) with knight(2) in all the nodes. I ...
2
votes
1answer
66 views

How to limit the terms of the view to the terms used?

On the product I created a "tags" taxonomy terms field. I have created a hundred "tags". My products use around 10 "tags". I created a pageview of my products with an ...
0
votes
1answer
37 views

How do I get the term name in a custom submit handler?

In Drupal 8/9, when you create a new term, the default status message is: Created new term %term. %term contains the term name, which is linked to the term page. I want to override this and remove ...
1
vote
1answer
48 views

Get the form to add a term to a vocabulary programmatically

I am working on Drupal 8.9.6. I am trying to retrieve the form to add a term to a vocabulary programmatically. I know how to do it for a content type: $values = array('type' => $content_type); ...
1
vote
1answer
70 views

How can I update the name of a taxonomy term using hook_update_N?

I have taxonomy terms of color and I made a typo in one of the color name. It should be 'Crystal Black Pearl' instead of 'Crsytal Black Pearl'. How do I change it using hook_update_N ? Thank you in ...
0
votes
1answer
97 views

Filter views for same taxonomy term

I am using D8. I have two views (articles and videos) sharing the same taxonomy (segments). How can I filter the views based on the view type? For example, if I am on the articles page, I would need ...
0
votes
0answers
20 views

Unique Taxonomy Term Requirement Across Vocabularies

I haven't used taxonomies much so I'm hoping for a quick explanation on an issue for a site I'm working on. Let's say I have two vocabularies. Portland and Seattle. In each one I want to have a term ...
0
votes
1answer
265 views

How to get taxonomy term reference fields value translated in twig

I have a taxonomy vocabulary with terms. In a content type, I have a referenced field with this taxonomy. I can get the taxonomy term in twig like this : {% for item in node.field_lorem %} {{ ...
0
votes
1answer
35 views

Content editor cannot view unpublished taxonomy terms when editing a node

We have a custom content type that has a Entity Reference field to a taxonomy vocabulary. The content editor is presented a list of check boxes to select their terms to attach to the node. Some of our ...
0
votes
0answers
127 views

Programmatically remove an entity reference field

I am new to Drupal 8. What I want to achieve is to delete the taxonomy term (entity reference) and its association from the nodes where it is referenced. Node has multiple languages, revisions, ...
1
vote
1answer
348 views

Taxonomy on each field value

What is the best way to add taxonomy terms to each field value (uploaded with plupload or multiupload at once) of a imagefield (should look like http://www.binaerschmiede.at/test/imagefield-tags.jpg)? ...
0
votes
1answer
23 views

Filter by taxonymy ID with multiple field in contextual filter

In drupal 8.9 I need to filter by taxonomy ID over multiple fields in the contextual filter of views. How to do this ?
0
votes
0answers
15 views

How to change image resolution on selection of field type

I am creating a Content type and added field (like: category, image etc). I want to use different resolution default image for each category. As well as I want to restrict the user to upload specific ...
0
votes
0answers
20 views

Display taxonomy parent tid of a taxonomy term reference field

On a node template , i am displaying a taxonomy term ( entity ref field ). That taxonomy term has a parent. How can have that info on the html generated , for css purposes ? The field.html.twig ...
11
votes
3answers
32k views

How can I get the taxonomy term name from a term ID?

I'm trying to get a taxonomy term name by term ID. According to another post, I should load the term first: $term = \Drupal::entityTypeManager()->getStorage('taxonomy')->load($tid); But then I ...
1
vote
1answer
164 views

Pathauto bulk update for taxonomy terms with unchecked “Generate automatic URL alias”

I have the same issue addressed for D7 here: Bulk Generating URL aliases for taxonomy terms doesn't do anything or here: Bulk update for unchecked "Generate automatic URL alias" And I'm ...
0
votes
0answers
16 views

How to expose the URL alias of a taxonomy term in a View?

I have a View showing Taxonomy Terms as JSON, and want to expose the URL aliases of those terms: { "terms" : [ { "term" : { "name" : "Media ...
1
vote
2answers
270 views

How to get taxonomy term name/label from a field?

Ok, so I'm trying to populate a field based on the selection of a taxonomy term. I've mainly got it working thanks to this stack exchange article use Drupal\taxonomy\Entity; function ...
0
votes
1answer
29 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
526 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
201 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
43 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 ...

1
3 4
5
6 7
71