How do I force my nodes to all show up at a given path, without adding them to a menu? My site has a set of events, all with the content type "event". I don't want to have to add them to the main menu manually, because there's hundreds of them and they'll make the menu very cumbersome to manage. I'd like each event to show up with the same breadcrumb and secondary menu as the view that displays all events.

So I added a hook_node_view to try and force all event nodes to show up in the same place as the events listing:

function MYMODULE_node_view($node, $view_mode, $langcode) {
    $menu_name = variable_get('menu_secondary_links_source', 'main-menu');
    if ($view_mode == 'full' &amp;&amp; $node-&gt;type == 'event') {
        menu_tree_set_path($menu_name, 'events'); // 'events' is the path to the view listing
    }


This only works when the nodes are already added to the main menu manually (i.e. it can be used to override the path, but won't do anything if the node isn't in the menu already).

Is there an easy way to force Drupal to always return my hardcoded path for a given content type?
There are two ways I know, and both are based on Menu block module.


Add all elements to the menu all right, but in the blocks that show menus, limit maximum depth so they are never shown to the end user in menu. Additional benefit is that you will have them properly placed in a tree for SEO modules like Site map or SiteMenu. And breadcrumbs will work out of the box.
Keep all nodes that should "appear" like they are in one menu in one path "directory", using Pathauto or similar solution. Add a Menu block set to show menu you need, and set it's display settings to only appear under the path you need and everywhere deeper. For breadcrumbs, you would need something like Breadcrumbs by path or Easy Breadcrumb - both claim to provide breadcrumbs based on URL aliases, so they are menu independent.


Personally, I would go with first way.