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
Comment #0.0
kristiaanvandeneyndeForgot something
Comment #2
cilefen CreditAttribution: cilefen commented