I have a cck node type that contains a node reference to node gallery type. Since I don't want to actually create a new gallery for ever CCK node I have, I would like to do the fallowing. in the page that displays the cck node;
if the gallery reference exists for the given node, display a link to that gallery. If no gallery exists, I would like to display a link "add gallery", ideally, this would programatically create a new gallery node and reference. I would also like to automatically populate the title, as well as the author information (without giving the user access to this). I looked all over drupal.org to try and find the info but can't figure it out.
Thanks
to get current node's nid :
or using any field value of CCK A (that you know) and applying a join with node table