Views Module and Relationships - help :-)

Hi guys I am really finding views very useful to dispay data etc. However, I really am struggling a little to fully understand how Relationships work. Does anyone you have any info on this area or could you point me in the right direction as I cannot find any other info on the net which really covers this - other than the Help within the module. Can I force/create relationships on data that is not inherently related? Thanks
mysty's picture

+1

There was an oblique reference to the power behing this feature (I think) at Drupal for Musicians, and as someone who hasn't explored this yet I'm certainly interested in what it's for and how it can be used, if anyone has a link or summary. I think the comment was that there was little documentation on it. I've tried to ask about this in #drupaluk too, but probably didnt frame the question right.
darren's picture

relationships

Views 2 is awesome, and the ability to create relationships is one of the reasons why. Essentially, Views is a Query builder that helps you select sets of data from the database without having to understand the Drupal database schema nor write any SQL. If a relationship is not already available for the query you are trying to build you can specify your own by creating a module and implementing hook_views_data(). To do this you create a function called yourmodulename_views_data() that returns an array detailing the relationship you are trying to create. Documentation on how to do this is here: http://views-help.doc.logrus.com/help/views/a... but I didn't really "get it" until I studied hooks provided with Views 2 and some other modules such as Flag.

Relationships

Ah I see (or I think I do). Thanks for the link