Hi
I have a very useful module that uses views to create a spreadsheet based upon two separate tables "left joined" and it works great. I wanted to add some new functionality by using CCK to gather some dates and that is where the fun begins. My "Usage Profile" content type now includes content_type_usage_profile and the content_field_date as well usage_profile and usage_profile_data.
If I choose to create a type "Node" then I see the CCK fields I want however I lose access to my leff-joined table however if I choose to create a type "Usage Profile" I find all my leff-joined data but lose access to the CCK fields.
I don't really mind which way I fix this, though the least amount of work for me I suspect would be to expose CCK to my Usage Profile type, if that is not possible I'd be happy with exposing my left-joined table to the Node type. However, I don't know how to tackle either of these and was hoping somebody here can point me in the right direction.
Comments
Comment #1
merlinofchaos commentedYour best bet will be to create a relationship from your Usage Profile to node -- by adding that relationship to your view, everything associated with nodes would become available. This is a lot easier than trying to specifically relate CCK data to your base table by modifying CCK's tables.
A good example of very simple relationships is the comment user relationship in comment.views.inc
Comment #2
Dave Kinchlea commentedPerfect, thanks! Works like a charm, easy as pie to setup and it gave me exactly what I wanted.
For anybody interested, I already had the relationship entrenched in code, I just had to tell views about it. I added the following to usage_profile.views.inc:usage_profile_views_data()