Questions tagged as ['taxonomy-terms']

"Taxonomy" refers to Drupal's content classification mechanism, organised into vocabularies and terms.
Score: 1
dwienecke avatar
Two step entity reference selection
vn flag

I want to create a two step entity reference selection in Drupal 9.

The structure so far:

Content Type: Company

--> Entity reference: Jobs (multiple)

Content Type: Job

--> Entity reference: Qualification (multiple)

Content Type: Qualification

I created an import for the company profiles and there is a entity reference for multiple jobs. This is already working.

In a second step there should ...

Score: 0
bigboy avatar
How to get language prefix in URL for terms without translation?
gu flag

I have a multilingual website with taxonomy vocabulary, which terms are not translatable (company names).

But each term has translated meta tags and paths, depending on the selected site language.

For example, term paths:

  • /vocab-name/term-name (default, english)
  • /de/vocab-name/term-name
  • /es/vocab-name/term-name
  • /it/vocab-name/term-name
  • etc

I can access all of them, metatags are displayed in the c ...

Score: 0
mathieu avatar
How can I customize each of the taxonomy term pages?
mw flag

I have a site with Drupal 9. I have created a taxonomy and I want to personalize the terms pages. In Drupal, there is a view for that, but if I change it, I change all the taxonomy term pages.

I want to create a view to customize each page of the terms. How can I achieve this?

Score: 1
mathieu avatar
How to display the parent taxonomy term of the "Tags" field?
mw flag

On my Drupal 9 site, I created taxonomy terms in the "tags" vocabulary (the vocabulary and the default field of the "article" content type) :

enter image description here

When I create a node, I select a taxonomy term in the form (for example "ICO"). The node displays the "tags" field :

enter image description here

I want that if the node has the term "ICO", it also displays the parent terms. Like this :

Catégories : Culture geek, crypto, ICO

How can ...

Score: 0
Steve Siddu avatar
How do I dynamically add filters?
br flag

I have a view_block with the following filters,

enter image description here

I want to change the product tag, Release tag, Document type values dynamically based on url.

if the url is, example.com/mars/21.43.00/ProductGuide, then the filters should change like this

enter image description here

I don't know how to achieve this, any suggestion would be helpful

Thank you!

Score: 0
Steve Siddu avatar
How to add contextual filter?
br flag

I am working with books in drupal 8. I want to display a specific page("table of contenets") on the sidebar whenever any page of that book is accessed. "table of contents" is a book page. every page of book has two id's.

  • page_id
  • book_id

Page_id is unique for every page but book id is same for all pages. I believe contextual filter based on book_id might solve my issue. but I don't know how to add c ...

Score: 1
How to display all data from a paragraph field in views (Drupal 7)
ae flag

I am currently a caretaker for a Drupal 7 website and I can't figure out how to group paragraph items in views. I have created a content type Products and one of the fields is called product variation which is field type paragraphs. I have created a paragraph bundle for that field.

Then I created a view to show the products on the front page. To display the paragraph fields I created a content re ...

Score: 2
How to create a view that lists all taxonomy terms of a vocabulary, filtered by a term id?
cn flag

I have a lot of different vocabularies. On The taxonomy page (the standard view provided) I would like to add a block (view) that takes the current taxonomy id from the url/page and displays all taxonomy terms belonging to the same vocabulary. I tried adding a contextual filter, but when I choose term id from url, the view only shows one term, but I would like to show all terms of the vocabulary the ter ...

Score: 0
kazah avatar
Similar content with contextual filter by url
in flag

There are two types of content (as an example):

  1. fruits
  2. vegetables

They share the same vocabulary and similar terms. Catalog structure:

-Fruits
--juices
---for children
---for men
---for women
-Vegetables
--juices
---for children
---for men
---for women

Url path for mango: /fruits/mango

I want to show similar vegetable juices for children in the fruit node, if the path matches the difference only wi ...

Score: 0
Elber CM avatar
Split taxonomy terms in two facet filters
it flag

English is not my first language, so please be patient.

I'd like to ask for assistance to split my taxonomy terms in two facet filters.

