Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal Views Has Taxonomy Term with multiple terms

Good Morning,

I am developing an website and i am in a struggle to resolve this:

I have a link like this: mywebsite.com/aliments/fruit/banana.

And in a View that creates the page aliments i want only to show terms with fruit and banana checked at the same time.

My taxonomy terms are like this way:

Fruit

-Banana

-Apple

Fish

-Sardine

And so on...

So i have the tag Fruit and banana checked at the same time.

Some how i can't do it, if someone can help me.

Thanks, Pedro Dias

like image 204
pedro.dias Avatar asked Oct 30 '12 10:10

pedro.dias


People also ask

What is taxonomy term in Drupal?

Taxonomy, a powerful core module, allows you to connect, relate and classify your website's content. In Drupal, these terms are gathered within "vocabularies". The Taxonomy module allows you to create, manage and apply those vocabularies. Drupal 7 and 8 has the ability to add taxonomy fields to vocabularies and terms.

What are the three types of Drupal modules?

There are three different types of Drupal modules – core, contributed, and custom. Core modules are included with your original Drupal download and can be turned on or off without the need to download any additional components. Contributed modules must be downloaded independently and added to your website.


2 Answers

From the manage view page, go to section Filter criteria and click Add.

Then choose Content: Has taxonomy term and choose the vocabulary and the both terms you wanna use.

Hope this helps... Muhammad.

like image 125
Muhammad Reda Avatar answered Sep 19 '22 12:09

Muhammad Reda


You can perform Validation on a Taxonomy Argument (Contextual Filter) to make sure it is part of a Vocabulary.

I would make the path of the view Ailments/Fruit/%

If you have other Vocabularies, make each one Ailments/Foo/% and Ailments/Bar/%

You can use the views Displays to share some of the features between all these views if you need to.

like image 33
Ryan Price Avatar answered Sep 21 '22 12:09

Ryan Price