Is is possible to make this work in block form, if using this module
http://drupal.org/project/formblock
for example on the same page as current node to add referenced nodes to that node. I was thinking if some fallback method like PHP field could help this? So i can just pass NID of current Node and make it work?

Comments

quicksketch’s picture

Category: feature » support

You can set the hidden "nodereference_url_paths" variable to include the current node page as the reference URL like this in your settings.php file:

$conf['nodereference_url_paths'] = array('node/add/%type/%nid', 'node/%nid');

'node/add/%type/%nid' is the default location that Node Reference URL comes with, which you'd probably want to keep in place. 'node/%nid' is the new one that would tell Node Reference URL to pull the NID from the current page.

Marko B’s picture

This works perfectly, great and thanx. happy 2011 :-)

socialnicheguru’s picture

I have an event field
I have an image field
I have a node reference in my event field that points to my image field, field_image_ref.
I have a node reference url from image back to event, field_event_ref

I can use this on the node edit page for the event and have a block on the form using panels or context.

Will the node references above to set appropriately using this method?

Thanks!

EDIT- hmmm, when I create an event, the nid is not created until I hit save. how will this effect the above?

quicksketch’s picture

Status: Active » Closed (fixed)

@SocialNicheGuru Your question sounds related but different. I don't provide support on Panels in any way, so I'm closing this issue directly.

itserich’s picture

#1 Works.

Thank you, thank you quicksketch.

I have panels with events, and a registration form attached. This easily relates the registration form to the original node.

Also have panels with items and review forms attached. This easily relates the review form to the original item.

I am using on D7.

Thanks so much, have spent weeks trying to figure out and this is a solid approach.

Edit There were a couple other suggestions how to do this made here: http://drupal.org/node/494008

itserich’s picture

A tip.

To enable Node Reference URL WIdget within a panel, the panel should be created as a variant within the Node Template panel.

Will not work if ceated as a panel page, which is logical, because that is not a node.

queryblitz’s picture

Concerning #1: Thanks for this! I did get an error a couple times but I'm not entirely sure what it was from. Anyway it's gone now and this seems to be working splendidly!

cassien’s picture

works great thx a lot