menus from modules: help me understand basic menu concept in drupal7 Here's some paths I'm using in my module


control (this isn't really a page, it just goes to the next item)
control/jobs (provides list of jobs)
control/jobs/% (path for editing a particular job)
control/download (separate page)
control/settings (separate page)


I would like a simple menu that shows jobs, download and settings. I would like it to add the 'active' class when visiting the page. And when visiting a particular subpage (e.g. a particular job), I would like the parent menu items to have an "active-trail" class or such.

Using hook_menu I've created these menu items, all as MENU_NORMAL_ITEMs and I've put them in a new menu called menu-control. I've added this menu's block to my page. I get the menu items listed. But when I visit a particular job, there is nothing to indicate I'm on a child page of 'jobs' (or indeed, 'control').

This seems like the simplest implementation of a menu and I've been hacking at it for weeks (on and off!). Can anyone help?
Take a look at the Views Module.  You can define your page view and attach it any menu. 
Define it with a path such as control/%/jobs and set it to provide a list of all jobs using filters and format settings Set the menu type as menu tabs, and give it a name.
Add additional pages to the same view and with paths such as control/%/job and use a contextual filter to read the value in the URL in the % wildcard position. (You may have a bit of trouble if the wildcard is multiple words due to spaces vs. dashes in the path. If so ask another question here). Set the menu tab for this item as well.


Menu tabs are the menu that appears above the content (user Admin has View and edit tabs for content pages).  Note that you must have two menu tabs for them to show.

Your pages for download and settings sound like they require user input.  Those pages will require either an add-on module or custom coding to design a form.