[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 721
  • Last Modified:

How to handle relational data in drupal?

Hi -

I'm new to drupal and coming from a heavy focus on relational databases.   I'm struggling to do things that I would find easy in a traditional database.

Here's an example of the kind of thing I'd like to solve.

I have a content type called "product image"

I want to classify those images by vendor.  I also have the vendor's address.

So I create another content type "vendor" and give it appropriate fields including state.

Then I create a node reference field in the product image type, referencing a vendor.

All seems well to this point.

But now I want to be able to create a view (views2, drupal 6.x) that shows the images along with the vendor's state.   No dice.  While I can see that state field when defining a view, it shows blank on the resulting view.

Ideally I'd like the user to pick the state and have the images come up that are classified with vendors in that state.    No dice there either.  It seems that the views module only knows how to show & filter the fields from the product image content type, not from the related vendor.

Any suggestions?  This seems so basic to me, so I'd imagine drupal can do it, but I've googled in vain for even basic information to get me started.  I'm wondering if I have to modify the SQL somehow a la http://drupal.org/node/409808, but that seems to be much harder than I'd expect for such a simple thing.


Any push in the right direction would be helpful.
0
savageanne
Asked:
savageanne
  • 2
  • 2
1 Solution
 
oliverpoldenCommented:
use this module to create an automatic taxonomy from your vendors, add the taxonomy to your 'product image' and create the relationship using that: http://drupal.org/project/nat
0
 
savageanneAuthor Commented:
Thanks for the suggestion.   I don't fully understand what you are suggesting.  How could I use this to use the vendor's state?  (not the vendor's name)  Of course there could be more than just name and state.  The vendor could have lots of properties that would be of interest.    
0
 
oliverpoldenCommented:
You use the taxonomy to create the relationship and then you can use all the fields you want from the vendor
0
 
savageanneAuthor Commented:
Sorry about abandoning this question.  I've just gotten back to this project and realized that I had not fully understood the options in views.  You can set a "relationship" in a view which provides the ability to establish these kinds of connections.  I didn't get a chance to experiment with the module you suggested.
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now