Context:

  • Drupal Core v9.2.6
  • Acquia Search v3.0.5
  • Acquia Connector v3.0.4
  • Search API v8.x-1.21
  • Search API Solr v4.2.1
  • Search API Pages v8.x-1.0-beta3
  • Search API Solr Admin v4.2.1
  • Facets v8.x-1.8

I have configured correctly the listed modules and set a functional Search  ...

Score: 2
Giuseppe avatar
How use subqueues of entityqueue module?
br flag

I'm on D9 and already using entityqueue module to let the content editors orders some views via "simple" queues

Now, I've been requested to make possible to order the nodes appearing on the terms' pages of a specific taxonomy.

Those pages - on /taxonomy/term/% url - are rendered trough the "standard" solution of a view of content with a contextual filter "Has taxonomy term ID".

I've successfully tried  ...

Score: 0
mathieu avatar
How do I create a breadcrumb with the taxonomy terms used by the node?
mw flag

I created a vocabulary for the nodes.

screenshot

I installed the Easy Breadcrumb module.

When a node is tagged, for example, with Crypto and ICO, the breadcrumb should be the following one.

Accueil >> Crypto >> ICO >> Node Title

Home >> Term >> Sub-term >> Node Title

Nodes will only have a single term or a term and a sub-term.

Currently it does not work.

screenshot

I also i ...

Score: 0
ab2211 avatar
Permissions by Term and Drupal Views
it flag

I created a content type with a taxonomy. I use the terms of the taxonomy as a category for a handbook to show different categories via views. Now, I have a section of the handbook, which should only be visible for one role. I thought I could realize this with the Permission by Terms module.

So, I gave access to this one term just to a specific role. The access to a node with the term is denied f ...

Score: 0
mxr10 avatar
How do I programmatically set a content reference by name for a node?
id flag

Hi team i have some isssues.

I'm creating a node and i would like to set a content reference by name not by id, i'm doing this but this is not working: 'field_content_type_items' is referenced to another content type

$node = \Drupal\node\Entity\Node::create([
    'type' => 'items',
    'status' => $status,
    'title' => $title,
    'field_content_type_items' =>  "CUN",
]);

Also i tried with  ...

Score: -1
ventura avatar
How do I list all users in a view that have created a node with certain taxonomy terms?
cn flag

The goal is to create a view to list users on a page with url /search/[category]/[topic]/[location] where "category" "topic" and "location" are taxonomy fields in nodes that users can create.

I want to list all users that have a node were the "search" queries apply.

/search/all/all/all should list all users

/search/all/topic1/all should list all users that created at least one node with topic "topic1 ...

Score: 1
How do I allow users to sort articles by tag with the select field?
uy flag

