TransWikia.com

Breadcrumb/block settings

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

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

3 Answers

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:

  • Use Crumbs to generate the breadcrumbs.
  • Use Menupoly instead of Menu block, to have your submenus expand for items that are in the breadcrumb trail, even if the current page itself is not in any menu.

Configure Crumbs (7.x-2.*):

  • Visit the configuration at Admin > Structure > Crumbs > Plugin weights,
    Make sure the menu plugin for this specific menu is enabled (or some parent plugin wildcard key). If necessary, give this specific menu a higher priority than other menus.
  • Go to Admin > Structure > Crumbs > Entity parent > User,
    Set about/faculty-staff/directory as the parent path for users with "staff" role.
  • Alternative: Use the "Path alias" plugin, where the parent path is based on the url alias.

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:

  • Create a custom module
  • Implement hook_menupoly(). See the example module for inspiration.
  • Go to Admin > Structure > Blocks, and move the newly created menupoly block to the sidebar.

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:

  • Check how the menu block is configured.
  • Check if there is another menu item in another menu that links to this page. It could be that Drupal picks this up and thinks we are in another menu.

(There is a more general solution that I am going to post in another answer)

Answered by donquixote on December 17, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP