Use Default menu for content as the source Menu

bwicksall - July 29, 2009 - 16:26
Project:Menu Breadcrumb
Version:6.x-1.1
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

I have a multi site install with the Domain Access module. Each site has it's own menu and in most cases Menu Breadcrumb works as expected.

The problem comes when I have multiple links pointing to the same page. Site A and Site B both have menu's that point to the same about page. This causes problems with the query that finds the current menu.

   $menu_link = menu_link_load(db_result(db_query("SELECT mlid FROM {menu_links} WHERE link_path = '%s'", $menu_item['href'])));

The above query returns multiple results (3 or more) in my environment and it's the luck of the draw if I get the correct one.

The attached patch file is my solution. I only have one menu per site and Domain Access handles the variables so I can set "Default menu for content: " for each site and the patch uses that value to determine the current menu.

There may be other situations where this is useful so I thought I would submit a patch.

AttachmentSize
menu_breadcrumb.module.patch2.57 KB

#1

bwicksall - July 31, 2009 - 19:24

A glitch popped up in the above attached code so I'm attaching an improved version. The new version excludes the admin menu and fixes a glitch where titles were being set on pages that shouldn't have titles.

AttachmentSize
menu_breadcrumb.module.patch 2.98 KB

#2

dboulet - October 5, 2009 - 21:25
Status:active» duplicate

Seems to be a duplicate of #364363: Select default custom menu.

 
 

Drupal is a registered trademark of Dries Buytaert.