Introduction to Module Development

Similar documents
Drupal Module Development

MASTER DRUPAL 7 MODULE DEVELOPMENT

CiviCRM for Drupal Developers

Drupal for Designers

Drupal Node Overview. Attendee Guide. Prepared for: EDT502, Fall 2007, Dr. Savenye Prepared by: Jeff Beeman. November 26, 2007 EDT502 Final Project

Using your Drupal Website Book 1 - Drupal Basics

Get Started Community Documentation Support Download & Extend Marketplace About

Develop a Native App (ios and Android) for a Drupal Website without Learning Objective-C or Java. Drupaldelphia 2014 By Joe Roberts

How does Drupal 7 Work? Tess Flynn, KDØPQK

Wednesday, November 7, 12 THE LEADER IN DRUPAL PLATFORM DESIGN AND DEVELOPMENT

Drupal 8. Core and API Changes Shabir Ahmad MS Software Engg. NUST Principal Software Engineser PHP/Drupal

BUILDING MULTILINGUAL WEBSITES WITH DRUPAL 7

GETTING STARTED WITH DRUPAL. by Stephen Cross

a paradigm for reusable drupal features Ian Ward Robert Soden

Drupal and ArcGIS Yes, it can be done. Frank McLean Developer

Beyond The Web Drupal Meets The Desktop (And Mobile) Justin Miller Code Sorcery Workshop, LLC

Data Management Applications with Drupal as Your Framework

Drupal Flyover (There s a Module for That) Emma Jane Hogbin Author, Drupal User's Guide

LEARNING DRUPAL. Instructor : Joshua Owusu-Ansah Company : e4solutions Com. Ltd.

Entites in Drupal 8. Sascha Grossenbacher Christophe Galli

GIS on Drupal in Where we ARRR

Drupal.org User Personas. prepared by Tatiana Ugriumova and Whitney Hess

The Beginner s Guide to G-Lock WPNewsman Plugin for WordPress: Installation and Configuration

Drupal. open source^ community experience distilled. 7 Business Solutions. Build powerful website features for your business. Trevor James.

Migrating into Drupal 8

by Wolfgang Ziegler (fago) and Klaus Purer (klausi) DrupalCon Paris 2009 Rules Leveraging rule based automation!

Drupal 6 Site Builder Solutions

Hack-proof Your Drupal App. Key Habits of Secure Drupal Coding

Building Drupal sites using CCK, Views and Panels. Khalid Baheyeldin Drupal Camp, Toronto May 11 12,

Drupal 7 Fields/CCK Beginner's Guide

Drupal 6 to Drupal 7 Migration Worksheet

Single Sign-On Framework in Tizen Contributors: Alexander Kanavin, Jussi Laako, Jaska Uimonen

Module - Facebook PS Connect

Commerce Services Documentation

FormAPI, AJAX and Node.js

Quote to Cloud Connecting QuoteWerks and Xero

The Fastest Way to a Drupal Site: Think it, Plan it, Build it.

Free as in Kittens : CiviCRM and Salesforce

Trainer name is P. Ranjan Raja. He is honour of and he has 8 years of experience in real time programming.

12Planet Chat end-user manual

Drupal 8 Development Retrospective. A timeline and retrospective from a core contributor

The Drupal Community. Where are we going and how to get involved? Byron Pacific Northwest Drupal Summit Oct 2, 2010

Developer Experience: Because Coders are People Too

Everything you ever wanted to know about Drupal 8*

Things Made Easy: One Click CMS Integration with Solr & Drupal

Who? Wolfgang Ziegler (fago) Klaus Purer (klausi) Sebastian Gilits (sepgil) epiqo Austrian based Drupal company Drupal Austria user group

Introduction to Open Atrium s workflow

Certified PHP/MySQL Web Developer Course

OSU Drupal 6 Boot Camp Workbook

Getting Content into Drupal Using Migrate


How We Did It. Unique data model abstraction layer to integrate, but de-couple EHR data from patient website design.

Cloudwords Drupal Module. Quick Start Guide

