Dear all,
I've a content type ("A"), which contains a URL reference node (to content type "B") field.
My goal is to display the referenced node (content type "B") when I'm adding or editing the main node (content type "A").
I've enabled and configured the "Node add/edit form" and the referenced node it is being displayed just when an existing node is being edited. It is not working for node creation.
I don't know if it is normal (because as there is no content saved yet, drupal can't make the relationship) or if it is a bug.
Even if you add a custom content in the panel with just the "%nodereference:nid" substitution, nothing is shown.
How can I achive it in the node add form as well?
Could anyone help me?
Many thanks
Comments
Did you add your
Did you add your nodereference as a relationship?
I am asking thinking perhaps you may have overlooked it.
I know I did earlier in the day.
Same issue here
I'm running into the exact same issue.
* I've enabled the node add/edit page
* I've added my node reference field as a relationship in the panel page.
* All of the expected %nodereference context keywords are displayed on the contexts tab
* If I edit an existing node the %nodereference context is passed correctly
* If I add a new node the %nodereference data is not passed correctly even though it is being auto populated in the "add" form by nodereference_url
It seems the node add form is a special case and different from the edit form. This makes sense in some ways but it still feels like the context should still work since the nodereference value is in fact in the node add form.
Any suggestions are mucho appreciated.
Thanks!
When I re-checked this, I
When I re-checked this, I observed the same as well.
Maybe this should be posted as an issue on Panels or nodereference_url project pages?
Issue submitted
Thanks for testing that out.
I've submitted it as a support issue. Maybe someone else has some insite.
http://drupal.org/node/962914
Subscribe
Subscribe
Workaround
This is the way I've achived it, but this is just an workaround.
Creating a custom content:
print views_embed_view('VIEWNAME', $display_id = 'default', arg(3));
By the way, how can I get the number of URL arguments in order to put the result (the last one) instead of 3?
Thanks.
When you are on the add node
When you are on the add node page, the argument you are using for that view will always be arg(3) as in:
node/add/%nid.
I know, but I would like to
I know, but I would like to avoid hardcoded it.