Very simple question with apparently a difficult solution.

Say I run a bar website and through the years I listed all my beers and their properties as separate pages.
Doing so, I manually created a menu item in main-menu for all of them. It looks like this:

Home
Beers
  Jupiler
    Brewery
    Best drunk with
  Stella Artois
    Brewery
    Best drunk with
  Maes
    Brewery
    Best drunk with
  Duvel
    Brewery
    Best drunk with
  ...
About
Contact

Or, in URL paths:

/
/beers
/beers/jupiler
/beers/jupiler/brewery
/beers/jupiler/best-drunk-with
/beers/stella-artois
/beers/stella-artois/brewery
/beers/stella-artois/best-drunk-with
/beers/maes
/beers/maes/brewery
/beers/maes/best-drunk-with
/beers/duvel
/beers/duvel/brewery
/beers/duvel/best-drunk-with
/beers/...
/about
/contact

Now after all of these years I get the brilliant idea of adding an 'order keg' link to all of my beers, redirecting you to a form to order a keg.
Seeing as I picked up Drupal development in the mean time, I'm not going to manually add links to each and every beer.
So I would add a little module like this:

beer_menu () {
  $items['beers/%/order-keg'] = array(
    'title' => 'ORDER KEG',
    'page callback' => 'order_keg',
    'page arguments' => array(1),
    'access callback' => TRUE,
    'menu_name' => 'main-menu',
    'type' => MENU_NORMAL_ITEM, // Default, but added for emphasis.
  );

  return $items;
}

The problem is: none of my beer pages show the link in the main-menu.
Everything works fine if I manually browse to /beers/jupiler/order-keg, but the link will not appear in my main-menu.

Am I doing something wrong, or is Drupal just not capable of doing what I wish to accomplish here?

Comments

kristiaanvandeneynde’s picture

Issue summary: View changes

Forgot something

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

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should 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.

cilefen’s picture

Status: Active » Closed (outdated)