Felhasználóhoz tartozó cikkek csak adminként jelennek meg jól

tiburi képe

Sziasztok!

Az oldalamon az adott cikk írójának tartalma mellett egy blokk van, ahol az utolsó 5 cikke is listázódik (ha van).

Egy sima view-el oldottam meg (Contextual filter: User: Uid --> User ID from URL. Relationship: Content: Author)

Ez a lista azonban csak akkor jelenik meg jól, ha be vagyok adminként lépve az oldalba. Ha nem, akkor minden esetben egyetlen egy user utolsó 5 tartalma jelenik meg minden cikkírónál.

Összefoglalva adott egy view, ami Adminban jó, anonimban nem jó. Nekem permission hibának tűnik, de melyik modulhoz kapcsolódóan? Ez a blokk csak view-ből fut, ott meg minden rendesen be van állítva.

Ez egy általam írt cikk, rögtön mellette pedig a rossz (LEGÚJABB A SZERZŐTŐL) blokk http://tw.gs/35ueiV

Van ötletetek?
Hálás köszönet!

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

Ha látnánk a view-t akkor lehetne segíteni, de így nehéz, de talán sikerül.

A Contextual filtered biztos hülyeség, mert Te nem a felhasználót nézed, így az id-je biztos nem jöhet az url-ből.

Kell két reláció. Az első neve legyen "Szerző" ez a cikk szerzőjét tartalmaző felhasználót kapcsolja a tartalomhoz. Ezután kell egy "A szerző műve" nevű reláció, aminél használod a korábban létrehozott "Szerző" relációt.

Ezután kell két contextual filter, mindkettő a "Content nid from url" lesz, de az egyik használja a "A szerző művei" relációt és excludol, ezzel kizárjuk a listából az éppen nézett művet.

Végezetül a fieldeknél, a title mezőnél is használjuk az előbbi relációt.

Tesztelni úgy tudod, hogy a tartalom nid-jét kétszer beírod perjellel pl.: 3/3
(btw a tanarurkerem.hu-n a views kurzus többek között ezt is tartalmazza. :))