I have a view page (articles), with a taxonomy term relationship for the tags vocabulary. I have no context filters, and the filter criteria are the following.

  • Published
  • Type: article
  • Taxonomy term (exposed) (with relationship "term", "tid" ID, no multiple choice, operator "one of", but I've also tried "all of" with no use)

At first, the article list on page displays correctly, but when I select tag  ...

Score: 0
Matthew Falat avatar
The tid is being stripped out of my entity reference autocomplete value when I go to the webform submission edit page
in flag

I have a webform with an entity reference to a taxonomy and it's using an autocomplete widget. When I edit a webform submission, the ID is missing from the field and changes can't be saved because the value is invalid without the taxnomy ID.

I can't find any kind of reference to this issue anywhere.

Score: 0
Using Tac Lite in combination with Paragraphs
ma flag

For our new Drupal 9 (or 8 if necc.) website we require a very fine controllable access structure where we can give and restrict access on a user by user basis. Not only for a content type but also for the paragraphs (or more atomic components of a page). With Tac Lite we can already set the permission via taxonomy terms on a user bases to view a node. But now we would like to also controll single parag ...

Score: 0
pglatz avatar
How can I add markup for hyphenation to taxonomy term titles?
in flag

I'm displaying a list of taxonomy terms in a narrow column. Some of the names are too wide to fit and wrap. I thought perhaps inserting a <wbr> in the name would solve this, but the tag is just printed out as a literal. Is there a way to use rich text in taxonomy term names?

Score: 1
shelane avatar
Creating default content on site install with related entities
cn flag

We use the Default Content module to install default content on each new site of our multi-site Drupal platform. Version 2 changed to only use UUID of the content you are exporting (done from the local development environment to generate content). However, some of our default content are items like vocabulary terms which are then related to the node. But this is no longer exporting the ID, so the ID  ...

Score: 0
One Taxonomy with multiple views to show content related to a specific term and referenced content
gb flag

I have two content-type:

  • Job
  • Organisation

and a taxonomy:

  • categories

The content type "Job" has a field referenced to "categories" and another field referenced to "organisation".

On the front page, I put a "view block" to list all the "categories", therefore I can browse all the jobs related to a specific category. enter image description here

On the organisation node, I put another "view block" to list all the "categor ...

Score: 2
How to set a validation constraint for base fields like the taxonomy term name?
cn flag

I'm having trouble setting a validation constraint on the name of the taxonomy term.

function MYMODULE_entity_bundle_field_info_alter(&$fields, $entity_type, $bundle) {
  if ($entity_type->id() === 'taxonomy_term' && $bundle === 'my_taxonomy_type') {
    kint($fields['name']);
    if (isset($fields['name'])) {
      kint('found name');
    }
  }
}

When I rebuild the cache with drush,

Score: 4
How to make taxonomy term names unique per user?
cn flag

I have a taxonomy vocabulary, Groups.

Requirements

  • Different users can create groups with the same name. (User A can make an apples group, and User B can also make an apples group.)
  • The same user cannot make two groups with the same name (User A cannot make two apples groups.)

How can I implement this?

D8/9 offers a field constraint as explained in this answer and this blog post, but this makes a field  ...

Score: 0
How do I display nodes of two different content types that use the same taxonomy term?
cn flag

I have two content types, typeA and typeB. Both the content types have a taxonomy reference field.

I created a view for each content type. In the view showing typeA nodes, I want to show also typeB nodes using the same taxonomy term.

How can I achieve this?

Score: 0
user3108268 avatar
Taxonomy dynamic dependent exposed filters
us flag

I have a content type with two taxonomy term fields: Region and Country.

I created some nodes and entered values for those fields. I created a view with both the fields as exposed filters. When a region is selected, is there a way to only to shown in Country all the related terms as shown in the screenshot?

screenshot

The project page for the Views Reference Filter module says, at the bottom:

By default, the vie ...

Score: 0
youni avatar
Display in f2 only terms related to selected term in f1
cn flag

I have a site that consists of a few parts like: Cosmos, Hi-tech, Travel, Music.

Each part has its own Categories. And I have made two Taxonomy vocabularies:

  1. Part of a site
  2. Categories (this has field 'Part of a site' and every category term has selected 'Part of a site' term)

Both Vocabularies are using in Node as Field 1, and Field 2.

But it is not convenient now to choose Cetegory term because categor ...

Score: 1
RepublicOfDavid avatar
Programmatically verify a taxonomy term has been added to a node
fr flag

I'm currently checking the node type and status, using the following code.

$query = \Drupal::entityQuery('node')
  ->condition('status', 1)
  ->condition('type', 'content_page')
  ->execute();

foreach ($query as $nid) {
  // …
}

I need to know whether a taxonomy term has been added to a node. I don't need to know the name or ID of that term, which is a taxonomy term from the Group Requ ...

Score: 0
Interlated avatar
How do you add a CSS class if the default field value is chosen?
km flag

How do you identify that the default taxonomy field choice has been chosen?

Solution consists of a taxonomy list. If the default is chosen the title in the display should be hidden.

Using views to display the list.

Score: 0
spacecraft96 avatar
Programmatically add a taxonomy field to a custom content type
ng flag

I'm familiar with adding fields to a custom content type in the yaml files of the module. I'm unable to find an example of how to add taxonomy fields to a content type at programmatically at install.

What does the field.field.node look like?

What does the field.storage.node look like?

Are there special names for the widgets for core.entity_form_display and core.entity_view_display?

Thank you

Score: 0
Pass parameters from block to a JSON endpoint using taxonomy term from URL
pk flag

I've been searching for a solution to being able to pass a taxonomy term on a views block that is on a given page using the term name that is in the URL. I agree with my team that it would be a best practice to have one block that can be placed on multiple nodes to pull relevant data from a JSON endpoint, on another server, rather than have a proliferation of one block for term.

Example endpoint  ...