Thursday, November 1, 12 THE LEADER IN DRUPAL PLATFORM DESIGN AND DEVELOPMENT

An Advanced E-commerce Course

Celly FAQ. inbox cells people help. celly help. Common Support Questions. celly company. General. school. policies. About Cells.

Thank you for using Mercantec's E-Commerce Express the world's first FREE shopping cart.

Elgg 1.8 Social Networking

#d8rules - Support the Rules module for Drupal 8

Faichi Solutions. Drupal Commerce An Ideal Solution for Your ecommerce Platform. Contents. Whitepaper published on 1 ST Nov. 2014

Marketing Features

I have experience in building large Community websites, Business websites, Products and Services websites and E-commerce websites using Drupal.

Flexible Virtuemart 2 Template CleanMart (for VM2.0.x only) TUTORIAL. INSTALLATION CleanMart VM 2 Template (in 3 steps):

INTRO TO DRUPAL. February 23, 2013

How to Create and Send Newsletter Using G-Lock EasyMail

Building a Database-Driven Web Application With FileMaker

How To Fix A Bug In Drupal 8.Dev

Pre-authentication XXE vulnerability in the Services Drupal module

Optimizing Drupal Performance. Benchmark Results

Installing and Sending with DocuSign for NetSuite v2.2

RFP Website Design, Development, and Hosting Vendor Questions

Marketing Features

How To Set Up An Ubercart For A Business

User Manual. for pollxt version 1.2x

Design principles of the Drupal CSC website

PHPUnit and Drupal 8 No Unit Left Behind. Paul Mitchum

What is Drupal, exactly?

WebCUR ListServ. ListServ Help Manual

G-Lock WPNewsman WordPress Plugin Reviewer s Guide

HTML Form Widgets. Review: HTML Forms. Review: CGI Programs

Here are the steps to configure Outlook Express for use with Salmar's Zimbra server. Select "Tools" and then "Accounts from the pull down menu.

Document Freedom Workshop DFW 2012: CMS, Moodle and Web Publishing

State of Drupal Hungary Dries Buytaert

Creating an newsletter using SimpleNews and phplist

Middleweight Drupal Developer.

Multilingual content in Drupal 8: a highly evolved permutated API. DrupalCamp Vienna 2013 Francesco Placella

Digital Marketing Manager, Marketing Manager, Agency Owner. Bachelors in Marketing, Advertising, Communications, or equivalent experience

The easy way to a nice looking website design. By a total non-designer (Me!)

MASTERTAG DEVELOPER GUIDE

The Social Accelerator Setup Guide

Simple Tips to Improve Drupal Performance: No Coding Required. By Erik Webb, Senior Technical Consultant, Acquia

MHC Drupal User Manual: Webforms

1. Starting the management of a subscribers list with emill

Headless Drupal 8. #HeadlessDrupal

D7 Panels From Zero to Hero Tutorial

Advanced Web Development SCOPE OF WEB DEVELOPMENT INDUSTRY

The Tiny Book of Rules

Log In And Then What? Getting Your GameOfficials Account Set

MAXMAILER USER GUIDE

Drupal CMS for marketing sites

Transcription:

Introduction to Module Development Ezra Barnett Gildesgame Growing Venture Solutions @ezrabg on Twitter ezra-g on Drupal.org DrupalCon Chicago 2011

What is a module? Apollo Lunar Service and Excursion Modules

What is a module? A piece of software that adds or extends functionality on a Drupal website

Adds functionality o Ubercart - Provides a sophisticated online store o Fivestar - Provides a star rating widget for rating content o Signup - Let's users sign up to attend events

Extends Functionality Integration: UC_Signup - Allows people to to pay for Ubercart Events Utility: Token - Many modules rely on Token to provide configurable strings (like "Hello, [user-name]") Plugin: GMap Views Display information on a Google Map.

Often, adding a new feature entails extending or connecting existing features. You usually don't have to start from scratch :) Fivestar stores data using the VotingAPI UC_Signup connects Ubercart and Signup Embedded Media Field provides a new field for use with the Content Construction Kit

