Heard about DrupalEasy Academy Career Training? Learn more about our 10-week quickstart Drupal Career Starter Program.
Interested in learning more about Drupal, but can't find the training you're looking for? Help us help you by letting us know what workshops interest you. Take this short survey to let us know!
Check out DrupalEasy around the web:
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.
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...
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...
Screencasts, cultivation grants, configuration management, and Batman are just some of the Drupal topics that Ryan Price, Mike Anello, and special guest Johan Falk discuss on episode 60 of the DrupalEasy Podcast.
Five Stories
Picks of the Week
Sponsor
Site of the Week
The Quarrel iOS game web site - If you'd like your site highlighted, please submit it at http://DrupalEasy.com/siteoftheweek.
Follow us on Twitter
If you'd like to leave us a voicemail, call 321-441-3964. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or medicinal advice for Andrew. If you'd rather just send us an email, please use our contact page at http://DrupalEasy.com/contact
This guest post was written by Ben Hosmer, a Drupal user new to module development as well as an active member of the Florida Drupal user community. He often blogs about Drupal related topics at radarearth.com
For the past five or six months, I've been itching to write a Drupal module. It seems to me to be the final step in attaining that Drupal nirvana, and you gain instant street cred as well at the monthly meet-ups. I've heard it also can up your certified to rock score too, since you get commits added to your history.
Thinking back to my early days learning Drupal, the mythical, magical, modules were those things you didn't mess with. You downloaded them, installed them, and usually they worked. The module developers were the big kids on the playground. The seniors in high school, so to speak. But, because of Drupal's awesome community, they weren't the bullies.
The CacheFlusher isn't my first module. I got my feet wet updating the Apture Module to Drupal 7, with some guidance from @ultimike (Mike Anello). Yeah, he is certifiied to rock a 7.
I learned a few things while I was updating the Apture Module, that made it a bit easier to write my own module from scratch.
First of all, you don't necessarily need to be a PHP guru to write a module. In fact, I am very far from it. You will need some basic, general understanding of programming flow though. I had dabbled in python before, and have been learning some PHP along the way too, but it definitely is not a pre-requisite. You just need a basic understanding of what code does.
You will need three things to write a module:
You can set up a development environment on your local computer using WAMP if you are running windows, or MAMP if you are on the MAC. Linux folks, you most likely already have everything you need. Just make sure you are running PHP5.
Check out these getting started guides to help you get WAMP or MAMP if you don't already:
MAMP: http://www.mamp.info/en/documentation/index.html
WAMP: http://www.wampserver.com/en/
For an even easier setup with no installation, go to webenabled.com and sign up for a free account, although transferring files back and forth for testing might become tedious.
There are numerous text-editors available. A lot are free. Your operating system probably includes one. TextWrangler is my personal favorite for the mac, but you really need to try different ones to decide which one you really like. Windows users can use Notepad++. Some offer syntax and code completion as well as a lot of other nifty features.
Let's get started
First, if you have installed any contributed modules before, and you have ever peeked inside your sites/all/modules directory, you will see that there are a bunch of other directories with names like “views”, “mollom” and “colorbox”. These folders contain the code for each contributed module installed on your site. You will also notice that the names generally coincide with the name of the module. This is important, as we will soon learn.
Open one of the folders and look inside. I will promise you that you will see at least two files there along with possibly a README. One has a .info extension and the other has a .module extension, preceded by the exact same name of the parent directory.

