I am working on a church website with civicrm integration.
What I want is a list of church members sorted or grouped by household.
Sorting by sortname is no problem. I am able to get members with the same last name to show up below each other. And then from the eldest to the youngest of a family.
The problem is with children from divorced families. They dont have the same last name but do live (in most cases) on the same address. The mother has her own maiden name, and the children the name of their father. But in this case the children are part of the household of the mother.
When sorting on last name the children do not list under the mother.
I know there is an option to do something with relations, from A to B but it is not clear to me how this works.
I read information that is related, but not specific here, and here.
Any help would be greatly appreciated!
This is an export of my current view:
$view = new view();
$view->name = 'civicrm_ledenlijst';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'civicrm_contact';
$view->human_name = 'Civicrm ledenlijst';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Civicrm ledenlijst';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['use_more_text'] = 'meer';
$handler->display->display_options['access']['type'] = 'role';
$handler->display->display_options['access']['role'] = array(
3 => '3',
2 => '2',
);
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['exposed_form']['options']['submit_button'] = 'Toepassen';
$handler->display->display_options['exposed_form']['options']['exposed_sorts_label'] = 'Sorteren op';
$handler->display->display_options['exposed_form']['options']['sort_asc_label'] = 'Oplopend';
$handler->display->display_options['exposed_form']['options']['sort_desc_label'] = 'Aflopend';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '150';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['quantity'] = '9';
$handler->display->display_options['pager']['options']['expose']['items_per_page_label'] = 'Items per pagina';
$handler->display->display_options['pager']['options']['expose']['items_per_page_options_all_label'] = '- Alle -';
$handler->display->display_options['pager']['options']['expose']['offset_label'] = 'Startpunt';
$handler->display->display_options['pager']['options']['tags']['first'] = '« eerste';
$handler->display->display_options['pager']['options']['tags']['previous'] = '‹ vorige';
$handler->display->display_options['pager']['options']['tags']['next'] = 'volgende ›';
$handler->display->display_options['pager']['options']['tags']['last'] = 'laatste »';
$handler->display->display_options['style_plugin'] = 'table';
$handler->display->display_options['style_options']['columns'] = array(
'sort_name' => 'sort_name',
'birth_date' => 'birth_date',
'street_address' => 'street_address',
'postal_code' => 'postal_code',
'city' => 'city',
'phone' => 'phone',
'phone_1' => 'phone_1',
'email' => 'email',
);
$handler->display->display_options['style_options']['default'] = '-1';
$handler->display->display_options['style_options']['info'] = array(
'sort_name' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'birth_date' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'street_address' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'postal_code' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'city' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'phone' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'phone_1' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'email' => array(
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
);
$handler->display->display_options['style_options']['sticky'] = TRUE;
/* Veld: CiviCRM Contacts: Sort Name */
$handler->display->display_options['fields']['sort_name']['id'] = 'sort_name';
$handler->display->display_options['fields']['sort_name']['table'] = 'civicrm_contact';
$handler->display->display_options['fields']['sort_name']['field'] = 'sort_name';
$handler->display->display_options['fields']['sort_name']['label'] = 'Naam';
$handler->display->display_options['fields']['sort_name']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['sort_name']['link_to_civicrm_contact'] = 0;
/* Veld: CiviCRM Contacts: Birth Date */
$handler->display->display_options['fields']['birth_date']['id'] = 'birth_date';
$handler->display->display_options['fields']['birth_date']['table'] = 'civicrm_contact';
$handler->display->display_options['fields']['birth_date']['field'] = 'birth_date';
$handler->display->display_options['fields']['birth_date']['label'] = 'Geb. datum';
$handler->display->display_options['fields']['birth_date']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['birth_date']['date_format'] = 'custom';
$handler->display->display_options['fields']['birth_date']['custom_date_format'] = 'd-m-Y';
$handler->display->display_options['fields']['birth_date']['second_date_format'] = 'long';
$handler->display->display_options['fields']['birth_date']['timezone'] = 'Europe/Amsterdam';
/* Veld: CiviCRM Address: Full Street Address */
$handler->display->display_options['fields']['street_address']['id'] = 'street_address';
$handler->display->display_options['fields']['street_address']['table'] = 'civicrm_address';
$handler->display->display_options['fields']['street_address']['field'] = 'street_address';
$handler->display->display_options['fields']['street_address']['label'] = 'Adres';
$handler->display->display_options['fields']['street_address']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['street_address']['location_type'] = '0';
$handler->display->display_options['fields']['street_address']['location_op'] = '0';
$handler->display->display_options['fields']['street_address']['is_primary'] = 0;
$handler->display->display_options['fields']['street_address']['is_billing'] = 0;
/* Veld: CiviCRM Address: ZIP / Postal Code */
$handler->display->display_options['fields']['postal_code']['id'] = 'postal_code';
$handler->display->display_options['fields']['postal_code']['table'] = 'civicrm_address';
$handler->display->display_options['fields']['postal_code']['field'] = 'postal_code';
$handler->display->display_options['fields']['postal_code']['label'] = 'Postcode';
$handler->display->display_options['fields']['postal_code']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['postal_code']['location_type'] = '0';
$handler->display->display_options['fields']['postal_code']['location_op'] = '0';
$handler->display->display_options['fields']['postal_code']['is_primary'] = 0;
$handler->display->display_options['fields']['postal_code']['is_billing'] = 0;
/* Veld: CiviCRM Address: City / Suburb */
$handler->display->display_options['fields']['city']['id'] = 'city';
$handler->display->display_options['fields']['city']['table'] = 'civicrm_address';
$handler->display->display_options['fields']['city']['field'] = 'city';
$handler->display->display_options['fields']['city']['label'] = 'Plaats';
$handler->display->display_options['fields']['city']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['city']['location_type'] = '0';
$handler->display->display_options['fields']['city']['location_op'] = '0';
$handler->display->display_options['fields']['city']['is_primary'] = 0;
$handler->display->display_options['fields']['city']['is_billing'] = 0;
/* Veld: CiviCRM Phone Details: Phone Number */
$handler->display->display_options['fields']['phone']['id'] = 'phone';
$handler->display->display_options['fields']['phone']['table'] = 'civicrm_phone';
$handler->display->display_options['fields']['phone']['field'] = 'phone';
$handler->display->display_options['fields']['phone']['label'] = 'Tel. vast';
$handler->display->display_options['fields']['phone']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['phone']['location_type'] = '0';
$handler->display->display_options['fields']['phone']['location_op'] = '0';
$handler->display->display_options['fields']['phone']['is_primary'] = 0;
$handler->display->display_options['fields']['phone']['phone_type'] = '1';
/* Veld: CiviCRM Phone Details: Phone Number */
$handler->display->display_options['fields']['phone_1']['id'] = 'phone_1';
$handler->display->display_options['fields']['phone_1']['table'] = 'civicrm_phone';
$handler->display->display_options['fields']['phone_1']['field'] = 'phone';
$handler->display->display_options['fields']['phone_1']['label'] = 'Tel. mobiel';
$handler->display->display_options['fields']['phone_1']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['phone_1']['location_type'] = '0';
$handler->display->display_options['fields']['phone_1']['location_op'] = '0';
$handler->display->display_options['fields']['phone_1']['is_primary'] = 0;
$handler->display->display_options['fields']['phone_1']['phone_type'] = '2';
/* Veld: CiviCRM Email: E-mailadres */
$handler->display->display_options['fields']['email']['id'] = 'email';
$handler->display->display_options['fields']['email']['table'] = 'civicrm_email';
$handler->display->display_options['fields']['email']['field'] = 'email';
$handler->display->display_options['fields']['email']['location_type'] = '0';
$handler->display->display_options['fields']['email']['location_op'] = '0';
$handler->display->display_options['fields']['email']['is_primary'] = 1;
/* Sorteercriterium: CiviCRM Contacts: Last Name */
$handler->display->display_options['sorts']['last_name']['id'] = 'last_name';
$handler->display->display_options['sorts']['last_name']['table'] = 'civicrm_contact';
$handler->display->display_options['sorts']['last_name']['field'] = 'last_name';
/* Sorteercriterium: CiviCRM Contacts: Birth Date */
$handler->display->display_options['sorts']['birth_date']['id'] = 'birth_date';
$handler->display->display_options['sorts']['birth_date']['table'] = 'civicrm_contact';
$handler->display->display_options['sorts']['birth_date']['field'] = 'birth_date';
/* Filtercriterium: CiviCRM Contacts: Contact Type */
$handler->display->display_options['filters']['contact_type']['id'] = 'contact_type';
$handler->display->display_options['filters']['contact_type']['table'] = 'civicrm_contact';
$handler->display->display_options['filters']['contact_type']['field'] = 'contact_type';
$handler->display->display_options['filters']['contact_type']['value'] = array(
'Individual' => 'Individual',
);
/* Filtercriterium: CiviCRM Contacts: Is Deleted */
$handler->display->display_options['filters']['is_deleted']['id'] = 'is_deleted';
$handler->display->display_options['filters']['is_deleted']['table'] = 'civicrm_contact';
$handler->display->display_options['filters']['is_deleted']['field'] = 'is_deleted';
$handler->display->display_options['filters']['is_deleted']['value'] = '0';
/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'civicrm-ledenlijst';
$handler->display->display_options['menu']['type'] = 'normal';
$handler->display->display_options['menu']['title'] = 'Civicrm ledenlijst';
$handler->display->display_options['menu']['name'] = 'main-menu';
$translatables['civicrm_ledenlijst'] = array(
t('Master'),
t('Civicrm ledenlijst'),
t('meer'),
t('Toepassen'),
t('Reset'),
t('Sorteren op'),
t('Oplopend'),
t('Aflopend'),
t('Items per pagina'),
t('- Alle -'),
t('Startpunt'),
t('« eerste'),
t('‹ vorige'),
t('volgende ›'),
t('laatste »'),
t('Naam'),
t('Geb. datum'),
t('Adres'),
t('Postcode'),
t('Plaats'),
t('Tel. vast'),
t('Tel. mobiel'),
t('E-mailadres'),
t('Page'),
);