Answers.Body: <p>If you're in Drupal, I would use <a href="https://www.drupal.org/project/webform" rel="nofollow">Webform</a> with <a href="https://www.drupal.org/project/webform_civicrm" rel="nofollow">Webform Civicrm Integration</a> to collect more data. It allows you to collect info for multiple contacts as well as to create relationships between them. So for your use case, you could have for example a parent contact, a student contact, and a household contact, while all the relationships such as household member-household and parent-child get created automatically. </p>
  
  <p>If you're in wordpress, I'm not sure what the right plugin is, but I bet there is something similar you could use. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-21T13:16:36.497Z
Answers.Text: ok, thanks. i have created the webform, and now, the household contacts are created and the membership register too, easy. Now, i want to create automatic relationship from this webform, but i don`t know how to do this. The families, only writes the household_name, telephone and email, and with this data, i need to create the relationship with the existing individual contact, wich has the same last_name that the household_name.
Answers.UserDisplayName: Jabier
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-22T14:19:15.690Z
Answers.Text: When editing your webform you should have tabs across the top. Go to the last tab, CiviCRM. Then you will see tabs down the side. For yours, you might have contact 1, and then household 1, and then maybe contact 2, depending on how you set it up. In any tab past the first, you can set up relationships. So for example if the household is below contact 1, you can scroll down to "enable relationship fields." Once you choose yes, you can set relationship types. set "is active" to "yes." Hope that helps! If it's confusing, I can try for some screenshots, just let me know.
Answers.UserDisplayName: naomisl
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-18T14:54:52.513Z
Answers.LastActivityDate: 2015-09-18T14:54:52.513Z
Answers.UserDisplayName: naomisl
Body: <p>We are an association of parents of students.</p>
  
  <p>We have a Contribution page for Membership Registration. But we can only add individual and organization fields to this contribution page, no household fields. Is this a CiviCRM bug?</p>
  
  <p>Then we need a hook to search the household contact with the surnames of the individual contact, and if found, link the contribution to that household, and if not found, add new one.</p>
  
  <p>Currently we have to link the individual and household records or create a new household and remove the individual.</p>
  
  <p>How can we configure a contribution page to add and link an individual and a household record properly?</p>
  
Tags: <contacts><contributions>
Title: hook for search a household contact with the surname individual field from online contribution page
ThreadText: # hook for search a household contact with the surname individual field from online contribution page
  
  (Asked by: username_0 on 2015-09-18)
  
  We are an association of parents of students.
  
  We have a Contribution page for Membership Registration. But we can only add individual and organization fields to this contribution page, no household fields. Is this a CiviCRM bug?
  
  Then we need a hook to search the household contact with the surnames of the individual contact, and if found, link the contribution to that household, and if not found, add new one.
  
  Currently we have to link the individual and household records or create a new household and remove the individual.
  
  How can we configure a contribution page to add and link an individual and a household record properly?
  
  **Tags:** contacts, contributions
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-09-18. Score: 1 | Accepted answer
  
  If you're in Drupal, I would use [Webform](https://www.drupal.org/project/webform) with [Webform Civicrm Integration](https://www.drupal.org/project/webform_civicrm) to collect more data. It allows you to collect info for multiple contacts as well as to create relationships between them. So for your use case, you could have for example a parent contact, a student contact, and a household contact, while all the relationships such as household member-household and parent-child get created automatically.
  
  If you're in wordpress, I'm not sure what the right plugin is, but I bet there is something similar you could use.
  
  > **Comments:**
  > **username_0**: ok, thanks. i have created the webform, and now, the household contacts are created and the membership register too, easy. Now, i want to create automatic relationship from this webform, but i don`t know how to do this. The families, only writes the household_name, telephone and email, and with this data, i need to create the relationship with the existing individual contact, wich has the same last_name that the household_name.  
  > **username_1**: When editing your webform you should have tabs across the top. Go to the last tab, CiviCRM. Then you will see tabs down the side. For yours, you might have contact 1, and then household 1, and then maybe contact 2, depending on how you set it up. In any tab past the first, you can set up relationships. So for example if the household is below contact 1, you can scroll down to "enable relationship fields." Once you choose yes, you can set relationship types. set "is active" to "yes." Hope that helps! If it's confusing, I can try for some screenshots, just let me know.  
  
  ---
  
  