Node reference és a Views

vajdasági képe

Meg mindig kezdő vagyok a Drupalban, es a Views meg szokatlan nekem.

Létrehoztam egy új tartalomtípust aminek van egy Node reference mezője. Egyszerűség kedvéért kepzeljuk el hogy a tartalomtípus a termékek és ez a referenciamező masik ugyanilyen tartalomtipusu termékekre mutat. Az adatok bevitele és a termek megtekintése mukodik is rendesen ezzel nincs semmi gondom.

Azt szeretnem megoldani (ehhez kellett végulis az a Node reference mező) hogy amikor az egyik termeket nézem, akkor a termék alatt egy Views blokkban listázza ki azokat a termékeket amikre a termekben levő mező mutat...

Megcsináltam a Views-t is megvan a termek alatt a block is csak a Contextual filters vagy a Relationships részeket nem tudom hogyan allitsam be a Views Advanced részében. Mar ha egyáltalán jó irányba tapogatózok. Ebben kérnék egy kis útbaigazítást.

Melyik modulhoz, modulokhoz kapcsolódik a téma?: 
Drupal verzió: 
szt képe

szt képe

Upsz, Éva kell neked, most látom, mert D7-ben más modul kell :)
http://drupal.org/project/eva

0
0
vajdasági képe

Koszonom a hozzaszolast, a kerdesmre a viewset vegulis megoldottam csak meg nem volt idom teljessen letesztelni hogy tobbnyelvu kornyezetben hogy is mukodik-e, de a gyors tesztek alapjan mintha jo lenne. Esetleg majd a Views forditasanal lesznek meg gondok vele.

Amint veglegesen is keszen lessz es jol mukodik, kiteszem ide hogy mi is es hogyan lett a megoldas.

Utoirat:

Megneztem a http://drupal.org/project/eva , hirtelen ez is jonak tunik, ha jol ertetem ez a tartalomban azt a mezo kinezetet szerkeszti at es oda szurja be a Views "kimenetet". Lattam mar amikor keresgeltem hasonlo modult vagy lehet hogy eppen ez is volt az. En ugy oldottam meg hogy a Views-el letrehoztam egy uj blokkot es azt tettem be a tartalom ala. A tartalomban azt az egy mezot meg egyszeruen csak nem jelenitem meg.

0
0
Atamas21 képe

Akkor megköszönném ha leírnád a megoldást mivel ugyanezzel a problémával küzdök és ezért nem tenném fel ugyanezt a kérdést még egyszer.

0
0
vajdasági képe

A tartalomtipusba egy Node reference mezo tettem ez a mezo tartalmazza majd azoka nodok azonositoit amikre mutat.

A view meg itt van kiexportalva:

$view = new view;
$view->name = 'we_recommend';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'We recommend';
$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'] = 'We recommend';
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['query']['options']['query_comment'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'table';
/* Relationship: Content: Recommendations (field_recommendations) - reverse */
$handler->display->display_options['relationships']['reverse_field_recommendations_node']['id'] = 'reverse_field_recommendations_node';
$handler->display->display_options['relationships']['reverse_field_recommendations_node']['table'] = 'node';
$handler->display->display_options['relationships']['reverse_field_recommendations_node']['field'] = 'reverse_field_recommendations_node';
$handler->display->display_options['relationships']['reverse_field_recommendations_node']['required'] = 0;
/* Field: Content: Image */
$handler->display->display_options['fields']['field_image']['id'] = 'field_image';
$handler->display->display_options['fields']['field_image']['table'] = 'field_data_field_image';
$handler->display->display_options['fields']['field_image']['field'] = 'field_image';
$handler->display->display_options['fields']['field_image']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_image']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_image']['alter']['more_link'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_image']['element_label_colon'] = 1;
$handler->display->display_options['fields']['field_image']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_image']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_image']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_image']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['field_image']['click_sort_column'] = 'fid';
$handler->display->display_options['fields']['field_image']['settings'] = array(
  'image_style' => 'thumbnail',
  'image_link' => 'content',
);
$handler->display->display_options['fields']['field_image']['field_api_classes'] = 0;
/* Field: Content: Title */
$handler->display->display_options['fields']['title_field']['id'] = 'title_field';
$handler->display->display_options['fields']['title_field']['table'] = 'field_data_title_field';
$handler->display->display_options['fields']['title_field']['field'] = 'title_field';
$handler->display->display_options['fields']['title_field']['label'] = '';
$handler->display->display_options['fields']['title_field']['exclude'] = TRUE;
$handler->display->display_options['fields']['title_field']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title_field']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['title_field']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['title_field']['alter']['external'] = 0;
$handler->display->display_options['fields']['title_field']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['title_field']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['title_field']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['title_field']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['title_field']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['title_field']['alter']['more_link'] = 0;
$handler->display->display_options['fields']['title_field']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title_field']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title_field']['alter']['html'] = 0;
$handler->display->display_options['fields']['title_field']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['title_field']['element_default_classes'] = 1;
$handler->display->display_options['fields']['title_field']['hide_empty'] = 0;
$handler->display->display_options['fields']['title_field']['empty_zero'] = 0;
$handler->display->display_options['fields']['title_field']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['title_field']['field_api_classes'] = 0;
/* Field: Content: Path */
$handler->display->display_options['fields']['path']['id'] = 'path';
$handler->display->display_options['fields']['path']['table'] = 'node';
$handler->display->display_options['fields']['path']['field'] = 'path';
$handler->display->display_options['fields']['path']['label'] = 'Title';
$handler->display->display_options['fields']['path']['alter']['alter_text'] = 1;
$handler->display->display_options['fields']['path']['alter']['text'] = '[title_field]';
$handler->display->display_options['fields']['path']['alter']['make_link'] = 1;
$handler->display->display_options['fields']['path']['alter']['path'] = '[path]';
$handler->display->display_options['fields']['path']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['path']['alter']['external'] = 0;
$handler->display->display_options['fields']['path']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['path']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['path']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['path']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['path']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['path']['alter']['more_link'] = 0;
$handler->display->display_options['fields']['path']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['path']['alter']['trim'] = 0;
$handler->display->display_options['fields']['path']['alter']['html'] = 0;
$handler->display->display_options['fields']['path']['element_label_colon'] = 1;
$handler->display->display_options['fields']['path']['element_default_classes'] = 1;
$handler->display->display_options['fields']['path']['hide_empty'] = 0;
$handler->display->display_options['fields']['path']['empty_zero'] = 0;
$handler->display->display_options['fields']['path']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['path']['absolute'] = 1;
/* Field: Content: Article */
$handler->display->display_options['fields']['field_article']['id'] = 'field_article';
$handler->display->display_options['fields']['field_article']['table'] = 'field_data_field_article';
$handler->display->display_options['fields']['field_article']['field'] = 'field_article';
$handler->display->display_options['fields']['field_article']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_article']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_article']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_article']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_article']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_article']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_article']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_article']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_article']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_article']['alter']['more_link'] = 0;
$handler->display->display_options['fields']['field_article']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_article']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_article']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_article']['element_label_colon'] = 1;
$handler->display->display_options['fields']['field_article']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_article']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_article']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_article']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['field_article']['field_api_classes'] = 0;
/* Field: Content: Body */
$handler->display->display_options['fields']['body']['id'] = 'body';
$handler->display->display_options['fields']['body']['table'] = 'field_data_body';
$handler->display->display_options['fields']['body']['field'] = 'body';
$handler->display->display_options['fields']['body']['label'] = 'Summary';
$handler->display->display_options['fields']['body']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['body']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['body']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['body']['alter']['external'] = 0;
$handler->display->display_options['fields']['body']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['body']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['body']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['body']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['body']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['body']['alter']['more_link'] = 0;
$handler->display->display_options['fields']['body']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['body']['alter']['trim'] = 0;
$handler->display->display_options['fields']['body']['alter']['html'] = 0;
$handler->display->display_options['fields']['body']['element_label_colon'] = 1;
$handler->display->display_options['fields']['body']['element_default_classes'] = 1;
$handler->display->display_options['fields']['body']['hide_empty'] = 0;
$handler->display->display_options['fields']['body']['empty_zero'] = 0;
$handler->display->display_options['fields']['body']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['body']['type'] = 'text_summary_or_trimmed';
$handler->display->display_options['fields']['body']['settings'] = array(
  'trim_length' => '600',
);
$handler->display->display_options['fields']['body']['field_api_classes'] = 0;
/* Sort criterion: Content: Sticky */
$handler->display->display_options['sorts']['sticky']['id'] = 'sticky';
$handler->display->display_options['sorts']['sticky']['table'] = 'node';
$handler->display->display_options['sorts']['sticky']['field'] = 'sticky';
$handler->display->display_options['sorts']['sticky']['order'] = 'DESC';
/* Sort criterion: Content: Article (field_article) */
$handler->display->display_options['sorts']['field_article_value']['id'] = 'field_article_value';
$handler->display->display_options['sorts']['field_article_value']['table'] = 'field_data_field_article';
$handler->display->display_options['sorts']['field_article_value']['field'] = 'field_article_value';
/* Contextual filter: Content: Nid */
$handler->display->display_options['arguments']['nid']['id'] = 'nid';
$handler->display->display_options['arguments']['nid']['table'] = 'node';
$handler->display->display_options['arguments']['nid']['field'] = 'nid';
$handler->display->display_options['arguments']['nid']['relationship'] = 'reverse_field_recommendations_node';
$handler->display->display_options['arguments']['nid']['default_action'] = 'default';
$handler->display->display_options['arguments']['nid']['default_argument_type'] = 'node';
$handler->display->display_options['arguments']['nid']['default_argument_skip_url'] = 0;
$handler->display->display_options['arguments']['nid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['nid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['nid']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['nid']['break_phrase'] = 0;
$handler->display->display_options['arguments']['nid']['not'] = 0;
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: 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(
  'product' => 'product',
);
 
/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block');
$translatables['we_recommend'] = array(
  t('Master'),
  t('We recommend'),
  t('more'),
  t('Apply'),
  t('Reset'),
  t('Sort by'),
  t('Asc'),
  t('Desc'),
  t('field_recommendations'),
  t('Image'),
  t('Title'),
  t('[title_field]'),
  t('[path]'),
  t('Article'),
  t('Summary'),
  t('All'),
  t('Block'),
);

Ha igy nem vilagos szolj es megprobalom szovegesen elmagyarazni hogy csinaltam.

0
0