Hello,
I'm configuring a view to get such as "related articles" and I need to add a filter criteria to match the "category" field value.

How can I do it?

Comments

darol100’s picture

Your filter should be this "Content: Has taxonomy term." This will allow you to filter by the taxonomy groups. If you want to be more specific you might want to you use Term Reference Filter by Views. This module will allow you to choose a term from the taxonomy group that you choose.

I hope this answer your question.

- Darryl Norris
Be Connected: Website | Twitter | LinkendIn | GitHub

nimbuz77’s picture

"Content: Has taxonomy term" filter lets me to choose a "fixed" value for the taxonomy term.
I want to match a current field in the view, something like:
[...]
Type = Article
And category_taxonomy_term IS EQUAL TO field_category

Where field_category is in the list of the field for "unformatted list of fields" format.

darol100’s picture

Did you try the module https://drupal.org/project/term_reference_filter_by_views ? Still unclear to me what is your goal.

- Darryl Norris
Be Connected: Website | Twitter | LinkendIn | GitHub

nimbuz77’s picture

I tried but I didn't understand how it works.

I need to create a view for "related articles" to show at the bottom of the article's page.
I want to get all articles that match the same category of the shown article

I'm figuring out to have a filter on the view that lets me set a rule that looks like:
"All Articles Where category is equal to field_category"

field_category is a Taxonomy Terms.

darol100’s picture

Sadly that is the module you will need to used for that https://drupal.org/project/term_reference_filter_by_views. Right now, I can't give you more details about it. But maybe during the weekend I have more time and give you a tutorial.

- Darryl Norris
Be Connected: Website | Twitter | LinkendIn | GitHub

nimbuz77’s picture

Sadly that is the module you will need to used for that

This is a good news.
I didn't investigate so much, just I didn't see any new option in the UI

I'll search some tutorials or instruction

darol100’s picture

Make sure you clear the caches after enabling the module. I do not know if there are other modules that you can used for that, but that is the one I had use in the past.

Good Luck

- Darryl Norris
Be Connected: Website | Twitter | LinkendIn | GitHub

nimbuz77’s picture

I found a solution to my problem following this tutorial: http://www.youtube.com/watch?v=PhTdTUiblS4
Video quality is quite low but it is possible to follow the voice.

seizethecarp’s picture

This has been cross-posted on another drupal.org result, but I thought it might be helpful since I too ended up on this page while looking for my answer.
For anyone else like me looking for how to make it work, I Gumped my way into my into success partly following: http://redcrackle.com/blog/adding-contextual-filter-view-drupal-8

I'm using Drupal 8 and Zircon. I'm brand new so I may use the wrong terms.
I wanted to make contextual images in "Panel first col 1" based on the Category of the page that someone is on.
What I did was go to Structure > Views > Carousel (the view that has the pictures in that block region) > Advanced > Add by Contextual Filters > Has taxonomy term ID > select in Provide default value: Taxonomy term ID from URL (which made no sense to me but whatever) > then I checked all three boxes: Load default filter from term page, Load default filter from node page, that's good for related taxonomy blocks, Limit terms by vocabulary. Then for Vocabularies I checked Categories.

PHEW! Finally!
Thanks to you all on here for pointing me in the right direction!