Skip to main content

Questions tagged [taxonomy-terms]

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

Filter by
Sorted by
Tagged with
111 votes
2 answers
68k views

Contextual filters taxonomy name

I'm adding a contextual filter to a view for a custom content type that has a taxonomy field. The contextual filter allows me to filter by the taxonomy tag id but not by the taxonomy tag name. Meaning ...
powers1's user avatar
  • 1,253
34 votes
5 answers
33k views

Node count for taxonomy terms

How can I display the node count values for taxonomy terms with sorting the result list in descending order of node count?
ya.teck's user avatar
  • 5,642
23 votes
4 answers
6k views

Clean way of building simple taxonomy browser of arbitrary depth

I have spent days trying to determine a clean way to do the following: Display a list of all top-level terms in a vocabulary with links to their child terms Upon clicking a link, be taken to a list ...
beth's user avatar
  • 9,087
14 votes
3 answers
32k views

How to show the parent and child taxonomy term?

I have a vocabulary like this: Parent 1 Child 1 Child 2 Child 3 Parent 2 Child 1 Child 2 Now I would like to use a view to create a list of a Parent term with its Child terms. I try to do this ...
Eduardo Gabriel Cabrera Japa's user avatar
4 votes
3 answers
682 views

How to prevent access to Views-only content?

When I'm developing sites in Drupal, I create various content types and taxonomy vocabularies that I use with Views to build displays. I might not ever want the nodes to be viewable in their own right ...
pushka's user avatar
  • 1,853
9 votes
2 answers
16k 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?
Ashlar's user avatar
  • 5,115
7 votes
4 answers
19k 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.
znat's user avatar
  • 1,047
29 votes
12 answers
79k views

Get taxonomy terms

I wanted to retrieve taxonomy terms from a certain vocabulary in Drupal 8. Apparently I can still do it using taxonomy_get_tree but it's deprecated. I now have to use TermStorageInterface::loadTree ...
Romain Braun's user avatar
10 votes
5 answers
21k views

How to get the translated term name by tid?

I'm looking for a working method to get the translated term name by tid. The following code returns the original term name but not the translation. global $language; $lang_name = $language->...
mate64's user avatar
  • 328
18 votes
4 answers
7k views

How to combine views exposed filter with search?

My client asked me for a single field, that would work 2 ways: Autocomplete filter based on taxonomy. If site visitor inputs something that's not in taxonomy, full text search should be performed on ...
Mołot's user avatar
  • 21.9k
11 votes
1 answer
5k views

Entity reference vs. taxonomy

Let's say I have a team, which has members. I have a content type for team and a content type for individual team members. Let's say there are also other relationships, for instance teams can belong ...
James's user avatar
  • 1,191
5 votes
1 answer
7k views

Get list of taxonomy terms for current node through Views

I've been trying this for awhile, and I keep finding answers that are close - but not quite. If there is a node with taxonomy terms attached to it, I want to create a block in Views that I can place ...
kyletaylored's user avatar
  • 2,286
3 votes
1 answer
620 views

How to check for product taxonomy term in Rules actions (Ubercart)

I am using Drupal 7 with Ubercart. I am trying to configure to send an email when customer makes a purchase of a product mapped to one particular taxonomy term. I tried adding actions in a custom ...
AnAnD's user avatar
  • 616
21 votes
2 answers
4k views

Are there any benefits/caveats with using Entity Reference over Term Reference?

Pretty simple question really, but is there any benefit to using a core term reference field over an Entity Reference field? Obviously tagging is not really an option with Entity Reference, but I've ...
Chapabu's user avatar
  • 13.9k
13 votes
2 answers
4k views

How to Disable new terms (free tagging) with Taxonomies?

I have a "term reference" field, in a form that uses an auto-complete widget. I want to limit user input to terms in the vocabulary only, and output a message when a user tries to enter a non existing ...
user1774549's user avatar
13 votes
2 answers
19k views

How do I get a list of all taxonomy terms assigned to a node?

I have a node and want to get all the taxonomy terms assigned to the node. In drupal 6 I could use $node->taxonomy and the taxonomy_* functions but these don't exist in drupal 7.
Rwky's user avatar
  • 233
12 votes
7 answers
14k views

Display comma-separated list of taxonomy terms?

In my node.tpl.php template, I want to print out a list of taxonomy terms (the taxonomy is called "channels."). If I use: <?php print render($content['field_channel']); ?> It works, ...
Mike's user avatar
  • 755
10 votes
5 answers
5k views

show amount of results for exposed filter

I have a couple of exposed filters to filter the content in my view. Most of them are taxonomy terms, now i would like to show how many nodes are tagged with that term behind the taxonomy term. ...
dazz's user avatar
  • 1,014
5 votes
4 answers
6k views

Create taxonomy terms on the fly

As far as I know, the way to create a taxonomy term is having to go into the taxonomy module and creating on there, and THEN assigning the term to the node. Is there a way to create taxonomy terms on ...
Anthony Miller's user avatar
4 votes
2 answers
2k views

Selecting taxonomy term in article and showing all articles titles associated with this term

I have a content type article and when editing an article there should be a field where you can select a taxonomy term of a specific vocabulary. When viewing the article it should show a list of ...
0711master's user avatar
2 votes
2 answers
6k views

Taxonomy term pages with multiple views

I currently use only one view with path taxonomy/term/% and without any vocabulary verification. However, I would like to create two views: news and products (to implement different themes) linked to ...
deem's user avatar
  • 536
30 votes
5 answers
22k views

How do I override a taxonomy/term/% list with a view?

I have a vocabulary attached to a content type. Only one term can be selected to categorize a node made with this content type. The vocabulary is called Vehicles and has terms 'cars, trucks, boats.' ...
blue928's user avatar
  • 3,804
