Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jackrabbithanna/170a3537adc06238d0ee9e74027727ae to your computer and use it in GitHub Desktop.
Save jackrabbithanna/170a3537adc06238d0ee9e74027727ae to your computer and use it in GitHub Desktop.
Views export for contribution page view, with price set entity and price set relationships
$view = new view();
$view->name = 'contribution_pages';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'civicrm_contribution_page';
$view->human_name = 'Contribution Pages';
$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'] = 'Contribution Pages';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'none';
$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['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '10';
$handler->display->display_options['style_plugin'] = 'table';
/* Relationship: CiviCRM Contribution Page: Price Set Entity */
$handler->display->display_options['relationships']['civicrm_price_set_entity']['id'] = 'civicrm_price_set_entity';
$handler->display->display_options['relationships']['civicrm_price_set_entity']['table'] = 'civicrm_contribution_page';
$handler->display->display_options['relationships']['civicrm_price_set_entity']['field'] = 'civicrm_price_set_entity';
/* Relationship: CiviCRM Price Set Entities: Price Set */
$handler->display->display_options['relationships']['civicrm_price_set']['id'] = 'civicrm_price_set';
$handler->display->display_options['relationships']['civicrm_price_set']['table'] = 'civicrm_price_set_entity';
$handler->display->display_options['relationships']['civicrm_price_set']['field'] = 'civicrm_price_set';
$handler->display->display_options['relationships']['civicrm_price_set']['relationship'] = 'civicrm_price_set_entity';
/* Field: CiviCRM Contribution Page: Contribution Page ID */
$handler->display->display_options['fields']['id']['id'] = 'id';
$handler->display->display_options['fields']['id']['table'] = 'civicrm_contribution_page';
$handler->display->display_options['fields']['id']['field'] = 'id';
/* Field: CiviCRM Price Sets: Price Set ID */
$handler->display->display_options['fields']['id_1']['id'] = 'id_1';
$handler->display->display_options['fields']['id_1']['table'] = 'civicrm_price_set';
$handler->display->display_options['fields']['id_1']['field'] = 'id';
$handler->display->display_options['fields']['id_1']['relationship'] = 'civicrm_price_set';
$handler->display->display_options['fields']['id_1']['separator'] = '';
/* Filter criterion: CiviCRM Price Set Entities: Entity Table */
$handler->display->display_options['filters']['entity_table']['id'] = 'entity_table';
$handler->display->display_options['filters']['entity_table']['table'] = 'civicrm_price_set_entity';
$handler->display->display_options['filters']['entity_table']['field'] = 'entity_table';
$handler->display->display_options['filters']['entity_table']['relationship'] = 'civicrm_price_set_entity';
$handler->display->display_options['filters']['entity_table']['value'] = 'civicrm_contribution_page';
/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'contribution-pages';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment