On node add/edit page we have a menu settings option. This option by default show all the nodes in the main menu under Parent Item tab. Is there a way we can limit the nodes in the menu(under parent item) to only first two levels.
Menu Performance Module does exactly that.
Drupal is already aware of this issue and has a variable
menu_override_parent_selector which can be leveraged by other modules to come up with their own implementation of the menu handlers on node edit page.
As the project page reads
Menuperformance takes advantage of this, and sets the variable when installed. It then proceeds to add its own AJAX based parent menu item selector widgets for the node edit, node type edit and vocabulary edit pages.
How to Use from README.txt
- Enable the module.
- Go to /admin/config/user-interface/menuperformance , and activate the module. Checking the checkbox sets Drupal variable menu_override_parent_selector.
- After the module is activated, the menu item selectors on the above mentioned pages should have been replaced with a multiple dropdown AJAX-powered selector instead of the standard single dropdown.