Recipe 30 in Packt's Views Recipes book is called "Relating Content Types with reverse node reference". I'm trying to do this in Drupal 6 but am having major problems understanding what's going on.
basically, it says create 2 content types. "Press Release" (just a simple node with a date field) & "Media hit" (another simple node type - just with a node reference field that references one or more "Press Release" nodes). it then says create a view that will provide a block, so that every time you visit a "Press Release" node you'll see a block appear with a list of all "Media Hit" nodes that reference it (provided any exist - if not the block won't appear)
simple? not for me
i get that - when you're building this 'block' view - you pass a node reference field in as an argument (not sure why) but then i get stuck. things i don't understand (in the pretty complicated "Configure argument" section) include...
- "Action to take if argument is not present" - which option should & choose & why (& i won't kill anyone for going into a bit of detail about the various options here)
- the "Provide default argument" choice (including, again, which one i should choose & why)
- the validator options
the lady who wrote the book included some argument handling code to put somewhere...
if ($type == 'block' && arg(0) == 'node' && is_numeric(arg(1))) {
$nid = arg(1);
$args[] = $nid;
} return $args;
but whether this code belongs in the "PHP argument code" section or the "PHP validate code" section I don't know (or know why)
anyway, i know its an ask to explain this as it seems pretty complicated, but if anyone can help it may help me break the back of the whole views arguments thing
yours, david