Solved

How to handle relational data in drupal?

Posted on 2009-07-09
4
703 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is for those that are having major problems with users upload files such as pictures to their profile. The solution is simple and has to do with correcting the directory paths. With some experimenting and testing i got it fixed. Note…
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 …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

803 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