SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
Module Development - Get the
Drupal started
Pieter-Jan Drouillon
WHY
this talk?

2
d
Goo

Ability

How soon can they
start kicking ass?

Suck
threshold

ad
B

Time
http://buytaert.net/creating-passionate-users

3
WHO
is talking?

@pjdrouillon | pieterjd.ulyssis.be

4
DISCLAIMER
5
DEFINE
your module

6
Define your module
<name>.info file
name
description
core
files
Achmed's advice :)
sites/all/modules/<name>
7
HOOKS
8
When something happens...
your module can hook in on it

9
DEM
O

hook_menu
10
FORMS
11
DEM
O

To form or not to form ...
Forms = arrays
Form API
Reverse example
Add a menu entry
set callback to drupal_get_form
set argument to function returning render array

12
Let’s add a
submit function

DEM
O

<form_function>_submit($form, &$form_state)

13
What about ...
Validation?

DEM
O

<form_function>_validate($form, &$form_state)

14
BLOCKS
15
QR Block
On every page
With a QR code
Use Google Chart API
http://chart.googleapis.com/chart?
chs=150x150&cht=qr&chl=<url>

16
Define the block

DEM
O

hook_block_info
array with all the info
key > block name
info > Some information
hook_block_view($delta = ‘’)
delta > name of block to render
returns render array

17
PERMISSIONS
18
DEM
O

To show or not to show ...
hook_permission
array with all the info
key > permission’s (short) name
title > permission’s fullname
user_access
checks if logged in user has the right permission
user 1 bypass

19
PREPROCESS
20
»
21
Read more »

DEM
O

hook_preprocess
process of preparing HTML code
$author > name of author linking to user profile
hook_preprocess_hook
hook_preprocess_blog

22
DEM
O

hook_form_alter
23
“I need a signature!”

DEM
O

hook_form_alter
hook_form_FORM_ID_alter

24
“I sometimes need
a legal disclaimer”

DEM
O

Add a checkbox
There’s a catch :)

25
theming
26
“I want my
definition list”

DEM
O

Cannot just return html
use theming functions
theme(<hook>,...)
search in API for theme_<hook>

27
hook_theme

DEM
O

array with all the info
key > name of theme (item_list, dd, ...)
add a list of variables
write function to create HTML code
theme_dd($variables)

28
TAKE AWAY
29
Don’t give up
Join a (local) community
Recommended books
Pro Drupal 7 development
Pakt Drupal 7 Module Development
Recommended sites
api.drupal.org, www.lullabots.com &
www.drupalize.me, NodeOne
TODO: Check out Drush & github !

30
Q&A
31
Feedback & follow-up:
http://drupalcampgent.be/feedback

Weitere ähnliche Inhalte

Ähnlich wie Drupalcamp Gent 2012

Top 5 Non-Obvious Drupal Modules
Top 5 Non-Obvious Drupal ModulesTop 5 Non-Obvious Drupal Modules
Top 5 Non-Obvious Drupal Modulesghing
 
Drupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutionsDrupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutionsphp2ranjan
 
FileMaker-Drupal Synchronization
FileMaker-Drupal SynchronizationFileMaker-Drupal Synchronization
FileMaker-Drupal SynchronizationMediacurrent
 
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008Mir Nazim
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8Allie Jones
 
Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010Siva Epari
 
Drupal Module Development
Drupal Module DevelopmentDrupal Module Development
Drupal Module Developmentipsitamishra
 
An overview of the Windows Phone 7 platform
An overview of the Windows Phone 7 platformAn overview of the Windows Phone 7 platform
An overview of the Windows Phone 7 platformJonas Follesø
 
Dolibarr - information for developers and partners - devcamp lyon 2019
Dolibarr - information for developers and partners - devcamp lyon 2019Dolibarr - information for developers and partners - devcamp lyon 2019
Dolibarr - information for developers and partners - devcamp lyon 2019Laurent Destailleur
 
10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-Box10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-BoxSuzanne Dergacheva
 
Webform 8.x 5.x - DrupalCon Baltimore
Webform 8.x 5.x - DrupalCon BaltimoreWebform 8.x 5.x - DrupalCon Baltimore
Webform 8.x 5.x - DrupalCon BaltimoreJacob Rockowitz
 
