I can’t find the answer to his anywhere online as of yet.
I’m developing a Drupal module for a client website. The custom content type is called bid. I’ve created one field using cck that is a node reference. The other fields are generated inside the module using hook_form_alter, hook_form_state etc. On the create bid page the cck field loads the nodereference through the url. Example: example.com/node/add/bid/75. How do I access the referenced node inside my .module file where the form is generated? In other words, how do I load the info (nid, user, path, etc.) for the referenced node within my custom .module script? Thanks for your time.
I can’t find the answer to his anywhere online as of yet. I’m developing
Share
if 75 is your node id you can get your node id by
$nid = arg(3) ; // where url is like this (node/add/bid/75)
then you can use node_load($nid) which return object of the information