?
Solved

How to handle relational data in drupal?

Posted on 2009-07-09
4
Medium Priority
?
723 Views
Last Modified: 2012-05-07
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
Comment
Question by:savageanne
  • 2
  • 2
4 Comments
 
LVL 10

Expert Comment

by:oliverpolden
ID: 24819041
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
 

Author Comment

by:savageanne
ID: 24819472
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
 
LVL 10

Expert Comment

by:oliverpolden
ID: 24828223
You use the taxonomy to create the relationship and then you can use all the fields you want from the vendor
0
 

Accepted Solution

by:
savageanne earned 0 total points
ID: 25139347
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

RTL (right to left) web applications aiming for audiences speaking languages like Hebrew or Arabic, are generally more complicated than the same applications aiming for audiences speaking Latin based languages. The main difference lies of course …
In the below post we have mentioned the best hosting type for startups. Also, check out some of the superlative web hosting companies that are proposing affordable web hosting solutions to host your startup website.
Watch the video to learn how one can deal with PST file corruption issue with an outstanding Kernel for Outlook PST Repair Tool easily. Using this tool, non-technical users can swiftly perform the repair process to restore their essential data witho…
In the video, one can understand the process of resizing images in single or bulk. Kernel Bulk Image Resizer is an easy to use tool for resizing large number of images. One can add and resize multiple images with this tool in single go. The video sh…

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question