DrupalCon LA 2015 Review
DrupalCon LA 2015 ReviewDrupalCon LA 2015 Review
DrupalCon LA 2015 ReviewlittleMAS
 
PHPNW Drupal as a Framework
PHPNW Drupal as a FrameworkPHPNW Drupal as a Framework
PHPNW Drupal as a Frameworkdigital006
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practicesmanugoel2003
 
Deploying Moodle With High Availability and auto-scale on Microsoft Azure pla...
Deploying Moodle With High Availability and auto-scale on Microsoft Azure pla...Deploying Moodle With High Availability and auto-scale on Microsoft Azure pla...
Deploying Moodle With High Availability and auto-scale on Microsoft Azure pla...Somaroy Gabbita
 
Scale Conference "Intro to Drupal" Douglas C. Hoffman
Scale Conference "Intro to Drupal" Douglas C. HoffmanScale Conference "Intro to Drupal" Douglas C. Hoffman
Scale Conference "Intro to Drupal" Douglas C. HoffmanDoug Hoffman
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin GeneratorJohn Cleveley
 
Why xamarin forms is awesome
Why xamarin forms is awesomeWhy xamarin forms is awesome
Why xamarin forms is awesomeCharlin Agramonte
 
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...Acquia
 

Ähnlich wie Drupalcamp Gent 2012 (20)

Top 5 Non-Obvious Drupal Modules
Top 5 Non-Obvious Drupal ModulesTop 5 Non-Obvious Drupal Modules
Top 5 Non-Obvious Drupal Modules
 
Drupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutionsDrupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutions
 
FileMaker-Drupal Synchronization
FileMaker-Drupal SynchronizationFileMaker-Drupal Synchronization
FileMaker-Drupal Synchronization
 
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008
Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8
 
Drupal Workshop: Introducción al Backend de Drupal
Drupal  Workshop: Introducción al Backend de DrupalDrupal  Workshop: Introducción al Backend de Drupal
Drupal Workshop: Introducción al Backend de Drupal
 
Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010
 
Drupal Module Development
Drupal Module DevelopmentDrupal Module Development
Drupal Module Development
 
An overview of the Windows Phone 7 platform
An overview of the Windows Phone 7 platformAn overview of the Windows Phone 7 platform
An overview of the Windows Phone 7 platform
 
Dolibarr - information for developers and partners - devcamp lyon 2019
Dolibarr - information for developers and partners - devcamp lyon 2019Dolibarr - information for developers and partners - devcamp lyon 2019
Dolibarr - information for developers and partners - devcamp lyon 2019
 
10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-Box10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-Box
 
Webform 8.x 5.x - DrupalCon Baltimore
Webform 8.x 5.x - DrupalCon BaltimoreWebform 8.x 5.x - DrupalCon Baltimore
Webform 8.x 5.x - DrupalCon Baltimore
 
DrupalCon LA 2015 Review
DrupalCon LA 2015 ReviewDrupalCon LA 2015 Review
DrupalCon LA 2015 Review
 
PHPNW Drupal as a Framework
PHPNW Drupal as a FrameworkPHPNW Drupal as a Framework
PHPNW Drupal as a Framework
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practices
 
Deploying Moodle With High Availability and auto-scale on Microsoft Azure pla...
Deploying Moodle With High Availability and auto-scale on Microsoft Azure pla...Deploying Moodle With High Availability and auto-scale on Microsoft Azure pla...
Deploying Moodle With High Availability and auto-scale on Microsoft Azure pla...
 
Scale Conference "Intro to Drupal" Douglas C. Hoffman
Scale Conference "Intro to Drupal" Douglas C. HoffmanScale Conference "Intro to Drupal" Douglas C. Hoffman
Scale Conference "Intro to Drupal" Douglas C. Hoffman
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin Generator
 
Why xamarin forms is awesome
Why xamarin forms is awesomeWhy xamarin forms is awesome
Why xamarin forms is awesome
 
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
Fast Paced Drupal 8: Accelerating Development with Composer, Drupal Console a...
 

Kürzlich hochgeladen

Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 

Kürzlich hochgeladen (20)

Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 

Drupalcamp Gent 2012