Drupal Answers Asked by Zach on December 17, 2020
Should Views (that are setup as a Page) be able to inherit breadcrumbs/block visibility settings? When I create a Views page, set a path, add it to the menu (then adjust it to be a sub-menu of another parent item), when I am on the actual Views page, it looses (in this case) any block settings that should be shown on this page. From the screen shot below, you can see the menu block disappear (as well as the LEAD logo on the lower left side). More odd than that, is whenever I set the View to be added to a menu (as I have done in the Views settings), it doesn’t show up (which is why I had to add it to the menu manually). I’ve gotten it to work with another Views page (the menu link showing up), but the blocks still disappear.
Also, once you click on an individual node, they also loose any type of breadcrumb/block visibility (even though I’ve set the URL to be the correct breadcrumb /about/faculty-staff/directory/USER_ID). Any help would be greatly appreciated. Thanks!
Current setup:
Drupal 7.5
Views: 3.0-rc1
Menu Block: 2.2
Screenshot Explanation:
Directory page (Views page – blocks missing from this page)
Main Faculty & Staff page (parent page)
User Profile view
Views config
Menu list
Menu config
The reason behind disappearing of block
is still not able to find region
in pages just like page.tpl.php
.
Suggestions:
1) Create a custom template for views
page using theme_preprocess_page
in template.php
.You have to create template
using theme_hook_suggestions
under the condition of views
page url
.
2)Assign or create region
in new views
page template.
3)Assign your menu block
in above region
.
Note: You don't need to edit or create any views
template like views.tpl.php
.It should be custom just like page.tpl.php
.
Also block
visibility settings should be available to views
page url
Answered by Hiranya Sarma on December 17, 2020
A generally useful way to fix all of this:
Configure Crumbs (7.x-2.*):
Note.
You could also use Easy Breadcrumbs or Breadcrumbs by path to get breadcrumbs based on url alias. This would be equivalent with only having the "url alias" plugin enabled in Crumbs. But it does not do anything else, and it does not support Menupoly.
Define the menu with Menupoly:
E.g.:
/**
* Implements hook_menupoly()
*/
function MYMODULE_menupoly() {
return array(
'sidebar_menu' => array(
'menu_name' => 'main-menu',
'expand' => MENUPOLY_EXPAND_ACTIVE,
),
);
}
Good luck!
Answered by donquixote on December 17, 2020
To your first problem, the menu disappearing on about/faculty-staff/directory:
(There is a more general solution that I am going to post in another answer)
Answered by donquixote on December 17, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP