I can get this working ok but I have a problem.
Let me explain my setup:
- I have a node type "Contest", these are referenced from node type "Entries". Entries can only reference one contest.
The problem is that if I check "Require this relationship" for the reverse node reference relationship (in the view that shows the Entries on Contest nodes) - nothing shows up at.
If I un-check "Require this relationship" Entries show up on all Contests, not just the Contest they have referenced.
I'm printing the View directly in the node template using views_embed_view() - should I be doing this differently?
The only other node reference module I have installed in Nodereference Views - so I can show fields instead of the node teaser on referring nodes.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | referenced-captions-views-export.txt | 3.37 KB | Jeff Burnz |
Comments
Comment #1
Jeff Burnz commentedJust some more info:
Drupal 6.17
Views 6.x-2.11
CCK 6.x-2.7
MySQL 5.1.34
Attached my view export.
Comment #2
markus_petrux commentedBest advice I can give is: get the SQL statement from the Views UI after executing the view, then paste the SQL statement and play with it in phpMyAdmin. Study the contents of the tables involved to understand why rows are included/excluded in the query result.
Hint: Even though a CCK Node Reference field could be empty in the node form and not rendered when viewing the node, there could be a record in the database for it, with a NULL value. So when the table where this reference is stored is used in INNER JOINS, you may still need to filter by values that are NOT NULL.