I know how to configure a menu block to show the secondary (level 2+) menu items of the active menu tree, but I would like to add navigation menus to my footer, that display only one, specific tree of the navigation menu all the time, instead of displaying a dynamic secondary menu. For example:

  • Primary 1
    • Secondary 1.1
    • Secondary 1.2
  • Primary 2
    • Secondary 2.1
    • Secondary 2.2
    • Secondary 2.3
  • Primary 3
    • Secondary 3.1

I want a block in my footer to display only Primary 2 and children on every page in my site. After reading the module description, it seems to me like this functionality is described in the section of related modules, next to "Menu block split", but I can't see a way of configuring a block to display only one secondary level tree instead of whichever one is active.

It seems like next to the "Starting level" option in the menu block configuration I would need to be able to select a specific part of the menu tree to start instead of just the menu.

Comments

Letharion’s picture

Status: Active » Fixed

You can set a fixed starting point in the advanced settings. Just remeber that the depth settings will be relative to your fixed start, not the entire menu.

owntheweb’s picture

Hello,
On this note, I was successfully able to get a fixed menu to show in a section of my website on 'media' nodes that were not assigned to a menu. Thanks for your answer that helped me on a non-related project. :)

more details of how I did it here

screenshot

Challenge: If I did assign the media nodes to a menu, my menu edit page would become unmanageable because there are 1,000's of these nodes (imagine dragging a new Contact page past 1,000 'news brief' nodes!).

While I was able to get a relevant menu block to show with my news briefs, is there a way I can specify a menu link to be active, or pass in an argument somewhere to make this happen? I feel this would be useful for something similar to inquiry above as well, showing the active section on a sitemap.

Let me know if I should post this as a separate issue.

Best regards,

Chris

EDIT:
I'm starting my experiments with the [mytheme]_menu_item_link($link) function to be placed in my theme's template.php. I'll post if I get something working.

EDIT:
Here's what worked for me (may not work for others). It requires that the URL aliases be consistent with menu structure, and that nodes are associated with a node in the menu (e.g. a news brief would be located under media/news-briefs/news-brief-titles

template.php:

function [my_theme]_menu_item_link($link) {
	if(arg(0) == 'node' && is_numeric(arg(1))) {
		$section = explode("/",drupal_get_path_alias('node/' . arg(1)));
		$section = $section[count($section) - 2];
		
		$linkAlias = explode("/",drupal_get_path_alias($link['href']));
		$linkAlias = $linkAlias[count($linkAlias) - 1];
		
		if($linkAlias == $section) {
			$link['localized_options']['attributes']['class'] .= ' active';
		}
	}
	
	return l($link['title'],$link['href'],$link['localized_options']);
}

Something more specific in block settings wouldn't hurt for active links. Just a thought. :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.