There are some contribute modules (like nodetrail and menutrails) that are doing this job. I've extended the node trail module (see #524640: Integrate nodetrails into the menu settings section (provided by the core menu module)) so that it plays well together with the node.module. With the changes I reached the following behavior:

If the "Menu link title" is left (or set to) blank and the "Parent item" is selected then the current node will be added to the "node trail". This means the current node behaves like a child of the parent item. If the node will be shown then the breadcrumb and the menu trail will set as expected.

I'm not informed about the the changes to the d7 menu system, but I'd like to propose to add this behavior to the menu system. I think there are only a few changes necessary, so it could be realized until code freeze.

CommentFileSizeAuthor
#2 545052-menu-settings.png50.47 KBosopolar
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Please provide some screenshots that explain what you want to do here.

osopolar’s picture

FileSize
50.47 KB

Ok, here is the screen shot. Do you understand what I want to do?

I just want to associate a node with a menu item. There are some modules like menutrails and nodetrail which does this job. Nodetrail uses an extra settings field. I thought that this extra field is not necessary instead we could integrate it in the current menu settings by just providing the parent item (without setting a link title). ... its just a way to integrate the nodetrail module in the menu module.

sun’s picture

Title: Ability to asocciate a node with a menu item » Allow to assign content to a certain menu trail without menu link (a.k.a. Menu Trails in core)
Version: 7.x-dev » 8.x-dev

I think I now get what you mean.

Basically the functionality of Menu Trails module: Allowing to assign all objects of a certain type (node type pages, term pages, etc.) to a certain parent menu item that already exists, so the menu on such a page is expanded to the assigned parent - although the current page has no menu link in the menu.

Better title. Bumping to D8.

osopolar’s picture

yes, almost. Its more like node trail, because I want to manually assign a object (node) to a certain (existing) parent menu item.

If you want to see how it may work just install the node trail module

momper’s picture

+1 for usability this is a must in core

osopolar’s picture

Title: Allow to assign content to a certain menu trail without menu link (a.k.a. Menu Trails in core) » Allow to assign content to a certain menu trail without menu link (a.k.a. Node Trails in core)

changed title to reflect #4

Alan D.’s picture

After looking at the node for NodeTrails (additional table), would it be simply a matter of updating the menu hidden value handle this? I do not know what happens with deeper menu structures, but it is a simple way to add a trail with a standard normal items.

A very naive hack at the problem using a form alter, (I think a checkbox would require changes in the menu module, so using radios):

<?php
      $form['menu']['hidden'] = array(
        '#type' => 'radios',
        '#default_value' => isset($form['menu']['hidden']['value']) ? $form['menu']['hidden']['value'] : 0,
        '#options' => array(
          '0' => t('Visible in the menu tree'),
          '-1' => t('Hidden in the menu tree'),
        ),
      );
?>

If this is a valid approach, then I would suggest changing the hidden form element to a checkbox and changing the menu parent select to include all items including the hidden items. It would require some UI testing, many find menus confusing as it is :)

I think that I would want to still have menu titles, as nested untitled menu items would be confusing as on the menu admin screens.

JohnAlbin’s picture

JohnAlbin’s picture

Status: Active » Closed (duplicate)
sun’s picture

Status: Closed (duplicate) » Active

Nope, this one actually is a product feature request, i.e., as mentioned before, something like menutrails module in core.

jhedstrom’s picture

Version: 8.0.x-dev » 8.1.x-dev
Issue summary: View changes

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.