Drupal 6. Relate nodes based on CCK Profile field values
I am building a drupal 6 page view which needs to display a list of nodes depending on the value selected in a user's content profile.
Excuse me if I don't explain things clearly, my brain is fried after a long day :|
Summary: User selects a value from a node reference field in their content profile
Create view page which displays all nodes in a table, filtered by the specific value in the profile.
User can not see nodes from other values in the node reference. only their selected value
User1 - has selected advanced User2 - has selected intermediate User3 - has selected *advanced user4 - has selected intermediate user5 - has selected beginner
User1, User3 are able to see each others nodes in a table same goes for User2 and User4. User 5 only see's one node submitted
Here is a page i have been referencing for assistance: Here But i am not using panels module(which shouldn't matter anyways)
my view:
$view = new view;
$view->name = 'AuthorSchedules';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'field_type_nid' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'label_type' => 'custom',
'format' => 'plain',
'multiple' => array(
'group' => 1,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => 0,
),
'exclude' => 0,
'id' => 'field_type_nid',
'table' => 'node_data_field_type',
'field' => 'field_type_nid',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'field_center_local_nid' => array(
'label' => 'Schedule Details',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'label_type' => 'custom',
'format' => 'plain',
'multiple' => array(
'group' => 1,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => 0,
),
'exclude' => 0,
'id' => 'field_center_local_nid',
'table' => 'node_data_field_center_local',
'field' => 'field_center_local_nid',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'field_name_value' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 1,
'id' => 'field_name_value',
'table' => 'node_data_field_name',
'field' => 'field_name_value',
'relationship' => 'none',
),
'field_last_name_value' => array(
'label' => 'Trainer',
'alter' => array(
'alter_text' => 1,
'text' => '[field_name_value] [field_last_name_value] ',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'label_type' => 'custom',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_last_name_value',
'table' => 'node_data_field_last_name',
'field' => 'field_last_name_value',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'created' => array(
'label' => 'Post date',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'date_format' => 'custom',
'custom_date_format' => 'm-d-y',
'exclude' => 0,
'id' => 'created',
'table' => 'node',
'field' => 'created',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'field_org_ref_select_nid' => array(
'default_action' => 'default',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'php',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
'break_phrase' => 0,
'not' => 0,
'id' => 'field_org_ref_select_nid',
'table' => 'node_data_field_org_ref_select',
'field' => 'field_org_ref_select_nid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
'4' => 0,
'6' => 0,
'5' => 0,
'3' => 0,
),
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_fixed' => '',
'default_argument_user' => 0,
'default_argument_php' => '$userid = arg(1);
$content_profile = content_profile_load(\'profile\', $userid);
$content_profile_nid = $content_profile->nid;
$node_ref = node_load($content_profile_nid);
$refnid = $node_ref->field_org_ref_select[0][\'nid\'];
return $refnid;',
'validate_argument_node_type' => array(
'profile' => 'profile',
'center_location' => 0,
'organization' => 0,
'page' => 0,
'story' => 0,
'type' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'1' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_php' => '',
),
'nid' => array(
'default_action' => 'default',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'php',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'ignore',
'break_phrase' => 0,
'not' => 1,
'id' => 'nid',
'table' => 'node',
'field' => 'nid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
'4' => 0,
'6' => 0,
'5' => 0,
'3' => 0,
),
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_fixed' => '',
'default_argument_user' => 0,
'default_argument_php' => '$userid = arg(1);
$content_profile = content_profile_load(\'profile\', $userid);
$content_profile_nid = $content_profile->nid;
if($content_profile_nid) {
return $content_profile_nid;
}
return false;',
'validate_argument_node_type' => array(
'center_location' => 0,
'organization' => 0,
'p开发者_高级运维age' => 0,
'profile' => 0,
'story' => 0,
'type' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'1' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_php' => '',
),
));
$handler->override_option('access', array(
'type' => 'role',
'role' => array(
'3' => 3,
),
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('header', '<h1>Your Training Schedules</h1>');
$handler->override_option('header_format', '2');
$handler->override_option('header_empty', 0);
$handler->override_option('use_ajax', TRUE);
$handler->override_option('items_per_page', 25);
$handler->override_option('use_pager', 'mini');
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
'grouping' => '',
'override' => 1,
'sticky' => 0,
'order' => 'asc',
'columns' => array(
'field_type_nid' => 'field_type_nid',
'field_center_local_nid' => 'field_center_local_nid',
'field_name_value' => 'field_name_value',
'field_last_name_value' => 'field_last_name_value',
'created' => 'created',
),
'info' => array(
'field_type_nid' => array(
'separator' => '',
),
'field_center_local_nid' => array(
'separator' => '',
),
'field_name_value' => array(
'sortable' => 1,
'separator' => '',
),
'field_last_name_value' => array(
'sortable' => 1,
'separator' => '',
),
'created' => array(
'sortable' => 1,
'separator' => '',
),
),
'default' => '-1',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'schedules_author');
$handler->override_option('menu', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
Let me know if anyhthing isn't clear. I really appreciate the help.
You're using a view that should take an argument, which then uses that argument to filter. The node reference bit should be irrelevant. The view will need to have a relationship between the content types. Maybe this example will illuminate.
In my domain, I have Professors. Professors publish Publications and have Research Interests. When viewing a Professor's Profile (using Content Profile), I want to have views that pull up all of their associated Publications and Research Interests.
For example: Faculty profile Here is what the Publications view looks like:
$view = new view;
$view->name = 'publications';
$view->description = 'a view for publications';
$view->tag = '';
$view->base_table = 'node';
$view->human_name = '';
$view->core = 0;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Defaults */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->display->display_options['use_ajax'] = TRUE;
$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['style_plugin'] = 'list';
$handler->display->display_options['row_plugin'] = 'fields';
$handler->display->display_options['row_options']['inline'] = array(
'field_authors_value' => 'field_authors_value',
'field_year_value' => 'field_year_value',
'title' => 'title',
'field_journal_value' => 'field_journal_value',
'field_volume_value' => 'field_volume_value',
'field_pages_value' => 'field_pages_value',
);
$handler->display->display_options['row_options']['separator'] = '.';
$handler->display->display_options['row_options']['hide_empty'] = 0;
/* Relationship: Content: Owner (field_owner) */
$handler->display->display_options['relationships']['field_owner_uid']['id'] = 'field_owner_uid';
$handler->display->display_options['relationships']['field_owner_uid']['table'] = 'node_data_field_owner';
$handler->display->display_options['relationships']['field_owner_uid']['field'] = 'field_owner_uid';
$handler->display->display_options['relationships']['field_owner_uid']['required'] = 0;
$handler->display->display_options['relationships']['field_owner_uid']['delta'] = '-1';
/* Relationship: Node: Content Profile */
$handler->display->display_options['relationships']['content_profile_rel']['id'] = 'content_profile_rel';
$handler->display->display_options['relationships']['content_profile_rel']['table'] = 'users';
$handler->display->display_options['relationships']['content_profile_rel']['field'] = 'content_profile_rel';
$handler->display->display_options['relationships']['content_profile_rel']['relationship'] = 'field_owner_uid';
$handler->display->display_options['relationships']['content_profile_rel']['required'] = 0;
$handler->display->display_options['relationships']['content_profile_rel']['type'] = 'profile';
/* Field: Content: Authors (field_authors) */
$handler->display->display_options['fields']['field_authors_value']['id'] = 'field_authors_value';
$handler->display->display_options['fields']['field_authors_value']['table'] = 'node_data_field_authors';
$handler->display->display_options['fields']['field_authors_value']['field'] = 'field_authors_value';
$handler->display->display_options['fields']['field_authors_value']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_authors_value']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_authors_value']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_authors_value']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_authors_value']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_authors_value']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_authors_value']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_authors_value']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_authors_value']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_authors_value']['link_to_node'] = 0;
$handler->display->display_options['fields']['field_authors_value']['label_type'] = 'none';
/* Field: Content: Year (field_year) */
$handler->display->display_options['fields']['field_year_value']['id'] = 'field_year_value';
$handler->display->display_options['fields']['field_year_value']['table'] = 'node_data_field_year';
$handler->display->display_options['fields']['field_year_value']['field'] = 'field_year_value';
$handler->display->display_options['fields']['field_year_value']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_year_value']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_year_value']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_year_value']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_year_value']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_year_value']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_year_value']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_year_value']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_year_value']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_year_value']['link_to_node'] = 0;
$handler->display->display_options['fields']['field_year_value']['label_type'] = 'none';
/* Field: Node: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title']['alter']['html'] = 0;
$handler->display->display_options['fields']['title']['hide_empty'] = 0;
$handler->display->display_options['fields']['title']['empty_zero'] = 0;
$handler->display->display_options['fields']['title']['link_to_node'] = 1;
/* Field: Content: Journal (field_journal) */
$handler->display->display_options['fields']['field_journal_value']['id'] = 'field_journal_value';
$handler->display->display_options['fields']['field_journal_value']['table'] = 'node_data_field_journal';
$handler->display->display_options['fields']['field_journal_value']['field'] = 'field_journal_value';
$handler->display->display_options['fields']['field_journal_value']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_journal_value']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_journal_value']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_journal_value']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_journal_value']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_journal_value']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_journal_value']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_journal_value']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_journal_value']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_journal_value']['link_to_node'] = 0;
$handler->display->display_options['fields']['field_journal_value']['label_type'] = 'none';
/* Field: Content: Volume (field_volume) */
$handler->display->display_options['fields']['field_volume_value']['id'] = 'field_volume_value';
$handler->display->display_options['fields']['field_volume_value']['table'] = 'node_data_field_volume';
$handler->display->display_options['fields']['field_volume_value']['field'] = 'field_volume_value';
$handler->display->display_options['fields']['field_volume_value']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_volume_value']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_volume_value']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_volume_value']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_volume_value']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_volume_value']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_volume_value']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_volume_value']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_volume_value']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_volume_value']['link_to_node'] = 0;
$handler->display->display_options['fields']['field_volume_value']['label_type'] = 'none';
/* Field: Content: Page(s) (field_pages) */
$handler->display->display_options['fields']['field_pages_value']['id'] = 'field_pages_value';
$handler->display->display_options['fields']['field_pages_value']['table'] = 'node_data_field_pages';
$handler->display->display_options['fields']['field_pages_value']['field'] = 'field_pages_value';
$handler->display->display_options['fields']['field_pages_value']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_pages_value']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_pages_value']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_pages_value']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_pages_value']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_pages_value']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_pages_value']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_pages_value']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_pages_value']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_pages_value']['link_to_node'] = 0;
$handler->display->display_options['fields']['field_pages_value']['label_type'] = 'none';
/* Field: Content: Home Page (field_url) */
$handler->display->display_options['fields']['field_url_url']['id'] = 'field_url_url';
$handler->display->display_options['fields']['field_url_url']['table'] = 'node_data_field_url';
$handler->display->display_options['fields']['field_url_url']['field'] = 'field_url_url';
$handler->display->display_options['fields']['field_url_url']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_url_url']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_url_url']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_url_url']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_url_url']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_url_url']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_url_url']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_url_url']['hide_empty'] = 1;
$handler->display->display_options['fields']['field_url_url']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_url_url']['link_to_node'] = 0;
$handler->display->display_options['fields']['field_url_url']['label_type'] = 'none';
$handler->display->display_options['fields']['field_url_url']['format'] = 'url';
/* Field: Content: File (field_publication_file) */
$handler->display->display_options['fields']['field_publication_file_fid']['id'] = 'field_publication_file_fid';
$handler->display->display_options['fields']['field_publication_file_fid']['table'] = 'node_data_field_publication_file';
$handler->display->display_options['fields']['field_publication_file_fid']['field'] = 'field_publication_file_fid';
$handler->display->display_options['fields']['field_publication_file_fid']['label'] = 'File';
$handler->display->display_options['fields']['field_publication_file_fid']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_publication_file_fid']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_publication_file_fid']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_publication_file_fid']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_publication_file_fid']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_publication_file_fid']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_publication_file_fid']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_publication_file_fid']['hide_empty'] = 1;
$handler->display->display_options['fields']['field_publication_file_fid']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_publication_file_fid']['link_to_node'] = 0;
$handler->display->display_options['fields']['field_publication_file_fid']['multiple']['group'] = 1;
$handler->display->display_options['fields']['field_publication_file_fid']['multiple']['multiple_reversed'] = 0;
/* Field: Node: Title */
$handler->display->display_options['fields']['title_1']['id'] = 'title_1';
$handler->display->display_options['fields']['title_1']['table'] = 'node';
$handler->display->display_options['fields']['title_1']['field'] = 'title';
$handler->display->display_options['fields']['title_1']['relationship'] = 'content_profile_rel';
$handler->display->display_options['fields']['title_1']['label'] = 'Owner';
$handler->display->display_options['fields']['title_1']['exclude'] = TRUE;
$handler->display->display_options['fields']['title_1']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title_1']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['title_1']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['title_1']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['title_1']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title_1']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title_1']['alter']['html'] = 0;
$handler->display->display_options['fields']['title_1']['hide_empty'] = 0;
$handler->display->display_options['fields']['title_1']['empty_zero'] = 0;
$handler->display->display_options['fields']['title_1']['link_to_node'] = 1;
/* Sort criterion: Content: Year (field_year) */
$handler->display->display_options['sorts']['field_year_value']['id'] = 'field_year_value';
$handler->display->display_options['sorts']['field_year_value']['table'] = 'node_data_field_year';
$handler->display->display_options['sorts']['field_year_value']['field'] = 'field_year_value';
$handler->display->display_options['sorts']['field_year_value']['order'] = 'DESC';
/* Argument: Content: Owner (field_owner) */
$handler->display->display_options['arguments']['field_owner_uid']['id'] = 'field_owner_uid';
$handler->display->display_options['arguments']['field_owner_uid']['table'] = 'node_data_field_owner';
$handler->display->display_options['arguments']['field_owner_uid']['field'] = 'field_owner_uid';
$handler->display->display_options['arguments']['field_owner_uid']['style_plugin'] = 'default_summary';
$handler->display->display_options['arguments']['field_owner_uid']['default_argument_type'] = 'fixed';
/* Filter: Node: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'publication' => 'publication',
);
$handler->display->display_options['filters']['type']['expose']['operator'] = FALSE;
This is much simpler in other paradigms, and there's a lot of noise in this code (part and parcel of working with Drupal), but I hope you get a general sense.
精彩评论