I consider myself reasonably intelligent, and I cannot, for the life of me, figure out what this module is supposed to do, neither from the project page nor from the README.txt, nor from the interface text. I'm about to dive into the code, and read through the tests, and hopefully will be able to figure it out from there. But most people are not going to have this luxury.

Something that would help tremendously is if there was an actual use case instead of things like "Node Alpha" and "Node Beta" and "field_reference1". For example, what I picture this module being able to help with is a situation where you have an "Event" node type with an "Attendee" node reference field that can refer to multiple "Person" nodes, and this module would allow you to see both the people attending a certain event, as well as the events a certain person has attended. If not, I'm clearly barking up the wrong tree. But if so, that would give people reading the project description an immediate "ah-ha!" moment.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

redben’s picture

Isn't what you "think" this module does alreay covered by noderelationships ?

webchick’s picture

Maybe. I was hoping for something that didn't require a bunch of JS crap. :)

webchick’s picture

Like, this. This would've helped me out a lot:

--

For example, let's say you have two content types: Attendee and Event. Event has a node reference field called "Attendees" (field_attendees) that references Attendee types. When you click on an Event node, you'll see a list of the Attendee nodes that it references; this functionality is built into the core CCK Node Reference field.

Backreference module allows you to have the inverse, where clicking on an Attendee node will show you the Events they are attending.

1. Add a new node reference field to the Attendee type called "Events" (field_events), which references Event types.

2. Go to the "Attendees" node reference field configuration page, and set its "Backreference field" setting to "field_events".

3. Create a new Event node, and fill outs its Attendees field. Those attendees will each have a link back to the referenced event node on their node page.

Backreference module also keeps these fields auto-synchronized, so when you delete an even or attendee, or remove an attendee from an event, the changes are reflected on both sides.

--

Great module, btw! :)

webchick’s picture

Title: Write less brain-explodey documentation » Re-write README.txt for mere mortals
Status: Active » Needs review
FileSize
3.53 KB

Here we go.

Changes:

1. Added step-by-step instructions with real world use cases, as per above.

2. No one cares that this acts on nodeapi, except for developers, who can find that information out in the .module header. Removed. I did keep the fact that the module has SimpleTest coverage, and the fact that it was used in production though, as that seems useful to know.

3. Formatted with headings and wrapped at 80 chars, per Drupal core's standard.

4. Oh. And removed the module installation instructions. Honestly, if you can't figure that out, your brain will implode about left vs. right node relationships. ;)

webchick’s picture

FileSize
1.55 KB

And here's the straight-up new README.txt, for those who find reading English easier than reading patches. ;)

domidc’s picture

@webchick You should check out http://drupal.org/project/cnr , this module does about the same as backreference but in a different way and it also allows you to have one-to-many node references and muti node type referencing.

AdrianB’s picture

Thanks for that readme, I felt the same when I read the project page.

carlos8f’s picture

joelstein’s picture

I think the updated instructions are very clear.

However, one point which is still unclear to me, and may be to other users, is this: Do you need to configure the back reference on both fields, or just one?

webchick’s picture

Just the one. Basically the "master" Node reference field, and you tell it the "slave" node reference field to keep in sync. Or at least based on my half hour of digging around. ;) It might allow for more complex relationships, too, not sure.

joselstein: Could you take a stab at adding that to the instructions in some way so they'd be clear for the next person with that question?

SocialNicheGuru’s picture

I am still a little confused as I am looking at many of these modules.

If I have my event type and it has a link to location node
events has one location in this instance and location can have more than one event

Can I use backreference for this one to many?
if so, then would I put a backreference on the node reference in the event to the location node?

Thanks

jcfiala’s picture

1) Yes, you can use backreference for the one to many relationship.

2) Yes, you can set up the backreference by editing the nodereference field on the event type, and telling it to refer to the location node's nodereference. You only need to set it up the once, as the relationship is symmetric.

SocialNicheGuru’s picture

do I need to set the number of values for the node reference field
so the one with many can be unlimited
the one with only one value is just "1"?

jcfiala’s picture

Version: 6.x-1.0 » 6.x-1.1
Assigned: Unassigned » jcfiala
Status: Needs review » Fixed

Okay - this is going to be in the new edition. Thanks for the input!

Status: Fixed » Closed (fixed)

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