És emitt a view:

  1. $view = new view();
  2. $view->name = 'legujabb_a_szerzotol';
  3. $view->description = '';
  4. $view->tag = 'default';
  5. $view->base_table = 'node';
  6. $view->human_name = 'Legújabb a szerzőtől';
  7. $view->core = 7;
  8. $view->api_version = '3.0';
  9. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  10.  
  11. /* Display: Master */
  12. $handler = $view->new_display('default', 'Master', 'default');
  13. $handler->display->display_options['title'] = 'Legújabb a szerzőtől';
  14. $handler->display->display_options['use_more_always'] = FALSE;
  15. $handler->display->display_options['access']['type'] = 'perm';
  16. $handler->display->display_options['cache']['type'] = 'none';
  17. $handler->display->display_options['query']['type'] = 'views_query';
  18. $handler->display->display_options['exposed_form']['type'] = 'basic';
  19. $handler->display->display_options['pager']['type'] = 'some';
  20. $handler->display->display_options['pager']['options']['items_per_page'] = '5';
  21. $handler->display->display_options['style_plugin'] = 'default';
  22. $handler->display->display_options['row_plugin'] = 'fields';
  23. /* Relationship: Content: Author */
  24. $handler->display->display_options['relationships']['uid']['id'] = 'uid';
  25. $handler->display->display_options['relationships']['uid']['table'] = 'node';
  26. $handler->display->display_options['relationships']['uid']['field'] = 'uid';
  27. $handler->display->display_options['relationships']['uid']['label'] = 'Szerzo';
  28. $handler->display->display_options['relationships']['uid']['required'] = TRUE;
  29. /* Relationship: User: Content authored */
  30. $handler->display->display_options['relationships']['uid_1']['id'] = 'uid_1';
  31. $handler->display->display_options['relationships']['uid_1']['table'] = 'users';
  32. $handler->display->display_options['relationships']['uid_1']['field'] = 'uid';
  33. $handler->display->display_options['relationships']['uid_1']['relationship'] = 'uid';
  34. $handler->display->display_options['relationships']['uid_1']['label'] = 'A szerző művei';
  35. $handler->display->display_options['relationships']['uid_1']['required'] = TRUE;
  36. /* Field: Content: Title */
  37. $handler->display->display_options['fields']['title']['id'] = 'title';
  38. $handler->display->display_options['fields']['title']['table'] = 'node';
  39. $handler->display->display_options['fields']['title']['field'] = 'title';
  40. $handler->display->display_options['fields']['title']['relationship'] = 'uid_1';
  41. $handler->display->display_options['fields']['title']['label'] = '';
  42. $handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
  43. $handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
  44. $handler->display->display_options['fields']['title']['element_label_colon'] = FALSE;
  45. /* Sort criterion: Content: Post date */
  46. $handler->display->display_options['sorts']['created']['id'] = 'created';
  47. $handler->display->display_options['sorts']['created']['table'] = 'node';
  48. $handler->display->display_options['sorts']['created']['field'] = 'created';
  49. $handler->display->display_options['sorts']['created']['order'] = 'DESC';
  50. /* Contextual filter: Content: Nid */
  51. $handler->display->display_options['arguments']['nid']['id'] = 'nid';
  52. $handler->display->display_options['arguments']['nid']['table'] = 'node';
  53. $handler->display->display_options['arguments']['nid']['field'] = 'nid';
  54. $handler->display->display_options['arguments']['nid']['default_action'] = 'default';
  55. $handler->display->display_options['arguments']['nid']['default_argument_type'] = 'node';
  56. $handler->display->display_options['arguments']['nid']['summary']['number_of_records'] = '0';
  57. $handler->display->display_options['arguments']['nid']['summary']['format'] = 'default_summary';
  58. $handler->display->display_options['arguments']['nid']['summary_options']['items_per_page'] = '25';
  59. /* Contextual filter: Content: Nid */
  60. $handler->display->display_options['arguments']['nid_1']['id'] = 'nid_1';
  61. $handler->display->display_options['arguments']['nid_1']['table'] = 'node';
  62. $handler->display->display_options['arguments']['nid_1']['field'] = 'nid';
  63. $handler->display->display_options['arguments']['nid_1']['relationship'] = 'uid_1';
  64. $handler->display->display_options['arguments']['nid_1']['default_action'] = 'default';
  65. $handler->display->display_options['arguments']['nid_1']['default_argument_type'] = 'node';
  66. $handler->display->display_options['arguments']['nid_1']['summary']['number_of_records'] = '0';
  67. $handler->display->display_options['arguments']['nid_1']['summary']['format'] = 'default_summary';
  68. $handler->display->display_options['arguments']['nid_1']['summary_options']['items_per_page'] = '25';
  69. $handler->display->display_options['arguments']['nid_1']['not'] = TRUE;
  70. /* Filter criterion: Content: Published */
  71. $handler->display->display_options['filters']['status']['id'] = 'status';
  72. $handler->display->display_options['filters']['status']['table'] = 'node';
  73. $handler->display->display_options['filters']['status']['field'] = 'status';
  74. $handler->display->display_options['filters']['status']['value'] = 1;
  75. $handler->display->display_options['filters']['status']['group'] = 1;
  76. $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
  77.  
  78. /* Display: Block */
  79. $handler = $view->new_display('block', 'Block', 'block');
0
0
tiburi képe

