On 2009-10-29, at 12:57 AM, Larry Garfield wrote:

Sadly I don't know of a full-on relationship handler from nodes to their users, which would let you get from an arbitrary node to its owner to that owner's profile nodes. But I have been wrong about such things before. :-)

You can do n*way relationships, but I'm sure the performance sucks with many relationships (as they are usually cross-table joins). You can "chain" relationships in the UI just be selecting a pre-existing relationship.

In your case, I don't think you even need 2 relationships. Build a node view, create a relationship of "Node: content profile" and it will join on the content profile of the author of each node. I got the following query showing me a view of all book pages and the title of their author's content node:

SELECT node.nid AS nid,
   node_users.title AS node_users_title,
   node_users.nid AS node_users_nid,
   node_users.language AS node_users_language,
   node.title AS node_title,
   node.language AS node_language
 FROM node node
 INNER JOIN users users ON node.uid = users.uid
LEFT JOIN node node_users ON users.uid = node_users.uid AND node_users.type = 'profile'
 WHERE node.type in ('book')


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to