Join Jon Peck for an in-depth discussion in this video Adding a menu item for an admin interface, part of Drupal 7 Custom Module Development.
Before I create the wind farms administrative interface, I need to describe the location …of the interface to Drupal. …The menu system, which is distinct from the actual menu module, defines the navigational …menus and routes page requests to code, based on URLs. …These routes based on URLs are known as paths. …The menu module itself provides an administrative interface to allow menus and the routing to be managed. …To add a new menu item and routing path to the menu system, I will use hook_menu.…
Items added via hook_menu are aggregated by the menu system and assigned a hierarchy. …This hierarchy can be initially setting code, but can also be manipulated using the menu …module through the admin interface. …Hook_menu defines menu items in page callbacks. …This means a module can define what items are shown in the menu, the path that is associated …with the menu item, ends the callbacks to be used when that path is accessed. …The menu system does not access hook_menu very often, instead relying on caches to increase performance.…
- Creating your first module
- Interacting with hooks
- Working with permissions and roles
- Controlling access
- Adding a menu item to an admin interface
- Using the Form API (FAPI) to quickly create a form
- Creating custom form validation
- Manually creating a custom content type
- Validating user input
- Importing content using feeds
- Creating a block
- Understanding best practices and coding standards
Skill Level Advanced
Q: gmap3_tools is not working the way I expected it to. What version of gmap3_tools should I be using?
A: Use the free exercise file containing the version of gmap3_tools used for recording; the published version of the module on drupal.org has changed since recording and is not backwards compatible.
Q: I attempted to run the Drupal site root from the project files, but the site isn't loading. Why not?
A: The Drupal configuration file in sites/default/settings.php contains database configuration specific to the environment used to record the movie. This may be different than your environment. Edit the file and search for "windfarms" - you may need to change the database host, username, password, db name and port to match your specific environment.