Szia, az URL-ből a cikk szerzőjének id-je jön.
És ok is Adminból nézve, ha kilépek, akkor viszont nem.

  1. $view = new view();
  2. $view->name = 'authorpubl';
  3. $view->description = 'Footer information block with all contents with table-list wiev in the user page';
  4. $view->tag = 'default';
  5. $view->base_table = 'node';
  6. $view->human_name = 'AUTHOR Publications (LIST)';
  7. $view->core = 7;
  8. $view->api_version = '3.0';
  9. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  10.  
  11. /* Display: Master */
  12. $handler = $view->new_display('default', 'Master', 'default');
  13. $handler->display->display_options['title'] = 'My publications';
  14. $handler->display->display_options['use_more_always'] = FALSE;
  15. $handler->display->display_options['access']['type'] = 'perm';
  16. $handler->display->display_options['cache']['type'] = 'none';
  17. $handler->display->display_options['query']['type'] = 'views_query';
  18. $handler->display->display_options['exposed_form']['type'] = 'basic';
  19. $handler->display->display_options['pager']['type'] = 'infinite_scroll';
  20. $handler->display->display_options['pager']['options']['items_per_page'] = '0';
  21. $handler->display->display_options['pager']['options']['offset'] = '0';
  22. $handler->display->display_options['pager']['options']['id'] = '0';
  23. $handler->display->display_options['pager']['options']['quantity'] = '9';
  24. $handler->display->display_options['style_plugin'] = 'table';
  25. $handler->display->display_options['style_options']['columns'] = array(
  26. 'title' => 'title',
  27. 'field_cat' => 'field_cat',
  28. 'language' => 'language',
  29. 'created' => 'created',
  30. );
  31. $handler->display->display_options['style_options']['default'] = '-1';
  32. $handler->display->display_options['style_options']['info'] = array(
  33. 'title' => array(
  34. 'sortable' => 0,
  35. 'default_sort_order' => 'asc',
  36. 'align' => '',
  37. 'separator' => '',
  38. 'empty_column' => 0,
  39. ),
  40. 'field_cat' => array(
  41. 'align' => '',
  42. 'separator' => '',
  43. 'empty_column' => 0,
  44. ),
  45. 'language' => array(
  46. 'sortable' => 0,
  47. 'default_sort_order' => 'asc',
  48. 'align' => '',
  49. 'separator' => '',
  50. 'empty_column' => 0,
  51. ),
  52. 'created' => array(
  53. 'sortable' => 0,
  54. 'default_sort_order' => 'asc',
  55. 'align' => '',
  56. 'separator' => '',
  57. 'empty_column' => 0,
  58. ),
  59. );
  60. $handler->display->display_options['style_options']['sticky'] = TRUE;
  61. /* Relationship: Content: Author */
  62. $handler->display->display_options['relationships']['uid']['id'] = 'uid';
  63. $handler->display->display_options['relationships']['uid']['table'] = 'node';
  64. $handler->display->display_options['relationships']['uid']['field'] = 'uid';
  65. /* Field: Content: Cím */
  66. $handler->display->display_options['fields']['title']['id'] = 'title';
  67. $handler->display->display_options['fields']['title']['table'] = 'node';
  68. $handler->display->display_options['fields']['title']['field'] = 'title';
  69. $handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
  70. $handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
  71. /* Field: Field: Category */
  72. $handler->display->display_options['fields']['field_cat']['id'] = 'field_cat';
  73. $handler->display->display_options['fields']['field_cat']['table'] = 'field_data_field_cat';
  74. $handler->display->display_options['fields']['field_cat']['field'] = 'field_cat';
  75. $handler->display->display_options['fields']['field_cat']['delta_limit'] = '2';
  76. $handler->display->display_options['fields']['field_cat']['delta_offset'] = '0';
  77. /* Field: Content: Language */
  78. $handler->display->display_options['fields']['language']['id'] = 'language';
  79. $handler->display->display_options['fields']['language']['table'] = 'node';
  80. $handler->display->display_options['fields']['language']['field'] = 'language';
  81. /* Field: Content: Post date */
  82. $handler->display->display_options['fields']['created']['id'] = 'created';
  83. $handler->display->display_options['fields']['created']['table'] = 'node';
  84. $handler->display->display_options['fields']['created']['field'] = 'created';
  85. $handler->display->display_options['fields']['created']['date_format'] = 'short';
  86. /* Sort criterion: Content: Post date */
  87. $handler->display->display_options['sorts']['created']['id'] = 'created';
  88. $handler->display->display_options['sorts']['created']['table'] = 'node';
  89. $handler->display->display_options['sorts']['created']['field'] = 'created';
  90. $handler->display->display_options['sorts']['created']['order'] = 'DESC';
  91. /* Contextual filter: User: Uid */
  92. $handler->display->display_options['arguments']['uid']['id'] = 'uid';
  93. $handler->display->display_options['arguments']['uid']['table'] = 'users';
  94. $handler->display->display_options['arguments']['uid']['field'] = 'uid';
  95. $handler->display->display_options['arguments']['uid']['relationship'] = 'uid';
  96. $handler->display->display_options['arguments']['uid']['default_action'] = 'default';
  97. $handler->display->display_options['arguments']['uid']['default_argument_type'] = 'user';
  98. $handler->display->display_options['arguments']['uid']['default_argument_options']['user'] = FALSE;
  99. $handler->display->display_options['arguments']['uid']['summary']['number_of_records'] = '0';
  100. $handler->display->display_options['arguments']['uid']['summary']['format'] = 'default_summary';
  101. $handler->display->display_options['arguments']['uid']['summary_options']['items_per_page'] = '25';
  102. /* Filter criterion: Content: Published */
  103. $handler->display->display_options['filters']['status']['id'] = 'status';
  104. $handler->display->display_options['filters']['status']['table'] = 'node';
  105. $handler->display->display_options['filters']['status']['field'] = 'status';
  106. $handler->display->display_options['filters']['status']['value'] = 1;
  107. $handler->display->display_options['filters']['status']['group'] = 1;
  108. $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
  109. /* Filter criterion: Content: Típus */
  110. $handler->display->display_options['filters']['type']['id'] = 'type';
  111. $handler->display->display_options['filters']['type']['table'] = 'node';
  112. $handler->display->display_options['filters']['type']['field'] = 'type';
  113. $handler->display->display_options['filters']['type']['value'] = array(
  114. 'article' => 'article',
  115. 'blog' => 'blog',
  116. 'photo_stream' => 'photo_stream',
  117. );
  118.  
  119. /* Display: Block */
  120. $handler = $view->new_display('block', 'Block', 'block');

Megnézem a te verziódat is.
Köszönöm!

0
0