No reaction for Menu trail condition for Drupal Context module - drupal

I'm using Development Seed's fantastic Context module (version 6.x-2.0) for Drupal 6 on a site that I am developing. Everything is working fine except in the case where I need to set a context for a particular menu trail.
Perhaps I am misunderstanding the menu trail condition, but the context only exists when the defined menu item is active and not for any of its child menu items. Should it not be following the menu trail? The menu items only exist in the primary links, so there should be no conflict.
Is it possible to hook into the context to make the menu trail part work if not through the Context UI interface?

This is because Drupal, by default, sets the Navigation menu to the active menu: it affects all manner of things from Context to breadcrumbs.
You can test this by changing your condition to check a menu item in Navigation: it will fire on child menu items.
To get it to work on other menus, you need to enable or write a module that utilizes menu_set_active_menu_name to set the active menu to one where the page is a member. The module Menu Breadcrumb accomplishes this task with no configuration.

Related

Drupal 7 Menu Parent module alternative

I am currently using the Node Collection module to handle parent child relationships on my site. This module creates a menu in the form [parent , child-1, child-2 ... child-n] is there a way for me to attach this menu to an item in the main menu in drupal 7? And if so would this work with the Menu Firstchild modules?
The menu system in drupal 7 isn't very good.
Instead of forcing node collection on the main menu i suggest you don't use the main menu block.
Use a node collection block, if exist, or create your own custom block using hook_block_info & hook_block_view.

Do I need to reprogram the default WordPress navigation menu or is it intuitive as is?

The problem
The default navigation menu for WordPress consists of links to parent pages and a sub-menu that drops down for the respective child pages. It's been pointed out to me that it's not obvious that the primary (parent) links are selectable i.e. when the drop down child page links appear the user apparently might disregard the primary link to the corresponding parent page.
An example
Have a peek at the main navigation menu on this website:
http://www.directsponsor.org/forums/
My question
In my mind, the default WordPress navigation menu set-up is semantic, intuitive and best practice. To the non-technically inclined mind, is the menu intuitive enough? i.e. will all users observe the parent link or do I need to reprogram the menu?
Potential solutions
It's been suggested to me that I reiterate the parent links in the drop down menu. This seems like terribly bad practice and breaks the overall semantics of the menu. It's my opinion that the selectivity of the parent page links are already implied by the hover state.
Using CSS to more obviously imply the selectivity of the parent page links.
Reprogram the menu altogether.
Check 'Menu Manager' Plugin in WP which provides features of dynamic menu creation.

How can I hide pages from menus in WordPress?

I only want to show the pages that do not have parents, and link the other pages from their parent pages.
I want to have a simple main menu: Home | Pages | About | Contact
About 8 pages are linked from the Pages page. At the moment, the menu has 12 items, which deforms the layout pretty badly.
I have tried making the pages private, unpublished, and other options, but that doesn't seem to be the way to do it. Is there a way I can just have only parent pages linked in the main menu?
You can edit the menu (under the appearance tab in the dashboard). (you may need to add a new menu and assign it to the main navigation menu. It sounds like you have the defaulted menu set-up.
Once you've added a menu and assigned it to the main navigation, you can uncheck "automatically add top-level elements" or its equivalent, and add/remove menu items. You can also change their hierarchy (independent of actual page hierarchy).
It's all so easy these days. Just Go to appearance>menus>click the little triangle next to the listed page name>click remove> don't forget to save ... all done!
Maybe you didn't set up a custom menu yet. Set up a custom menu first with the desired pages / links. If it doesn't show on your site, check custom memus are enabled in your theme.. this will help you setting up a custom menu: http://www.wpbeginner.com/wp-themes/how-to-add-custom-navigation-menus-in-wordpress-3-0-themes/

dropdown menu in drupal?

how can i style primary menu as a dropdown menu is drupal?
It would take forever to "Style" it, however there are tons of modules that allow it: Nice menus for one...
Here's a useful link on the subject without using a module like Nice menus:
http://drupal.org/node/190263
Also, make sure under site building > menus > primary links (or whatever menu you're using) you have the "expanded" option checked under the items you want to drop down.

2 breadcrumbs for 2 menus in Drupal

I'm using 2 different menus in 2 different blocks. They are enabled / disabled depending on the the pages users arevisiting.
Now, I have an issue with the breadcrumbs: they only work with the main menu and not the second one.
I need to automatically have the breadcrumbs the other menu as well.
thanks
Drupal's menu system sets only one active menu at a time: if you're trying to have two breadcrumbs at the same time on the same page, you're going to need to use menu_set_active_menu_name() to do some juggling back and forth.
However, if you're just trying to have one show up, consider using the Menu Breadcrumb module, which automatically sets the active menu based on the page. You also have the ability to set menu priority for pages that exist in more than one menu.
This question is not strictly programming related, however:
Drupal breadcrumbs follow the menu-items as they are enabled. Regardless of whether the menu-items are visible, and regardless of what menu(containers) hold the menu. Items that are not in the menu (such as nodes!) will not have a breadcrumb.
That said, there is an exception, modules can override the breadcrumb with drupal_set_breadcrumb(), if they do so, the last one to set the breadcrumb gets to set the breadcrumb. E.g. taxonomy module sets the breadcrumb on taxonomy-pages.
You could set the breadcrumbs hardcoded in a module.
You should investigate why breadcrumbs don't follow your menu's in this case.
You could investigate modules that allow tweaking the breadcrumb behaviour, such as hansel

Resources