1

I need to make a view that will show me the nodes of a content type inside a node of another content type filtered by a taxonomy term.

I have three content types. The first one is Projects, in which I've added some projects (title, body and images-shadowbox). The second one is Projects Categories, in which I have some categories like:

  • houses.
  • offices.
  • etc.

The third one is Services, in which I've added the following categories:

  • architecture.
  • engineering.

I have added a "Projects" vocabulary with two items:

  • Project 1.
  • Project 2.

In each node of the "Projects" content type, I assign term of the Projects vocabulary. Each node of the "Project Categories" & "Services" can have more than one terms of the Projects vocabulary.

What I need is to preview under each "Project Categories" & "Services" node the relevant node "Project", filtered by the taxonomy term of the "Projects" vocabulary.

How can I achieve this?

  • I want to show the "projects" nodes under the "services" and "projects categories" nodes. steps until now: 1.Has taxonomy term ID(with depth) 2.Allow multiple values(checked) 3.Provide default value a.Taxonomy term Id from URL b.Load default filter from node page(checked) c.Vocabularies "Projects Vocabulary" 4.Specify validation criteria a.Validator: Taxonomy term b. Vocabularies "Projects" c. Filter value type --> Term name converted to Term ID d. Transform dashes in URL to spaces in term name filter values --> checked. – stelioschar Sep 29 '13 at 13:01
0

This is similar to another request: Contextual filter in taxonomy- Drupal 7

I've customized my answer to your specific requirements:

First thing you need to do is install the References module

When setting up your project content type, create a category node reference field and a services node reference field. This will tie each project to one or more categories and one or more services.

When configuring your view, you will need to create relationships between the project and service/category.

0

I have accomplished something similar with the following combination of modules:

(1) references: project/references This module lets you create relationships between nodes (regardless of whether they are the same content type or not) and between users (doesn't sound like you need this part of the functionality).

(2) node reference from url: project/nodereference_url This module lets you add a link to a node to add related content.

In your case, I would create a content type (instead of a taxonomy term) for "Project" and create a node for each project (Project 1, Project 2, etc.)

Then, I would use node reference from url to put a link on the project page that would allow you to relate other content to it. So, in your case, you said that you already have content types for project categories and services. Your link would say something like "add project category" and when you click the link you would select one or more categories using whatever kind of widget works best for you (select list, multiselect, checkbox, etc.). The node reference url module will take care of connecting the two pieces of content to one another in the database.

BUT, in order for the related content to show up on the project page, you'll also need to install the EVA module: project/eva

Mustardseedmedia has a good tutorial on how to do this.http://mustardseedmedia.com/podcast/episode37

You'll still need the contextual filter but not in the way you are trying to use it with the taxonomy terms.

-1

You should use EVA - Entity views attachment module.

  • Please expand on your answer and let the OP know how the module can be used to address his issue. – Triskelion Sep 28 '13 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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