You can’t use wildcards in menu paths? A quick summary of my problem (which I’ve made sure makes sense, so you’re not wasting your time): I have a menu which i’m showing on node pages of a certain content-type. My path to a node page would be like…
events/instal2010
…where instal2010 would be the name of an event (event is the content-type).
I’m using the Context and Menu Block modules to place a menu in the sidebar on that page…
- Event (the default active item)
- Programme
- Visitor info
- Book tickets
… where the path for Programme would be
events/instal2010/programme
So for this to work for many different events, those menu items need a wildcard in their path, e.g.
events/*/programme
Perhaps it’s time to ditch menus and just use a block with php to determine what page we’re on from the URL.
Any advice from experienced hands would be awsome, thanks.
You cannot create menu items with wildcards from the administrative interface of Drupal, but you can create menu items with wildcards in a module. I would recommend creating a custom module that uses hook_menu() to create the menu items. An example implementation would look something like:
In
$items['events/%/programme'] = array(, the%is the wildcard and it will be passed to your page callback function. It may be helpful to read more about hook_menu() and the Anatomy of hook_menu may also help as well.