Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [taxonomy-terms]

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

Filter by
Sorted by
Tagged with
9
votes
7answers
10k views

How can I filter the taxonomy terms by language?

I have searched a way to filter the taxonomy terms by language (as done for nodes), but I didn't find any way to do it. Does the Views module support that filter in taxonomies too, or just in nodes? ...
9
votes
3answers
17k views

Get the vocabulary ID by term or node

I am going to check whether a term belongs to a designated vocabulary. Which function is used to get vocabulary by term or node?
9
votes
1answer
3k views

Migrating with the migrate module

I am using Drupal 7 and the latest Migrate module. I am trying to create a class to migrate products from an OpenCart DB into my new D7 site. I figured out all the SQL I need and got most of that ...
9
votes
2answers
10k views

How to import CSV feed into nodes with multiple taxonomy terms?

My question title says it all. I have feeds for importing and tamper for editing the data before being put into my nodes. I have my values delimited by commas and explode is making them into ...
9
votes
1answer
637 views

How do I add a column to the table shown in the vocabulary listing page?

I need to add a column to the table shown in the page listing the vocabularies defined for a site. How can I achieve this?
9
votes
2answers
3k views

How to restrict permissions for administering Taxonomy?

I would like a user role to be able to add/edit terms for a specific vocabulary, but not all vocabularies. In the permission settings for taxonomy, it seems that I need to give the role permission to ...
9
votes
4answers
13k views

How to add taxonomy term reference field in a custom drupal form

