The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
0answers
404 views

Taxonomy vocabulary in breadcrumbs / url

I have a menu with some items that link to some views which filter content type associated with vocabulary terms. Navigation Menu ITEM -> views page vocabulary Result : my-site.com/vocabulary ...
-1
votes
1answer
23 views

get menulink id from enitity id?

Id like to be able to get a link content ID from an entity id. Not sure how to best do this? I'm trying to render a menu tree and use a specific taxonomy term as the menu tree root. I have access to ...
0
votes
1answer
30 views

Why the menu items to edit a specific vocabulary and terms does not show up in administration tool bar?

I created a new user with specific role and permissions to CRUD 1 content type and 1 taxonomy vocabular and terms. The thing is that the administration menu item does not show up for the taxonomy ...
0
votes
1answer
172 views

How do I load taxonomy terms basing on the current language?

I am using the following code. $language = \Drupal::languageManager()->getCurrentLanguage()->getId(); $terms = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadTree('...
1
vote
1answer
867 views

How do I the add vocabulary name or the ID to the <body> CSS classes?

For theming purpose, I would like to add in body class the vocabulary name (or ID) of the current taxonomy. I know how to add a class based on the taxonomy term ID. For example, I have the following ...
1
vote
2answers
354 views

Is it better to create a taxonomy term using the 'create' method of the base Entity class or the entity storage manager?

I've seen multiple ways to programmatically create entities. In this case I'm creating a taxonomy term. One is using this method $term = \Drupal\taxonomy\Entity\Term::create([ 'name' => $name, ...
1
vote
1answer
564 views

How to display all media that references this taxonomy term and its immediate children?

I have a hierarchical taxonomy vocabulary, "Living Things". A simplified excerpt looks like this: Plants --Roses ----Red Rose ----Pink Rose --Orchids ----White Orchid ----Yellow Orchid I have a ...
1
vote
1answer
470 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 ...
0
votes
1answer
87 views

How to add contextual fields to breadcumb links?

How can contextual fields be added to breadcrumb links? For example, I have a hierarchical taxonomy vocabulary like this: Animalia --Chordata ----Vertebrata On the Vertebrata page, the default ...
1
vote
2answers
580 views

How to modify the value of a taxonomy field of a node using hook_node_view()?

I'm using Drupal 8 and I have a taxonomy field in a content type. I have created a node and added the term reference value to this node. Now the node shows up the link to the term. I want to show ...
0
votes
1answer
146 views

Importing Taxonomy from CSV

I know that there are a couple of modules to import taxonomy from CSV but my taxonomy has many term references inside it. Attached is a screenshot of my taxonomy, how can I import the excel sheet ...
-1
votes
1answer
34 views

Views PHP Filter buggy for Taxonomy name

I'm trying to show specific contents for specific users based on the taxonomy term. Variables explanation: webauth variable I am using these variables to setup my PHP filter. $_SESSION['company']; ...
-1
votes
1answer
19 views

Loop Custom Content based on the taxonomy term they are in

I created a taxonmy vocabulary, added 3 terms in it Term1, Term2, Term3 Then I created a custom content type, and I associated it with that vocabulary term, so now everytime I create a page I check ...
0
votes
1answer
102 views

Have Select Dropdown of Taxonomy but allow user to enter new term

Is there a way to have my Taxonomy Terms in Dropdown but also allow the user to enter a new term (Like autocomplete widget does) if they don't see their term in the select list? So essentially I ...
0
votes
2answers
764 views

On a content page that references a taxonomy term, how can I display only content that references that taxonomy term's immediate children?

In Drupal 8, I have a hierarchical taxonomy vocabulary called "Living Things" containing these terms: Animals --Fishes ----Blennies ------Yellow Blenny ------Green Blenny ----Gobies ------Blue Goby --...
2
votes
2answers
2k views

How to display a taxonomy term's immediate children on its page?

In Drupal 8, how can I display a taxonomy term's immediate children on its page? For example, I have a hierarchical taxonomy vocabulary like this (simplified): Animals --Fishes ----Blennies ------...
2
votes
1answer
673 views

How can I display a taxonomy term's ancestral tree on a content page?

I am using Drupal 8. I have a hierarchical taxonomy vocabulary like this (simplified): Animals -Vertebrates --Fishes ---Butterflyfishes ----Chevron Butterflyfish On a taxonomy term's page, I ...
0
votes
1answer
123 views

how to reset taxonomy term ids after deleting all term from all vocabularies

after deleting all terms from all vocabularies we are still left with the next available ID of last created term is there any module that does such a thing ? or one has to go manually and set the ...
-1
votes
1answer
25 views

Create View and show tax terms that use the same term as the content

everyone, I am currently trying to create a view, but unfortunately I can't get a result. Initial situation: ContentType A uses a term from Tax B Tax C uses a term from Tax B Now I would like to ...
0
votes
3answers
859 views

How to edit vocabulary machine name?

I migrated my site from lower version of drupal, during migration process the machine name of my vocabularies was changed, now I want to modify them manually, but I cant find the proper table in ...
1
vote
1answer
203 views

Get tag(term) name for multiple nodes without a performance hit

I want to get a list of nodes and return them as JSON along with their tags (names included). After a lot of research, I've only come up with this solution: I have an array of Nodes (\Drupal\Core\...
1
vote
1answer
2k views

How to add a hierarchical taxonomy to a content type

I have a hierarchical taxonomy like below In Drupal 7 there was a module name hierarchical select to achieve this. But it is no longer support for Drupal 8. Is there another way to add this to a ...
0
votes
1answer
762 views

Pass views filter from URL

How do you pass a filter value by url in drupal 8? On my website I have a view with a select to filter the results. This result is based on taxonomy term. I have 4 options, All, badkamerrenovatie, ...
0
votes
1answer
75 views

How do you get the tid from a taxonomy term page?

I've got a component on a taxonomy term page and need to use the TID in it's preprocess function. How do I actually get the tid to save as a variable?
0
votes
1answer
51 views

Error when creating taxonomy term programmatically

I'm trying to create a term programmatically: $term = Term::create([ 'vid' => 'vocabulary_mane', 'name' => 'term_name', ]); $term->save(); I can see my term in my overview page in the ...
1
vote
2answers
1k views

Use taxonomy path for a node's path alias

Is it possible to use a token to reference the alias of a taxonomy term in the pattern of an automatic alias for a node type where that term has been selected, in Drupal 8? (Let's assume a single ...
1
vote
2answers
123 views

Issue with “Content: Has taxonomy terms (with depth)” with a content type with a repeated taxonomy

I have and issue with the view filter "Content: Has taxonomy terms (with depth)". In my view I'm filtering a content type who as two fields represented by the same taxonomy, and that view filter (...
0
votes
1answer
2k 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 ...
1
vote
1answer
1k views

Getting only TID by Entity Query

I am using Drupal 8. By retrieving an entity by Entity Query I am getting an array. How can I fetch directly the TID? Right now I am doing the following: public function getCommuneTidByPostalCode(...
1
vote
0answers
32 views

User access to the taxonomy

After upgrading or installing the module (trying to set up a forum for moderation), I lost the visibility of taxonomy for non-admin. Under Admin I can see the content of the entire website as a guest ...
1
vote
2answers
99 views

How do I use only a taxonomy term in the path alias?

I have content that is tagged with multiple terms from the same vocabulary. How can I use only the first term the node was tagged with, in the URL structure, e.g. domain.com/first/term/with/depth/...
3
votes
1answer
2k views

How to show taxonomy child terms on parent term page. Drupal 8

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
1answer
318 views

Autocomplete taxonomy with depth field

I am looking to achieve the next functionality: I have a content type about fruits, I've added an autocomplete taxonomy field to the content type with the possibility to register new taxonomy. I ...
2
votes
1answer
317 views

How to allow access to create terms in a specific vocabulary?

If you remove "Administer vocabularies and terms" from a role in Drupal 8.4, but you want to give access to a role for a specific Vocabulary, there is no out-of-the-box way to do this for "create" ...
0
votes
1answer
325 views

Drupal 8 Programatically creating content node populating taxonomy

I have a content type (we'll call it book for this thread) which has an element (we'll call it category for this thread) which is of type 'taxonomy term' ... so in the admin panel (under the '...
1
vote
2answers
588 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
78 views

Taxonomy child terms as Select options in CCK form

I have a vocabulary with parent-child terms. Every user is linked to a parent term in their profile field. And, I have CCK that the users fill in. I need to add a Select Field with options as Child ...
-1
votes
1answer
157 views

How to fetch taxonomy details from uuid or from taxonomy alias

How canI fetch the taxonomy details from the uuid or from taxonomy alias. My url looks like http://test.com/jobs/finance-accounting?job_category=a4c24884-d2g7-41c6-99f5-eb9783d6b992 which is a ...
0
votes
2answers
2k views

How to change taxonomy url in node view page?

How to change taxonomy url in node view page in Drupal 8? In node view page I am getting taxonomy term url pattern as term/{%term_id}. I want to change taxonomy term url to custom url in Drupal 8. ...
-1
votes
1answer
51 views

Creating a Slider paragraph type, how do I manage tabs “on the fly” within that?

I'm creating a paragraph type that represents a Slider. It has a couple of simple fields like "title" and "subtitle". It also has a variable number of tabs. The tabs are where the real content is. ...
0
votes
1answer
501 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
1answer
804 views

Taxonomy term route name?

I am trying to make a custom taxonomy breadcrumbs based the code from this question: Drupal 8 How to do a custom taxonomy breadcrumb? This line adds a new breadcrumb for the home page: $breadcrumb-&...
0
votes
1answer
280 views

How to disable adding new terms via the autocomplete deluxe module for taxonomy terms?

I'm using the autocomplete deluxe module for taxonomy terms in my fields. I want to prevent users from creating new terms during content creation. How can this be done?
2
votes
1answer
234 views

Node access control based on users at the node edit page

I want to ask is it possible to assign customized roles to particular users at the node edit page? For example, the node author/admin can assign "editor" role to user A & user B and assign "admin" ...
-1
votes
1answer
24 views

Adding a class to a node for a certain term

I am working on a node content type that has the vocabulary fruits (I love fruits). Per node there are more type of fruits possible. By selecting field tags (terms of the vocabulary) the classes are ...
1
vote
1answer
139 views

How to loop through a dynamic taxonomy vocabulary and if term is chosen, do an action?

My problem is as follows: I have a taxonomy vocabulary with terms, which are changing from time to time. I have two node types --> type 1 and type 2 Type 1 has a taxonomy term reference field Type 2 ...
0
votes
1answer
75 views

How to use last parameter (term) as a filter in a view

I'm using Drupal 7 as a document management system and I've got a taxonomy vocabulary called "Document Tags" with the following structure: Accounting Best Practices Client 1 Client 2 HR Forms ...
-1
votes
2answers
201 views

Make taxonomy lists collapsible in a views BEF

Similar to the module Term Reference Tree is there a way to make long taxonomy list filters collapsible? My use case would be for pages similar to kobejet.com/speakraku - where the list is so long it ...
2
votes
1answer
32 views

How can I automatically assign users to a node based on a taxonomy?

I've Googled this but might just not be using the right search phrases. I'm building an RFP repository for my company. Each RFP question will have a Category assigned to it. Within Drupal, I'd like to:...
0
votes
0answers
17 views

Auto-populate tagging without adding terms

We wish to allow users to tag content using an auto-populate widget for taxonomy terms but not be able to add new terms. We are currently using the autocomplete term widget. Permissions available for ...