Saturday, September 29, 2012

Node Menu Parent - Module

The Node Menu Parent module extends the "default menu for content" setting provided by the core menu module by allowing a specific menu item to be selected (not just a top-level menu) per content type.

Example

Imagine we're creating a site for a business that will have a section describing the products they offer. We've got the core content types, Page and Story, and we've added our own content type called Product. Then we add a few pages under the Primary links menu, like so:
  • <Primary links>
    • Products
    • Support
    • About Us
Now say we've decided that every product should have a menu item under Products. However, core Drupal's menu settings only let us choose a global default menu for content, such as Primary links. That means when we go to create a Product, the "Parent item" dropdown under "Menu settings" defaults to Primary links so every time we create a product we have to manually select Products as the parent item. This is tedious, easy to forget, and unnecessary extra clicking.
The Node Menu Parent module gives us an extra option under the content type settings to choose a specific parent menu item per content type. So we can go to edit the Product content type, choose the Products menu item as the default parent, and now when we go to create a new Product that menu item is automatically chosen for us.
Combined with a module like Auto Menu Title, we can have menu items for our products created automatically without ever looking at the menu settings.

Read More..

No comments:

Post a Comment

only show translated menu items into current language (Drupal 8)

function MY_THEME_preprocess_menu(&$variables) {   if ($variables['menu_name'] == 'brancott-header-menu') {    $langu...