In drupal 6, I have an event node type and an event_attend node type.

The event_attend node type has a nodereference to event. In hook_form_alter for the event_attend node type, i added a validation routine.

In the validation routine, i would like to have access to the parent event node. I would like to compare event_attend's date of participation to the date when the event is taking place.

Is there a way of doing this without doing a node_load($nid_of_parent_event)?

I was kind of hoping that somewhere in the $form variable lies data for the parent event's date but I think such is not the case. That is why I am posting the question here.

I am using openatrium 6x by the way. Anyway, I'll just make a query directly to the database to get the parent event's date using the event nid.

Thanks to everyone.

2 Answers 2


In drupal 6, the standard way of doing this is by using the following function:

node_load($nid = NULL, $vid = NULL, $reset = FALSE)

However if you want to implement it in Drupal 7, it becomes a lot easier using the Views and the References module. All you need to do is :

  1. Create two different content types say a and b and add fields to them. You MUST add a node reference field(say to b)
  2. A pop up would ask you to choose which node you would like to reference(choose a here) After that if you wish to look for some advanced settings, you can add Relationships depending on your requirement.

1.In Drupal 7,With the help of Reference**s module,you can refer one **CONTENT TYPE to ANOTHER CONTENT TYPE. 2.Suppose you want to refer second content type from first content type. 3.Then,while creating first content type,create a field of type NODE REFERNCE. 4.Then ,while creating the content,just add the second content type which u want to be displayed. 5.you can also link two content types with views using this REFERENCES module and by adding contextual filters and adding a relationship.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.