Hi,

I have a problem, and i cant seem to find a good solution to it, so i decided I'd make a thread about it. The thing i want to accomplish is the following:

I have 2 content-types, a music band and a band member. Then i want to relate the band members to the band with a many to one relation. One band can have many band members, but a band member can only be part of one band. I guess i can do this kind of relations with the node relations cck field.

But the problem is, how do i make this user-friendly. I want to do it like this:

User adds a music band, and within(or automatically redirected) the album/node/add form i would like to add a relative number of band members. Is this possible? I cant seem to find a solution.

The way i do it now is, i add a band, then i can go and add a band member and there i can choose from a list of all bands wich band this member is related to, this is unpractical because you need to do this very repatative, and with lets say 200 albums the list of bands to select would be very long. It should be possible to restrict the possible relations to the band the user just created.

Anybody know how to accomplish this?

Comments

WorldFallz’s picture

checkout the http://drupal.org/project/nodereferrer_create module.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

espenc’s picture

Ok, thanks for the tip, i checked it out, but it doesn't really solve the problem. For the first reason, the relies on development modules, but I can live with that, even on a production site, if it proves to be stable.

But the main problem is that it doesn't provide the functionality that I am after. If i used it right, it's only letting the user add related content after the node is added, from a tab when viewing the node's page view. This might be OK for administrators, but not for site users, it should be simplier.

What i want is to do it "inline" at the same time as I am editing the parent node, kind of like CCK field, but that CCK view should be displaying all the fields in a spesific node. Isnt this a very normal problem? Many-to-one relations is a very "normal" way to organize data.

WorldFallz’s picture

The word "normal" is a bit overloaded-- i would say its a somewhat common functional requirement. I used nodereferrer_create in my particular use case and it works fine.

You should be able to get closer to what you want with the http://drupal.org/project/formblock module. You could just add a block with the form to your node create page or use it in combination with the http://drupal.org/project/panels module to further fine tune it.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

LTech’s picture

Did you work out a good way to have a one-to-many relationship?
I have teachers who have worked at various schools and I would like to have one node for the teacher but be able to connect it to the different schools.

rudyard55’s picture

Ltech, I'm looking for the same functionality, were you able to find anything?

ludo1960’s picture

LTech’s picture

I used the node reference and node reference URL, once I figured out how they worked it did the trick.