New Podcast

Posted Thursday, September 9 at 7:48 am

Listen in as Andrew, Ryan, and Mike are joined by special guests Jake Strawn and Michelle Lauer as they discuss DrupalCon Copenhagen, Drupal 7, Drupal's new Code of Conduct, and more. Jake and Michelle just returned from Copenhagen and provide their insight on the largest European DrupalCon event yet. 

Download Podcast 44
DrupalEasy_ep44_20100909.mp3
Syndicate content

NEWSLETTER

Stay informed on our latest news!

Syndicate content

Testimonial

The DrupalEasy workshop provided a balance between "Best Practices" for Drupal development and an elegant example of integrating content from Youtube , Flickr, etc. using the FeedAPI. The workshop provided useful insights in advanced site design and a wealth of resources to speed up development and make deployment safer.

Who are we?

DrupalEasy is the collective expertise of Ryan Price and Michael Anello, who joined forces to provide training and consulting services worldwide. Read all about them and what they can do.

What is Drupal?

Drupal is a free, super-powerful content management system for sites that require information posting and collection, including blogs, forums, videos, photos, and databases of information. We think it is the best platform available. Here's why...

Why Drupal?

More and more savvy organizations are going with Drupal for content management, and its no mystery why. It’s free, flexible, and easy to maintain for small or large volume sites. Learn more...

Module Development: Understanding Wildcard Loader Arguments

When writing a module from scratch (or trying to deconstruct one to figure out how it works), it might save you some time to be aware of "wildcard loader arguments" when using hook_menu(). These wildcard arguments are automatically linked with "_load()" functions that allow the module developer to load data into the argument anytime the menu item is called.

Here's a quick example of what I'm talking about. Look at this snippet from the Quicktabs module's quicktabs_menu() function:


$items['admin/build/quicktabs/%quicktabs/edit'] = array(
'title' => 'Edit QT block',
'page callback' => 'drupal_get_form',
'page arguments' => array('quicktabs_form', 'edit', 3),
'access arguments' => array('administer quicktabs'),
'type' => MENU_CALLBACK,
'file' => 'includes/admin.inc',
);

The "%quicktabs" wildcard automatically calls the "quicktabs_load()" function whenever this menu item is called (if the wildcard was named "%pickles" then it would call "pickles_load()"). What this means is that while just the ID of the quicktabs block is passed in via the URL, the quicktabs_load() function takes this ID and populates the full quicktabs array that is then passed to the "quicktabs_form" function. Since this all happens automatically, there's no paper trail (and therefore can be a bit confusing) to see how exactly the $quicktabs variable gets populated.

More info on these "Wildcard Loader Arguments" is available on Drupal.org.

Trackback URL for this post:

http://drupaleasy.com/trackback/124
No votes yet
Syndicate content