Posted By

janlodey on 05/27/11


node drupal views arguments Reference relationship

Versions (?)

Views node relationship argument

 / Published in: PHP

Use this to pull a list of items based on the nid of the 'parent' node.... so you can show fields added to that node, on the child. Handy.

Make nid argument..... use custom php arg code below to feed the argument the nid of the parent.

Remember to change the $ to the field name you are targeting..... IMPORTANT

  1. if (arg(0) == 'node' && is_numeric(arg(1))) {
  2. $node = node_load(arg(1));
  3. return $node->field_proj_parent_ref[0][nid];
  4. } else {
  5. return FALSE;
  6. }

Report this snippet  

You need to login to post a comment.