Search code examples
drupaldrupal-6drupal-views

Creating view with node reference


I am using drupal 6. please give me idea about how should i create view with below requirements,

  1. There will be list of awards (gold , silver etc)
  2. There will be list of companies who won one of the above award (comp1->gold, comp2->gold, comp3->silver etc)

  3. I need to display list of awards first and when user clicks on any award he will be redirected to page having list of companies who won that award.

I created two content types for Awards and Companies and award_id is used as node reference in Company content type. Please guide further.I am using drupal 6. Thanks.


Solution

  • Fist task (just a simple list of awards is easy - just create a view that displays nodes in "awards" type, order as you want, limit as you want... Get also node id filed, if it's not available at start, since you gonna need it.

    For the second task - create a new view, that will list companies and under arguments add that award id. Then, you should pass award id to page as extra parameter:

    /awords/3

    Where 3 is award id.

    Sorry, Drupal 6 is pretty old and I didn't use it lately, but that's the basic idea.