0

I have a Content Type displaying correctly using a template, pulling out the fields to appropriate locations.

I now want to pull in related information from two separate taxonomies. I have a term reference to each Taxonomy setup as a field in the Content Type.

I have the taxonomy fields mapped out in the template, but the output is empty. I believe it is because I need to define a relationship somehow.

My current direction is to create out a view using EVA and render it to the template (which is poor for performance), but I am struggling to figure out how to define the relationship to the node.

Please provide examples of how you would approach this problem.

For context, Content Type is a job listing. Taxonomy B is information about the respective company. Taxonomy C is information about the respective city the job is in. Both Taxonomies can be made into Content Types if that helps.

enter image description here

1 Answer 1

0

I solved this by creating two new regions in my theme underneath Content, then I created a View with two blocks: one for taxonomy B and one for taxonomy C.

The view pulls in taxonomy fields using the relationship: Content: Taxonomy terms on node.

I have setup the URL pattern for my content type to be contentTypeA/taxonomyB/taxonomyC. By doing this, I was able to reference the correct term by using a Contextual Filter: Content: Has taxonomy term ID.

The Contextual Filter was a little tricky for me. As it was coming from the URL at a specific level of the path, I found that I could access taxonomyB through the path component 2, and taxonomyC through path component 3.

enter image description here

Under WHEN THE FILTER VALUE IS AVAILABLE OR A DEFAULT IS PROVIDED I used Specify validation criteria as the respective taxonomy term.

enter image description here

Finally, using Term name converted to Term ID allowed it to see the plain english term name in the URL path.

enter image description here

Your Answer

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

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