0

I have a content where two fields using the same vocabulary. I want to show nodes related content filtered by the these fields.

I try with relation

Relationships

  • content:field_1

  • (term from field_field_1) Taxonomy term: Content using field1 (Relationship term from field_field_1 ; Require this relationship )

Contextual filters

   (field_field_1) Content: field_2

   Provide default value : Taxonomy term id from url
   Load default filter from node page
   Limit terms by vocabulary ( country)

   Specify validation criteria ( taxonomy term )

    Vocabularies : Country
    Filter value type : Term name converted to Term ID
    Transform dashes in URL to spaces in term name filter values 

This query returns nothing.

I don't want to use Views PHP code fields because of security concerns.

1
  • Using php filter will be the easiest way. Whilst I fully agree that php filter is generally a bad thing, I think using in this specific instance is fine.
    – Felix Eve
    Commented Apr 2, 2014 at 16:00

1 Answer 1

0

If I understand your question correctly, out of the box the easiest way is to add a Contextual Filter Content: Has Taxonomy Term Id. This one does not care whether you have 1 field or 20 that reference taxonomy terms. Further details within are whether you want to match from URL on term id or term name, etc.

I came across your question whilst seeking an answer to mine How to filter on taxonomy term but only match one field on the node, where two fields (primary and secondary) both use the same vocabulary which I think is different.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.