Hi,

I am new to Drupal and an having trouble getting Node Entity reference to work properly.

This is what I am trying to do.

Created content type called:MAKES
Then I add content for car makes such as Audi, BMW, Lexus

Next, I created content type: MODELS
Models has two fields: MODEL and MAKE filed which is entity reference to MAKE node. My next step is to add some car models such as Audi A4. So I add MODEL:A4, I also select Audi in the MAKE field which is being referenced from the MAKES content type.

Now I go to articles content type and add two field types: MAKE and MODEL. They are both entity referenced to their corresponding nodes.

But when I select MAKE Audi, I see all models and not just A4. I also see models for other makes such as 3-Series which corresponds to BMW.

What am I doing wrong? Field dependencies doesn't seem to do the trick either. I am missing something.

Image of my setup

Thank you for taking the time to read my post and any response is highly appreciated.

Comments

VM’s picture

Why categorization by content type instead of taxonomy?

tepelena’s picture

Taxonomy is too limited as I plan to add other functionalities to my site.

For each model, I also want to add pictures and other fields to that model. Each model may have different engine trims. For example:
when I create model Audi A4 I will have fields for engine and transmission.
So Audi A4 will have 1.8, 2.0 3.0 engines and 6-speed manual and automatic transmission.

When creating article content the user can quickly select any of the engines that were specific to Audi A4.

I can't do that with taxonomy. I will end up having 100 engine sizes.

If I can get the Model entity reference to only show the options that relate to Audi A4, then it will be a short list.

This is just one of the taxonomy limiations but there are other things that I don't think I will be able to complete with taxonomy.

VM’s picture

Using a module such as hierarchical select or hierarchical taxonomy won't get you where you need to go? It's how sites similar to the one describe have been accomplished in the past.

https://www.drupal.org/project/hierarchical_select
https://www.drupal.org/project/hierarchical_taxonomy

you can add fields to taxonomy including image fields.