Я создаю 6-страничное представление drupal, в котором должен отображаться список узлов в зависимости от значения, выбранного в профиле контента пользователя.
Извините, если я не объясню все ясно, мой мозгпосле долгого дня: |
Сводка: пользователь выбирает значение из поля ссылки на узел в своем профиле контента
Создать страницу просмотра, которая отображает все узлы в таблице, отфильтрованные по определенному значениюв профиле.
Пользователь не может видеть узлы из других значений в ссылке на узел.только их выбранное значение
Пользователь1 - выбрал продвинутый Пользователь2 - выбрал промежуточный Пользователь3 - выбрал * продвинутый пользователь4 - выбрал промежуточный пользователь5- выбрал новичок
Пользователь1, Пользователь3 может видеть узлы друг друга в таблице, то же самое относится и к Пользователю2 и Пользователю4.Пользователь 5 видит только один отправленный узел
Вот страница, на которую я ссылался за помощью: Здесь Но я не использую модуль панелей (который не должен иметь значения)
мой взгляд:
$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,
'page' => 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',
));
Дайте мне знать, если что-то не понятно.Я действительно ценю помощь.