Hi,

I'm new to views 2 in Drupal 6, and there is a specific SQL pattern that I was used to do in V1, I can't figure out how to do it anymore in V2. I'm btw totally amazed by how v2 behaves. So smooth & powerful!

My issue is about the "classical" pattern of relationships. I would like to have the SQL schema as described in the attached picture. So I use a relationship to do that. (This relationship appears in the views configuration).

$data['custom_reviews']['rid'] = array(
    'title' => t('Custom Reviews'),
    'help' => t('The node the uploaded file is attached to'),
    'relationship' => array(
      'label' => t('Custom Reviews'),
      'base' => 'node',
      'base field' => 'nid',
    ),
  );

However, I' can't figure out a way to say from the interface "Hey, now I have this related table, I want to filter only the nodes type X of the related table".

(Before in V1, I simply created a table alias instead with the API, and I had an argument handler to do the request on the related table). Now I don't know if I should do that graphicaly (graphical way to control the related table) or directly into code (by the use of a handler OK, but where should I put it in the 'relationship'). I've read so far some documentation about relationships saying "it's possible" so I might be missing an obvious thing in my relationship, but I don't see...

Thank you, any help would be greatly appreciated.

CommentFileSizeAuthor
schema.png101.92 KBStriky2

Comments

merlinofchaos’s picture

Once you have the relationship in place, just add the Node: Type filter, and a new dropdown will appear where you can select the relationship. Once you select the relationship, the related node will be what's filtered.

Striky2’s picture

Status: Active » Fixed

Thank you, it was so easy that I didn't even think it could be that easy! Incredibly nice feature for advanced usage! It rocks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.