A menu item is defined with drupal_get_form as callback function and returning the form from call back function. How can I add taxonomy_term_reference field to this form? $items['files/add'] = array( ...
9
votes
1answer
3k views

Book module versus Taxonomy module

The Book and the Taxonomy modules are very similar for organising content in a hierarchy structure. Both modules: Allow Multi level hierarchies Can be accessed by Views All custom theming via ...
8
votes
1answer
13k views

filter with taxonomy-term-alias instead of term-ID?

I've my view filtered by taxonomy term ID. http://aelasoca.cat/web/ (in the main menu I've links to taxonomy ID's 3 to 8). How can I filter with the taxonomy term alias instead of it's ID ?? (not ...
8
votes
4answers
535 views

Is it acceptable to change the vid column of a term programmatically in the database?

I need to move some terms from one vocabulary to another by retaining all their data: translations, aliases, and node references. Is it acceptable to change its vid column value directly in the ...
8
votes
3answers
4k views

How to delete a vocabulary terms programmatically?

I want to remove all the terms from a vocab but not delete the vocab itself. I can do it on the database, but Id rather use the api if available in D8. $existingTerms = \Drupal::entityTypeManager()-...
8
votes
6answers
7k views

Taxonomy breadcrumbs

I'm using the core taxonomy module for blog tags but when on a tag's page can only get the breadcrumb to appear as 'Home', whereas I'd like it ideally to be 'Home > Blog > #Tag#'. I'm using custom ...
8
votes
2answers
14k views

How do I get a block to use a URL to configure a contextual filter?

Blocks do not have paths so how can I pass a context to the block to get the correct results for a page? I am new and do not have enough reputation to answer my own question for eight hours (Go ...
8
votes
2answers
2k views

Allowing users to add taxonomy terms but requiring administrators to verify them

I would like to allow users to add new taxonomy terms, but I would like this to be verified by an administrator. The way I envision this working would have a user filling out a form which would send a ...
8
votes
2answers
13k views

How do I create an AJAX filter for a view?

I have created a page using Views and it works fine. I want to add an AJAX filter to this page to allow visitors to filter the contents based on PubDate or by Taxonomy/Vocabulary for this content type....
8
votes
2answers
2k views

How can I set the value of a taxonomy term reference to multiple terms using PHP?

This question describes how to set the value of a term reference field using PHP. But what do I do if I want to set the value of a term reference field in the user profile to multiple terms? I am ...
8
votes
4answers
4k views

How can you sort taxonomy terms based on number of times used, in a view?

I'm creating a view that lists the top 10 most popular taxonomy terms (tags). Currently I have the view returning all the terms and I can limit the view to 10 but I can't work out how to order the ...
8
votes
3answers
3k views

'Add More' Taxonomy Term Widget

I'm trying to create a field widget that is similar to the normal term reference widget with one key difference. The user needs to be able to add multiple new taxonomy terms at the same time, this may ...
8
votes
2answers
3k views

Selected Checkboxes (taxonomy) populate a new select list with values of selected boxes

* question answered: Help needed with hook_node_submit in custom module to save data * In Drupal 7, I have a custom content type. In this, there is a multi select term reference to select categories ...
8
votes
2answers
7k views

How do I use contextual filters and relationships to show related articles?

So, I've been trying to get this figured out for most of the day. I had it essentially working in the previewer at one point, but now it doesn't seem to work at all. Use case: each node published ...
7
votes
2answers
20k views

How to get term name from a tid? [closed]

According to another post, I should do this $term = \Drupal::entityTypeManager()->getStorage('taxonomy')->load($tid); But then I get this error : Notice: Undefined property: Drupal\Core\Entity\...
7
votes
4answers
6k views

How to get all node entities tagged with a specific term?

For a given taxonomy term in D8, is there any API function/method that returns all node entities that reference it?
7
votes
4answers
9k views

How do I programmatically set a taxonomy term for a node?

I got some difficulties setting a taxonomy for a node. Currently I am using this code. $node = Node::create(array( 'type' => 'detailseite', 'title' => $data[$headlineIndex], '...
7
votes
7answers
4k views

How to delete all terms in a vocabulary with drush?

As reported here I have big problems with huge vocabularies in Drupal 7. Now I want to empty the big vocabularies, but I can't do that via the admin interface, because its running out of memory, so it ...
7
votes
4answers
5k views

What is the best tagging widget?

I was using the tagging module as my tagging widget until its status changed to Maintenance status: Unsupported. Now I'm looking for a replacement. After searching drupal.org I figured out there is ...
7
votes
2answers
14k views

How do I access a taxonomy term's field(s)?

Specifically, I'm trying to access a field called 'logo' inside of a couple taxonomy terms (Tweet and Wikipedia edit), which is an image. I have a news feed on the front page of my site, and for each ...
7
votes
1answer
3k views

How to retrieve a term tree for a specific vocabulary given the machine name?

Retrieving a term tree for a specific vocabulary in Drupal 8 requires the vocabulary ID. I can find no function/method/service that will return the vocabulary entity given the machine name, in order ...
7
votes
2answers
5k views

Programmatically update a taxonomy term

$term = Term::load($_tid); $term->field_league_id = 'ID value'; $term->Save(); I am updating the terms by the code above but it's not working. Create the term by term->Save() is works normally. ...
7
votes
3answers
6k views

How do I Bulk Edit Fields or Taxonomy of Nodes?

I'm working on a site that needs bulk tagging on nodes. The D8 core View Bulk Operations Port is "simple" (https://www.drupal.org/node/1823572) and it doesn't have "modify entity values" which I used ...
7
votes
2answers
3k views

Getting terms for only one taxonomy from services module

I have the services module installed, and I have both taxonomy_term and taxonomy_vocabulary checked. However I'm having problems getting just the terms for one vocabulary. when I do curl -g "http://...
7
votes
1answer
11k views

How to programmatically modify fields of taxonomy terms?

In D7, how do I programmatically add/modify fields to taxonomy terms? They are clearly fieldable and in UI I can add and edit fields in them just like I do in nodes but it proved to be no easy task in ...
7
votes
7answers
4k 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 ...
7
votes
1answer
5k views

Contextual filter with taxonomy term that is not in the url

I'm hoping someone could please help me tame the beast that is known as contextual filters. :) I have a series of nodes that all have a specific taxonomy term assigned to them (all from the same vocab)...
7
votes
5answers
3k views

Disable Taxonomy Generated Teaser List Pages

I have a site that uses the Taxonomy module to categorize content. The vocabularies and terms are used as arguments and filters in various Views. I do not want the Taxonomy module to generate its own ...
7
votes
3answers
1k views

How can I automatically add taxonomy terms to a page's <meta> keywords in the HTML?

When Taxonomy is used for "free tagging", it basically becomes keywords for the content. From an SEO perspective, it would be great to automatically include these taxonomy terms in the HTML tag for ...
7
votes
3answers
6k views

Drupal 8 - Taxonomy Menu with Hierarchy

I have been looking searching for a while and couldn't find anything related to Drupal 8. There are Modules like Taxonomy Menu but unfortunately not for Drupal 8 which works accordingly. Is there ...
7
votes
3answers
2k views

How to remove duplicate terms in a vocabulary

I have a vocabulary with many terms that are duplicates. How can I remove those terms? I have many duplicates; I need a way to delete them that is not deleting them one by one.
7
votes
3answers
3k views

How can I move taxonomy terms to a different vocabulary and update term reference fields?

I need to split a taxonomy vocabulary into two different vocabularies in Drupal 7. I can use the Taxonomy Manager module to move terms from one vocabulary to another; I have tested this and it works. ...
7
votes
3answers
3k views

Display taxonomy field in node display

I created a vocabulary where terms have an image as additional field. I want to show the image instead of the term name in the node page. How can I do this? In Drupal 6.x, I would load the term and ...
7
votes
3answers
669 views

Views 3.8: Show taxonomy hierarchy in three columns (grandparent, parent, child)

I have a taxonomy with a three-level hierarchy, and would like to display the three levels in a views table, but separately. I'd also like to have an exposed filter using that taxonomy and let my ...
7
votes
1answer
132 views

Is there a module that makes Taxonomy tags like they are on stackexchange sites?

I'm Looking for a module that makes my free tagging taxonomy tags like they are on this or any other stack exchange site. I would like for when a user puts their cursor in the Autocomplete tag field, ...
7
votes
3answers
2k views

Hierarchy between terms from different vocabularies in Drupal 7?

Is there a way to have a hierarchy of terms by reusing the same terms that reside in different vocabularies? There seem to be so many different options for dealing with taxonomies in Drupal 7 that it ...
7
votes
4answers
2k views

Nested Image/Video Galleries in Drupal 7

Alright so after looking around for awhile and not finding exactly what I am looking for hopefully someone can help me out with this. On my website I plan on having both image galleries and video ...
6
votes
3answers
4k views

How to grant a role permission to edit terms in a specific vocabulary [closed]

Is there a way/module to grant a role permission to list and edit terms in a specific vocabulary?
6
votes
1answer
5k views

How do I theme a taxonomy term page?

I am working on Drupal 8, trying to get a page template for each vocabulary. I have tried using hook_theme_suggestions_HOOK_alter() to achieve this, but I was not able to do it. I tried using Devel ...
6
votes
2answers
2k views

Add field to vocabulary itself

I have a situation where I would like to add a field to a vocabulary itself. In other words, I need an editable field on the form that normally appears at /admin/structure/taxonomy/my_vocabulary/edit ...
6
votes
5answers
276 views

How to show specific views for certain combinations of taxonomy terms?

I have searched and not been able to find anything related to this specific situation. I would like to show specific views for certain combinations of taxonomy terms in Drupal 7. I have three ...
6
votes
4answers
17k views

how to get the translated taxonomy term programmatically? [duplicate]

I have tried this $term = taxonomy_term_load($tid); and this: $term = i18n_taxonomy_localize_terms(taxonomy_term_load($tid)); Both return the default language (English) term I am using D7.
6
votes
2answers
7k views

Is it possible to automatically add a taxonomy term for a content type?

How is it possible to automatically add a taxonomy term for a content type? Is it possible to make the new added terms children of this automatically set term? I have a content type intended for ...
6
votes
3answers
4k views

Duplicate taxonomy terms from view

So I haven't yet been able to find a solution to this without using a preprocess function to check for duplicates or just using the 'tagadelic' module.. it'd be nice to get some closure. How do I ...