0

Let's say we have a menu inside the primary links, in my case the Misc menu.

menu_tree_primary_links

As it seems under Misc menu it can be any Content Type (of course and on every other menu)

The question is how can I make it to appear ONLY the Misc menu somewhere in my website without reconstructing it as a separate menu?

I want it to stay in the primary links.

So far I've tried it with the context module, but seems that is not working properly with the sub menus under the Misc menu. It works only for the Misc page.

Even if I do this: menu_set_active_menu_name ('primary-links') it's still working only for the Misc menu, not its childrens.

Creating a block with only the needed menu item and the use of the template_preprocess_block is another approach but not recommended, while I have to refer to the block through the block ID ($bid).

0

Menu block - it provides configurable blocks of menu trees starting with any level of any menu.
So if you’re only using your theme’s Main menu links feature, you can add and configure a “Main menu (levels 2+)” block. That block would appear once you were on one of the Main menu’s pages and would show the menu tree for the 2nd level (and deeper) of your Main menu and would expand as you traversed down the tree. You can also limit the depth of the menu’s tree (e.g. “Main menu (levels 2-3)”) and/or expand all the child sub-menus (e.g. “Main menu (expanded levels 2+)”).

  • Thank you so much for your quick response, this is worked perfect! --------- But , what if I wanted to add a body_class to all of the links under the Misc menu (to all its childs, without clicking one by one, but to be them considered that they are in active trail or something like that) , I mean when I editing my context Conditions and choose Misc menu I want for every child to inherit this body_class. Of course in my context Reactions I appear my Misc menu block with the defined body_class. – mchar Jun 26 '14 at 8:45
  • You should add to your template.php template_page_preprocess function, and add there body classes dependly what shown at current moment. – Nikit Jun 26 '14 at 8:50
  • You are so right, but what about the block, template_preprocess_block() maybe? I mean, I want it appearing under those pages also – mchar Jun 26 '14 at 8:58
  • I am not sure what you mean... – Nikit Jun 26 '14 at 9:19
  • bad wording. When I click on a link under the Misc menu I want only the Misc block from the primary-links to appear. I can't define this throw the block visibility settings because the url does not follow any standard pattern e.g node/% it can be anything e.g. page/%, news/% etc – mchar Jun 26 '14 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.