Core, Contrib & Custom Core - Part of the official Drupal package. Everyone using Drupal has these Contrib - Publicly available optional download, not specific to a particular website. (Though sometimes specific to a kind of feature) Custom - Specific to a particular website. Useful for that website, but not generally useful to the public.

Custom Modules Often avoidable (Extend existing contrib instead) Sometimes necessary, good for site-specific tweaks Usually cost more to maintain. You alone deal with: o Drupal API changes o Security issues o Feature additions o Friends you lose when you duplicate their module :( o Feeling of utter embarrassment when you spend hours writing a module only to discover that many people use a well-regarded contrib alternative. You have wasted your time only to create something vastly inferior to a project that is the result of thousands of hours of worldwide community collaboration. You spend weeks sulking in social isolation eating only nachos and briefly consider switching to Ruby but take time off from development entirely to focus on feng shui.

You usually don't have to start from scratch! Drupal Core and Contrib have powerful systems that you can harness in your module: o Displaying and processing forms for user input o Handling user accounts o Handling Content (Core node, contrib CCK) o Creating custom listings of content (Views)

And much, much more! http://www.flickr.com/photos/redherring1up/163079104/

How do modules add or extend functionality?

Hooks I'm performing a particular action. Does anyone have anything to say about it? Person A: I'm getting up to get napkins. Does anybody want me to get anything else? Person B: Yes! Please get straws. Module A: I'm presenting a form to the user. Module B: Please add a checkbox to the form! A - The hook Definition B - The hook Implementation

Hook Events and Example Actions Displaying a form to the user (hook_form_alter) o Add a custom checkbox A user signs up for an account (hook_user) o Display a friendly message Submitting a node (hook_nodeapi) o Store custom data in the database The website sends mail (hook_mail) o Connect to an SMTP sever

Common module pattern - Implement one or more hooks - Use a Drupal API helper function - Add custom processing

Form API PHP HTML

Form API Forms described consistently as PHP arrays Control over access, validation & submission Easy to modify forms Added security

How to get started? Read about one or more hooks Find an example module Dive in!

Hi, Drupal! I'm a module: -.info file Tells Drupal that your module exists. -.module file Contains main module code -.install file -.inc files Optional

Hooks Demo Client: American Society for Delicious Foods

Hooks Demo Client: American Society for Delicious Foods (ASDF) ASDF Module

Desired feature: Redirect user to appropriate category (taxonomy term) page after submitting a recipe. Tools we'll use: hook_form_alter() Devel module's dpm() function Documentation! Drupal API Reference & Form API Quickstart Guide

dpm(): Our flashlight into Drupal Easily print any variable to the screen for inspection. dpm($input, $name = NULL)

I'm using mah dpm() flashlight to inspect ur Drupal variabulz. http://www.flickr.com/photos/moogan/55851439/

Goggles optional Dive in!

Our approach: Target a specific from Add a custom submit handler to the Save button In custom submit handler, set $form_state['redirect'] based on submitted taxonomy term value Rejoice

variable_get($name, $default) Retrieve a site-wide variable. also, variable_set()

user_access($string, $account = NULL) Check if a user has permission to perform a particular action.

t() Translate Interface Text. I translate the fool!

hook_menu() Map a function to a callback: http://example.com/your-callback Makes Drupal run a particular function.

Common module pattern - Implement one or more hooks - Use a Drupal API helper function - Add custom processing

Look inside your favorite You can handle it! module!

Debugging/Learning tools: func_get_args() debug_backtrace()

func_get_args()

func_get_args() See what arguments are passed to a function. Compare args passed on a successful operation vs an unsuccessful one.

Got WTF? Use debug_backtrace()..

Resources api.drupal.org Drupal Form API Reference Drupal Form API Quickstart guide Pro Drupal Development Book Example modules GVS API Cheat sheet #Drupal on IRC Patch contributor guide Look inside your favorite module! @ezrabg on twitter

What did you think? Submit a session evaluation: https://chicago2011.drupal.org/node/add/eval/834 Thanks!