28 votes
8 answers
25k views

Taxonomy term name as contextual filter for view

In D7 I was able to filter a view according to a taxonomy term name taken from the URL. An example would be this URL http://www.gbyte.co/tags/drupal-planet/rss.xml "drupal-planet" would be converted ...
gbyte's user avatar
  • 787
14 votes
5 answers
9k views

how to separate taxonomy hierarchy in pathauto with slashes

Pathauto seems to have a different way of aliasing taxonomy hierarchy. From Taxonomy Menu: Classifieds > Cars > Aston Martin > DB9 Coupe Classifieds > Jobs > Accounting What I want is something ...
jan's user avatar
  • 865
9 votes
5 answers
6k views

What are the advantages or disadvantages of using reference based modules instead of taxonomy module?

I wonder how to decide either to use core Taxonomy module or Entity Reference module? I didn't use Entity Reference module before but I've used the taxonomy module (and some related modules) on 10-15 ...
herci's user avatar
  • 2,160
9 votes
2 answers
8k 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 ...
Deva's user avatar
  • 111
6 votes
5 answers
5k views

Entity Reference: Filter by an entity reference view not working as expected

I am attempting to get a taxonomy reference field select widget that shows a list of taxonomy terms, including some extra data from their fields. I have attempted to use the "Reference method" = "...
nicholas.alipaz's user avatar
6 votes
2 answers
6k views

Group nodes by terms

How do you group a list of nodes by the taxonomy term? e.g. Term 1 --- Node 1 --- Node 3 --- Node 7 Term 2 --- Node 6 --- Node 9 --- Node 12 I have tried creating a view with "Node" and "Taxonomy ...
big_smile's user avatar
  • 2,828
5 votes
5 answers
8k views

How to show translated taxonomy terms in a view?

I have used the Views module to create a view of taxonomy terms. The taxonomy terms are translated in the Greek language also (apart from English), using the typical i18n modules. But when I switch ...
Dion's user avatar
  • 2,398
4 votes
3 answers
11k views

Taxonomy menu with custom path for taxonomy terms

I am trying to make a taxonomy menu using the Taxonomy Menu module with a custom path for the taxonomy terms. Instead of /taxonomy/term/tid I want /proj/!tid (or ultimately /proj/!term-name but I'll ...
Jay's user avatar
  • 839
3 votes
2 answers
737 views

How to correct my rule to prevent duplicate taxonomy terms to be created?

This is a followup of my question at How to create a rule to combine the terms of 2 fields to create a new term and store it in a 3rd field?. How can I prevent that each time a node is viewed, it ...
LIUJIAHUI's user avatar
  • 211
3 votes
2 answers
4k 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 ------...
Nick Hope's user avatar
  • 287
3 votes
1 answer
4k views

Views (Search API): Search taxonomy parent and display all children

Problem I have a country taxonomy field. The top level is continents then below that countries: Asia --China --Thailand Europe --France --Germany I'm using search API (with solr backend) to index. ...
Dominic Woodman's user avatar
1 vote
1 answer
2k 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, ...
Elmore Ellis's user avatar
0 votes
2 answers
2k 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 --...
Nick Hope's user avatar
  • 287
0 votes
1 answer
3k views

Create view with path relative to taxonomy term

I have multiple content types and would like to create a couple of views to show various content types as sub directory to the term page. The challenge is that I need to the path to be taxonomy/term/%...
Progonat's user avatar
  • 639
0 votes
2 answers
3k views

Views: How can I show a list of users who have a taxonomy term attached via a term reference field?

I'm using the views module's built-in "Taxonomy term" view which overrides the way Drupal displays taxonomy by default and makes it accessible to views. However, this only works for content, not ...
Patrick Kenny's user avatar
-2 votes
1 answer
556 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 ...
Patrick Kenny's user avatar
42 votes
6 answers
39k 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 ...
Samsquanch's user avatar
20 votes
4 answers
28k views

How do I get the taxonomy term ID from its name?

The only function on the list of taxonomy.module functions that looks like it does what I want appears to be a private function (_taxonomy_get_tid_from_term). What function am I supposed to use if ...
beth's user avatar
  • 9,087
15 votes
3 answers
7k views

Most popular tags in a list as a block

The Tagadelic module works very well out of the box; it is the only plug-and-play feature for a tag cloud available for Drupal 7. I do not need to use the "cloud" format. I need the tags to ...
Jeremy's user avatar
  • 151
14 votes
1 answer
5k views

Programmatically create taxonomy term

How would you programmatically create taxonomy term? I wish to bulk create some in a custom module.
Lucy's user avatar
  • 1,502
14 votes
4 answers
14k 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?
Peter T Graber's user avatar
14 votes
3 answers
57k 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 ...
Diana's user avatar
  • 3,308
10 votes
21 answers
19k views

How do I delete all terms from a vocabulary (bulk delete)?

I have a large vocabulary, and admin views does not yet work for taxonomy. Taxonomy Manager does not do this as well. Are there other options for bulk-deleting taxonomy terms?
giorgio79's user avatar
  • 4,631
9 votes
4 answers
19k 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?
Charles Yeung's user avatar
8 votes
3 answers
11k views

Check if current page is taxonomy term

How can I check if the current page is a taxonomy term page, similarly to what done with the following code used to check if the current page is the front page? if (drupal_is_front_page()) { // The ...
Daniel Sachs's user avatar
8 votes
4 answers
942 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 ...
Molfar's user avatar
  • 404
8 votes
1 answer
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 ...
mikyatope's user avatar
  • 260
7 votes
3 answers
4k 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 ...
pasine's user avatar
  • 575

1
2 3 4 5
8