Node Widget: create and reference nodes on the fly

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
ademarco's picture

I've just contributed a new module called "Node Widget", quoting the project description:

Node Widget allows to create and edit referenced nodes (stored in CCK nodereference fields) in the same form used to edit the main content. An editing form for referenced nodes is embedded in the main editing form; it is possible to select which fields should appear in this subform.

Here a screenshot illustrating the idea:

The content type "Band" has a node reference field "Album" which allows to create and reference new albums on the fly.

Check it out at: http://drupal.org/project/node_widget

I'm looking forward to hearing your comments.

Comments

This look very promissing!

DrupalCuckoo's picture

hi,

I'm looking for such a functionality for one of my content types and I couldn't figure out which way, which module I should use to achieve my goal (http://groups.drupal.org/node/48148).

I've heard that flexifield (http://drupal.org/project/flexifield) is the "module to go" until CCK 3 becomes stable. But flexifield is alpha and its status didn't change for almost a year now. Your module is in beta and it looks quite interesting.

Do you plan to bring this module to a stable version? What happens to your module when CCK 3 gets released (I'm talking about the multigroup part of CCK 3)?

Anyways, thanks for your contribution to the drupal community, very much appreciated :-)

best regards.

Better than flexifield for some use cases

pkej's picture

I think this module is better than flexifield, in some use-cases. Flexifield just adopts the fields from the other Content Types, while node_widget creates new nodes of the Content Type. Indeed, I have asked for this feature to be added to flexifield, but I haven't tested the latest versions to see if it has been added.

The only thing is that I would rather have a node_widget_reverse that instead works like this:

  • Create Content Type: Band
  • Create Content Type: Album
  • Add field "field_band" of type node_reference to Album which references Band
  • Add field node_widget in Band and select widget "field_band" as the operator.

Now, when creating a new Band, you will be able to create Album nodes. But, if you create a Content Type: Single, and reuse the "field_band" node_reference in Single, you will get the option to add either new "Album" or new "Band" nodes when creating "Band".

It would look and act exactly the same as node_widget, and as the screenshot above, but when selecting to add new lines, you would have several links one for each content type using the "field_band" node_reference field.

My actual Use Case

pkej's picture

I am trying to let people create events in their life, like the events in a GEDCOM file. There are three different events:

  • unary
  • binary
  • trinary

Each node has the same field, but as I sit typing this here at work, with no access to a Drupal install, I don't remember if it is possible to do this with one field only, but the unary will only let the user select one person, the binary will let him select two people, and the trinary will let the user select three.

A unary event is something unique for just one person, for example a confirmation, a batism, etc.

A binary event is something which involves another person; a partnership, a marriage, first meeting, a date etc.

A trinary event is something which involves three people. A birth is the most obvious one. A birth with twins would use two trinary events, in order to record which twin is the oldest etc. I can't think of other trinary operations at the moment.

Therefore, I would need something like the reverse_node_widget, where the widget in Person would be able to automatically show all events applying to the person, as well as adding new events of the three different types.

The reverse_node_widget should list all existing events which points to the node (ie. will not work upon node creation, only on node edits), regardless if they were created by the current node, since events which are relevant can be created several places.

Drupal 7 equivalent

faktor's picture

Hi,
Very useful module, I'm looking exactly for this, but supported in D7. Did you hear about something similar? Or do you know some ways, how to do that? Drupal 7 includes many of previous custom modules and functionalities in core, but node reference not. So I found this module http://drupal.org/project/references , which contains node_reference modul. But this funtionality cannot be provided only with this modules. I think there might be a way how to do it.
Thanks
Regards

paranojik's nodeconnect -- search and reference

steveoliver's picture

@paranojik's Nodeconnect -- search and reference sandbox module has worked pretty well for me on D7.