Questions tagged [taxonomy-terms]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
40 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
39 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
37 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
17 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
0answers
33 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, ...
0
votes
1answer
16 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
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
18 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 ...
0
votes
0answers
15 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
36 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
61 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
17 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,...
1
vote
1answer
23 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
76 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
1answer
41 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
24 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. (...
0
votes
2answers
55 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
23 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
25 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 ...
0
votes
3answers
55 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
32 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
15 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
33 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 ...
0
votes
1answer
16 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
0answers
44 views

Display the fields of the current taxonomy with an exposed form

I'm using the Taxonomy term view. I expose the "Has taxonomy term" filter to my users in a block. I want to display the title and the fields of the current taxonomy even when a term has been ...
0
votes
2answers
39 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
36 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
44 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
28 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
0answers
8 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
121 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
48 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 ...
0
votes
1answer
19 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 ...
0
votes
2answers
57 views

Categorized view for an entity reference content

I am trying to implement a Magazine in Drupal 9. I am confused about whether to use taxonomy term or content type since the data I want to handle is used for both categorizations and storing of ...
0
votes
2answers
47 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, ...
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
20 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
1answer
50 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: ...
0
votes
3answers
23 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 ...
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
54 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
3answers
78 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
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 ...
0
votes
1answer
28 views

Add new items to a multivalue field instead of override existing values [closed]

I have an Article content type with a multi-values taxonomy reference field (field_article_countries) for the Countries vocabulary. I also have a Book content type with a multi-values taxonomy ...
0
votes
2answers
26 views

How to check if a Vocabulary is translatable?

In Drupal Core, I found the following code: $entity instanceof TranslatableDataInterface && $entity->isTranslatable() But it looks like it is not working for the Taxonomy vocabularies
1
vote
0answers
55 views

How do you call an install function that did not run during install?

I am using the Currency Taxonomy module to get all valid currencies around the globe as taxonomy terms. On installing the module, I got the taxonomy vocabulary but not the terms. The code to add the ...
0
votes
0answers
12 views

Translated taxonomies are not showing in the view

I have set up a multilingual site. I have translated the taxonomies but when I see the page in french the taxonomy are in English. I am using views to display the content in the table. you can visit ...
0
votes
1answer
102 views

How to get Taxonomy Term Field Value in twig

I have a taxonomy term with the name 'Colors' and it has 1 image field called field_color_image. In my project I have a node type with a field type of Taxonomy term that refer to Colors. My aim is ...

1
2 3 4 5
71