Wildcards in dynamically generated menu I'm working on a custom module, and I'm building menu items using entries in a database. These are being cached, and the database is only really updated about once a month.

I'm having an issue getting wildcards to work with this menu.

Here's my menu structure that WORKS:

$dbconn = dbConnect();
$query = "SELECT TOP 3 id, title FROM table";
$q = mssql_query($query, $dbconn);
while($r = mssql_fetch_assoc($q)) {
    $title = $r['title'];
    $items[$title] = array(
        'title' =&gt; $r['title'],
        'description' =&gt; 'Page for ' . $r['title'],
        'page callback' =&gt; 'programs_page',
        'access callback' =&gt; TRUE,
        'type' =&gt; MENU_NORMAL_ITEM,
    );
}
mssql_close($dbconn);


But the moment I add the % into the array key, the menu items just disappear, like so:

$items[$title . "/%"];


Any suggestions on why drupal is tripping up on this? Even if I tack the ."/%" onto the $title variable, it doesn't work.
There is no need to add wilcard placeholders after your last path element. Anything tacked onto the end of the URL will be passed to the callback as arguments automatically.

If the example you give above, if someone goes to $title/arbitrary/arguments, then 'arbitrary' and 'arguments' will be passed as arguments to your page callback:

programs_page('arbitrary', 'arguments');

If you want arguments in the middle of your path, you can specify them with a % sign, or if you would like to automatically load and pass an object to your page callback, you can use wildcard loaders.