I'm trying to create a website where there are two content types:
Criminals and Offenses

  • I want to be able to add/edit offenses when I add/edit a criminal. (I am not able to do this)
  • I also want to list all the offenses a criminal has committed on the criminal's node page. (I am able to do this)

So, I tried using editablefields. It works exactly like I want on the criminal's edit page. It shows all the offenses (editable) the criminal has committed and the form to add a new offense.

This is great, but....

So then I visited a criminal's edit page that didn't have any offenses yet, and the form to create a new offense was missing.

Should the add offense form be displayed on the criminal's add/edit page when there isn't any offenses(node references)? I want it to be able to show the add offense form on the criminal's add/edit page even if there isn't any offenses(node references).

Can someone please tell me if what I am trying to do is not possible with editablefields? What am I doing wrong?

I created a view(block) of type "Editablefields - Table" that has a nodereference to the name of the criminal as an argument.

I did get the criminal's offenses to display on the criminal's node page with this code on the views arguments.

if  (arg(0) == 'node' && is_numeric(arg(1)))  {
	$criminal= node_load(arg(1));
	if ($criminal->nid) {
		return array($criminal->nid);
	}
}

This works also:
$args[0] = arg(1);

I am so close to having this all finished, I just need a little help from the community.
Here is a screenshot of what is happening.

Can someone please point me in the right direction as to what I should be doing?

Thanks,

Glenn