I have 3 content types let's say #1 #2 and #3.
Both #2 and #3 have a nodereference to a #1.

On a panel page I am displaying at /node/%node/overview the content of #1 with also 2 block-views which are showing some fields of the nodes referencing my node of type #1.

So that I get an overview.

I want to place a link which is allowing me to create a node of type #2 referencing the node of type #1 I'm currently "overviewing" and I want at submitting to get the views showing fields of nodes of type #2 to be refreshed to make appear the data related to the node I've just created.

What would be the right way to do that ?

Comments

jmary’s picture

Said differently, I'd like the callback js function to trigger the refreshing of the view which is appearing in the parent page to make the new referencing item appear without reloading the page.

jmary’s picture

I've written some clear specs about that as it might interest others.

Specifications :

  1. Give the possibility to add a referencing node at populating automatically the node reference field from a click on a link.
  2. the link is at the bottom of a view embedded anywhere as long as the node id referenced by the newly created node is accessible somewhere
  3. The possibility is triggered by a new option for views. (optional)
  4. So the view will be rendered with a link at its bottom : "Add a new referencing node".(can de done in panels)
  5. The click on this link is opening a modal frame containing the form to create the node
  6. At submission the embedded view is refreshed using ajax method to prevent to have to reload the parent page.

Modules implementing some of the features :

Nodereferrence_url widget : http://drupal.org/project/nodereference_url

This module will help to have 1 & 2

Modal Frame API 

5 is partially handled. For 6. This method can be implemented at adding code to the Modal Frame API. Also see ajax_view.js in the js directory of the views module.

Automodal

This module is not mandatory but provide an easy way to trigger the modal window at just adding a class to the link.

If that module is not used, a menu callback function has to be created.

The point 3 has to be written totally.

The point 4 can be handled in panels so that 3 is not mandatory to be written but would bring a lot of simplicity in the use of the feature.

Any suggestions or advises or ideas to enrich that are welcomed.

markus_petrux’s picture

Status: Active » Fixed

I'm not really sure which one is the support request here. If it is just advice, I'm afraid I cannot offer this kind of support. You should investigate this yourself.

Feel free to re-open if there's any doubt on how the API works.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.