This is how Drupal keeps track of the contributed modules available when you visit admin/modules
If you plan on sharing your modules with the rest of the world, (really why wouldn't you), go set up git on drupal.org using the Git Instructions as your guide.
After following the instructions, cd into your new module directory. You should see a .info file with your repository name already there. Drupal does this for you when you create your sandbox, and you just cloned it into your directory.

Open that .info file. This is kind of the table of contents for your module and contains some standard entries that every module should have.
What you will see is: name = yourmodulesname
This tells Drupal what the name of your module is. This is also where the information contained in the module overview page at admin/modules comes from.
We should add a few things before we are done here. Hit enter and start a new line.
Add description = a description about what your module does.

This creates the description for your module on the module overview page.
Our next entry will tell Drupal where to categorize our module. When you view the module overview page at admin/modules you will see some headings for subcategories like “Core”, “Services”, and “Taxonomy”. This helps to keep your modules organized.

Add a new line and type package = administration
The last entry we will need is important so that Drupal knows what version of Drupal this module was created for.
Add core = 7.x
This tells Drupal that your module is for Drupal 7.
If you plan on sharing your module, don't add a “version” entry. Drupal will automatically do this for you when it is packaged.
Make a new line, and add your final entry, files[] = yourmoudlename.module
This directs Drupal to your actual module code so that it can run.
Save your .info file.
Here is what the final version of the CacheFlusher module's .info file looks like:
name = CacheFlusher
description = Adds a quick way to flush your cache with a button on the admin toolbar.
package = "Administration"
core = 7.xfiles[] = cacheflusher.module
If you start up your Drupal installation and go to admin/modules, you will see a new entry for your module on the module administration page. It won't actually do anything yet though.
Next, you need to add your .module file. This is where all of the work gets done.
What are Drupal Modules?
Drupal modules are basically a series of functions, with a majority of them being function calls to Drupal functions. The documentation for every function available to Drupal can be found at api.drupal.org. This is your resource for finding out what each function does and how to use it.
As a newcomer, I found it to be lacking in examples. Sometimes it can be impossible to figure out what the function actually does. So, instead of complaining in a comment, I added some examples to the API entries.
After my frustration, I discovered the Examples Project that provides an excellent group of modules that do just what the project name implies--provide example modules for developers that give working code examples of what some of the popular functions actually do. It is an excellent resource and you should add it to your bookmarks toolbar because you will probably refer to it quite often.
You may find it very helpful to find a module that is very simple, and look through the code. If you are adding a menu entry for example, find a module that does the same thing and look through the .module file.
Often you might find .inc files. These point to additional code that wasn't included in the .module file. These will be noted in the .module file though with a filename.inc. This references those additional files.
Another good resource is your Drupal installation itself. By browsing to the core modules folder found at /modules, you can search for the function you are looking for by using spotlight if you are using a mac, or search for windows or locate from your nix terminal.
This can often shed some light on the function or at least reveal what function to implement to perform a certain task.
Now that you have your .info file and your directory. You are ready to create your .module file and spin some code up.
You can actually now got to your Modules page through your Drupal interface, and see the new entry for your module:

The second part of this article will go through the creation of your actual .module file.
Over the past few months since DrupalCon Chicago, I've spent some time working with other members (bhosmer, greggles, coltrane, christefano, lisarex, marguerite) of the community in reorganizing and rewriting the first version of the Drupal Camp Organizing Guide. Along with a new title (signifying the inclusion of other types of events such as sprints, summits, and hackfests), the guide is greatly enhanced with a lot of new information.
The goal of the effort is to provide a mechanism for experienced event organizers to transfer knowledge to other (both new and experienced) event organizers. By sharing lessons learned, pain points can be minimized, and organizing processes can be made more efficient.
The new Drupal Event Organizing Guide is now more than 12,000 words, with 24 sections including committees, budget, volunteers, web site, t-shirts, marketing, and case studies.
The guide is a living document - it is a wiki page - with plenty of opportunities for fellow Drupal event organizers to easily contribute. Many sections have a bulletted "examples" list - where we're still looking for input. Specifically, we're looking for snippets or links that offer insights on:
Since it is a wiki page, any part of the document, not just these topics, can (and should) be updated by those who wish to share new information.
I'm hoping to get some feedback from experienced as well as potential Drupal event organizers about which sections need to be expanded or clarified as well as what we missed.
If you're an organizer with something to add - but too busy to edit the guide - feel free to contact me (please use the "Event Organizers" category) with the information you'd like to share and I'll get it integrated in the document.
Join Ryan Price, Mike Anello and special guest Matt Butcher - one of the co-authors of "Drupal 7 Module Development" as they discuss the book, the growing complexity of Drupal code, new modules, DrupalCon 2013 (Go Canada!), and their picks of the week!
Five Stories
Picks of the Week
Sponsor
Site of the Week
If you'd like your site highlighted, please submit it at http://DrupalEasy.com/siteoftheweek.
Follow us on twitter:
If you'd like to leave us a voicemail, call 321-441-3964. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or medicinal advice for Andrew. If you'd rather just send us an email, please use our contact page at http://DrupalEasy.com/contact
On this week’s episode of the podcast, Ryan, Andrew, and Mike are joined by Barry Madore from Advantage Labs in Minneapolis, MN. They discuss DrupalCamps, a lightweight Payment module, Drupal 8 initiatives, as well as several other topics and their picks of the week!
Five Stories
Every Drupal site as an install profile by James Walker
Picks of the Week
Sponsor
Thanks to Webenabled for sponsoring this week's podcast. Create, develop, and deploy Drupal applications entirely on the Webenabled platform.
Site of the Week
GalTime.com - sent in by Erik Olsen. If you'd like your site highlighted, please submit it at http://DrupalEasy.com/siteoftheweek.
Follow us on twitter:
If you'd like to leave us a voicemail, call 321-441-3964. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or medicinal advice for Andrew. If you'd rather just send us an email, please use our contact page at http://DrupalEasy.com/contact
Drupal Rock Star Amitai (pronounced om-eee-tie - trust us, we checked) Burstein joins Ryan, Andrew, and Mike to talk about Organic Groups for Drupal 7, Acquia, Webchick, and mobile Drupal.
Five Stories
Picks of the Week
Thanks to Webenabled for sponsoring this week's podcast. Create, develop, and deploy Drupal applications entirely on the Webenabled platform.
Site of the Week
Möbler.se - sent in by Johan Falk from NodeOne.
If you'd like your site highlighted, please submit it at http://DrupalEasy.com/siteoftheweek.
Follow us on twitter:
Bonus: Find Waldo somewhere in this podcast notes (it might be linked to) and post in the comments where you found him. We don't have any prizes but perhaps we'll give the first person a shout out on the next podcast.
If you'd like to leave us a voicemail, call 321-441-3964. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or medicinal advice for Andrew. If you'd rather just send us an email, please use our contact page at http://DrupalEasy.com/contact
Sean Larkin, one of the maintainers of the Watershed Now Drupal distribution, joins Andrew, Ryan, and Mike in this week's podcast. Watershed Now is a highly targeted (vertical) distribution whose goal is to help conservation organizations get useful web sites up-and-running quickly. Sean talks about his background in various watershed projects, some of the features of the distribution, as well as the business model for this type of Drupal product.
Follow us on twitter:
If you'd like to leave us a voicemail, call 321-441-3964. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or medicinal advice for Andrew. If you'd rather just send us an email, please use our contact page at http://DrupalEasy.com/contact
Hey, hey, the gang's all here with our brief DrupalCon Wrapup, Drupal 8 initiatives on the horizon, a brand new Views 3 inside and out, a better issue queue for Drupal.org and a look at how the Drupal.org Sandbox projects are going.
5 Stories
DrupalEasy News
Thanks to WebEnabled Instant Development Platform for sponsoring this week's podcast. Create, develop, and deploy Drupal applications entirely on the Webenabled platform.
Picks of the Week
Site of the Week
If you'd like your site highlighted, please submit it at http://DrupalEasy.com/siteoftheweek.
Follow us on twitter:
If you'd like to leave us a voicemail, call 321-441-3964. Please keep in
mind that we might play your voicemail during one of our future
podcasts. Feel free to call in with suggestions, rants, questions, or
D&D challenges for Andrew. If you'd rather just send us an email,
please use our contact page at http://DrupalEasy.com/contact
In this video, Ed Sussman, CEO of Buzzr.com tells us a bit about their usability layer on top of Drupal, and gives us a demonstration of three new features: a live theme editor using Sweaver, twitter integration with a new auto-tweet feature, and a feature he calls QuickStarts, to give you a complete site instantly, complete with a theme and content, which you can then customize.
For more videos from DrupalCon Chicago, visit DrupalEasy's video page.
In this video, Heather James talks about Training and Professionalism as it relates to the future of Drupal, following a comment by Dries that Drupal needs more professionalism.
For more videos from DrupalCon Chicago, visit DrupalEasy's video page.