Hello,

I have:
content type: car brand.
content type: car name. with entity reference to the "car brand" content type

I want to get a view using views3 module that list all the car brands, and when the user select a brand he will get a list of all cars names referencing this brand.

How can I configure such a vue ?

Till now, I have been able to create a page listing all cars, and an attachement listing all brands.
Is there a way to pass the attachement selected brand result to the page view to show only car of this brand ?

the use of contextual filter: content: NID in the brand attachement gives an empty attachement. nothing shown

Thanks

Comments

Rather than having a content

Rather than having a content type called 'Car brand', create a new taxonomy called Car brand instead and then install a module called pathauto. This will allow you to set up the taxonomy so that you can have URLs like:

http://site.com/ford
http://site.com/bmw
http://site.com/mercedes

From there you can then add a CCK taxonomy reference field to the content type car name that references the car brand taxonomy and you can then use path auto again to set up the content type so you can have paths like:

http://site.com/ford/focus
http://site.com/ford/ka

thx but ...

Hi craig

Thank you very much for your answer, but in fact, this car example is a very simplified example that I used here. But in fact, my project is much bigger and complicated than this (list of species with scientific taxonomy, GIS, node for each thing, statistics ...)
In fact, and transposition of this example of what I actually do, let's say that each brand will be used in multiple content types (car, motorcycle, boats, employees, factory, country ...) but in addition, for each brand, there will be a full page description of this trademark. A user could simply seek to have detailed info on the brand, so there must have a node for it.

If I could just put the brand as fields in content car, it would have been simple, but there it must really be done like I said, two types of content, entity reference, and then link to view both.
I could, for example, need to get the number of cars of a certain brand or view on a map the available brand's plants ...

So could you help me in this regard?

many choices

In order of increasing complexity to implement, I would list your options like this:

1.) A taxonomy field that you have in both content types. This acts as the "glue" to connect the two pieces together. When your looking at the car you can have a view that filters on the current nodes taxonomy id (tid) to show the detailed type.

2.) http://drupal.org/project/entityreference (maybe this is simpler than taxonomy?)

3.) http://drupal.org/project/Relation With an 11 part screencast and a bunch of docs, this probably will give you the greatest flexibility once you implement it.

A list of some of the Drupal sites I have designed and/or developed can be viewed at http://motioncity.com/drupal

Entity reference

Hello,

I am on the second option. The entity reference.
I created fields with entity reference to car brand on the car name content type. I have a list of titles of the brands and i can shose from.

Now, on the views, I am trying to get a jump menu that lists the different brand (titles of car brand nodes) and when the user chose a brand and click "Go", he will get a page with different cars of that brand.

That's what i'm trying to do.

What I get now

I have tried a crazy solution:

a page as table
fields:

  • node title

filter:

  • content type: types, filter exposed and relationship used "brand"

relationship:

  • entity reference: brand

a page with grid format
fields:

  • node title, output as a link : results?field_car_brand_name_value=[title]
  • node NID

Filter :

  • content type: brands

Now , I have a gird with brands, a if a brand is selected, i'm took to a page with the list of cars.
But, I still have three problems.

  • The exposed filter has to be shown. and will be filled with the title. If i hide it, I have no more results.
  • From the result page, the user has no way to change the brand name, but to write it in the exposed form, and it has to be correct.
  • I can not make the brands select page as jump_menu.

that's why I think this is not a correct approach

Views

Do you have a live version of this? Hard to "see" it based on the description. But I think this is what you are looking for:

I can tell you that for the first problem, there is a way to direct to a page with no results. For example, I have a page at http://www.ontic.com/inventory/start that displays no results. That is because there is no inventory called "start". But once a selection is entered, the user sees the items that match their choice.

For the second and third items, you want to switch from a text field to a select list.

A list of some of the Drupal sites I have designed and/or developed can be viewed at http://motioncity.com/drupal

Solved

Solved

nobody click here