Drupal coder

Configure links on modules overview page in Drupal 7

One of the smaller improvements in Drupal 7 is the addition of "Configure" and "Permissions" for each module in the modules configuration page. For each module we now have quicklinks pointing to the module's configuration page and the correct section on the "permissions" page.

configure-link-drupal7.png

Since we're all working hard now on making our contributed modules Drupal 7 compatible, I wanted to mention here how to make use of this small feature in your own module.
The "permissions" link is added there automatically by Drupal. For the "Configure" link you need to add one more line to your module's info file.

Let's assume our configuration page is on admin/appearance. We would then just add the following line to our info file.

configure = admin/appearance

For the Administration theme module this results in the following info file:

name = Administration theme
description = Enable the administration theme on more pages then possible with Drupal's default administration page.
core = 7.x
package = Administration
files[] = admin_theme.module
files[] = admin_theme.install
configure = admin/appearance

Remark: The links only appear for enabled modules!

January 18, 2010Drupal 7, Drupal, module development

Comments

I have added this to the handbook section about info files in Drupal 7. http://drupal.org/node/542202

Great little tip. I'll definitely make sure that the Storm modules use this.

Its sad to say that I seem to learn more from people's blogs like this than from the official docs / handbook.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options