SlideShare a Scribd company logo
1 of 42
HELLO,  I  AM... ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
BEST PRACTICES FOR DRUPAL DEVELOPERS DrupalCamp India August 8/9/10, 2008 Dhirubhai Ambani Institute of Information & Communication Technology Gandhinagar, IN
We shall be covering -Best practices for - development environment - module development - theme development - some other stuff
Get the source Start out with the CVS checkout ALWAYS ” CVS chekout instruction  are available on  http://drupal.org/handbooks ”
Why use CVS version ,[object Object],[object Object],[object Object]
TO NEW DRUPAL VERSION ,[object Object],[object Object],[object Object]
revision control your project -Even if: - it is a small project - only you are working on it - Take a pick - svn, bzr, git, darcs ... - VSS(if you are crazy enough) - BUT NOT CVS('coz drupal uses it) the benifits are way too many!
The Editor Wars - Komodo Edit/IDE  my favourite - Scribes on GNOME  my other favourite   - PHPEclipse or Eclipse PDT - Qunta Plus on KDE - TextMate on Mac OS X - What? Windows? Are You Kidding? ;)
MODULE DEVELOPMENT UNDERSTAND ALL THE PREREQUISITES  THROUGHLY
Drupal DB Schema is the most important fundamental - Most importantly, understand: - how content/comments are stored - how taxonomy is stored - how users/ACL is stored
you can't escape  the hook Drupal has hooks for everything You can use hooks for: - CRUD operations - modifying anything(almost) at runtime - path/routes definitions - cron tasks, forms, schema definitions - and much much more...
and do I need to say - That you should know: - PHP - Bsic RDBMS concepts & SQL - Good Programming Style - Software Design Skills - learn that from Drupal ;)
so you want to code a new module Let's ask a few questions
Question #1 Is there are a contributed module that has the functionality I need? If Yes, use it. PERIOD.
Question #2 Is there any contributed module that does something similar to I need? If yes,  use it, switch off the other functions, if possible
Question #3 Can I adapt any contributed module to do what I need? If yes, adapt it.
code your modules when you need to DON'T  FORCE A DONKEY TO RUN A DERBY NEITHER  FORCE A STALLION TO PULL A CART
If you need a new content type CCK will save you lot of time
with CCK, use VIEWS a simplified Crystal Reports for Drupal.
when writing modules, you will be... - Creating Forms - Receiving input - Doing SQL stuff - Outputing strings - containing text, html and other content
Learn and understand Form API Form API has lot of benifits - Define forms in PHP syntax - Drupal will generate correct HTML - Makes form aterable at runtime - Makes programatic submission possible
filter out that evil input with check_plain($string) makes sure $string is plain text and filters out those clever scripts and malicious html
It's a full family ,[object Object],[object Object],[object Object],[object Object],[object Object]
Drupal has a very powerfull input filter system. LEARN IT – USE IT No Excuses
Learn to construct good SQL. PERIOD. Time to go back to basic RDBMS books
BAD  SQL in drupal ,[object Object],[object Object],[object Object],[object Object]
and good SQL ,[object Object],[object Object],[object Object],[object Object]
printf style converstion specifications ,[object Object],[object Object],[object Object],[object Object],[object Object]
avoid queries in loops asdasd  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
beware of QUERY HELL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Reloading user again
modules and html REMEMBER Don't output HTML directly from modules BUT DON'T MAKE IT A RELIGION
Take a look at ,[object Object],[object Object],[object Object]
one more tip NEVER NEVER NEVER use print statemets from inside function AJAX callbacks are exceptions but don't forget to exit() after print
THEMES - Learn and be strong at - HTML/CSS - Javascript/jQuery - Basic graphic design - use GIMP, Inkscape -  understand difference between svn and png
always use PHPTemplate - Default theme engine since v4.7 - Simple to learn and easy to use - Made for Drupal, by Drupal [people] - Uses our own PHP for templating - No new language to learn (die smarty die)
use some base theme - well tested - basic stuff is ready - some even have a framework(zen) - you can use zen, framework, base, clean, igniter, etc etc,
do you have a separate designer? - Ask him to  - take a look at Drupal generated HTML - learn the id/classes generated  by Drupal - learn basics of PHP and Drupal FireBug can help here.  http://getfirebug.com
avoid complex logic in tpl.php - Templates are for html not for logic - Remeber: - no SQL in templates - no complex logic in templates - on basic branching and looping more than 2 levels of nesting is  ALARM ALARM SITUATION
Other useful stuff - Follow coding standards - coder module can help - its has other tons of features - use devel module - to profile queries - inspect redirects - generate test data/users/taxonomy - debug themes(drupal 6) - and more
drush – drupal swiss army knife  - drush = drupal shell - unix scripting interface to drupal - API to build command line tools - a package manager, SQL Tools and ToolBox - Build your own tools and utilities
there is a lot left to cover Let that be some other time
Thank You - any questions? ?

More Related Content

What's hot

Introduction To Django
Introduction To DjangoIntroduction To Django
Introduction To DjangoJay Graves
 
How Symfony Changed My Life
How Symfony Changed My LifeHow Symfony Changed My Life
How Symfony Changed My LifeMatthias Noback
 
JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - IntroductionWebStackAcademy
 
Best Practices for Front-End Django Developers
Best Practices for Front-End Django DevelopersBest Practices for Front-End Django Developers
Best Practices for Front-End Django DevelopersChristine Cheung
 
Django best practices for logging and signals
Django best practices for logging and signals Django best practices for logging and signals
Django best practices for logging and signals flywindy
 
Drupal 8 customized checkout system
Drupal 8 customized checkout systemDrupal 8 customized checkout system
Drupal 8 customized checkout systemAhmad Hassan
 

What's hot (11)

Introduction To Django
Introduction To DjangoIntroduction To Django
Introduction To Django
 
How Symfony Changed My Life
How Symfony Changed My LifeHow Symfony Changed My Life
How Symfony Changed My Life
 
JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - Introduction
 
No-script PowerShell v2
No-script PowerShell v2No-script PowerShell v2
No-script PowerShell v2
 
Best Practices for Front-End Django Developers
Best Practices for Front-End Django DevelopersBest Practices for Front-End Django Developers
Best Practices for Front-End Django Developers
 
Django best practices for logging and signals
Django best practices for logging and signals Django best practices for logging and signals
Django best practices for logging and signals
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
Drupal 8 customized checkout system
Drupal 8 customized checkout systemDrupal 8 customized checkout system
Drupal 8 customized checkout system
 
Web programming
Web programmingWeb programming
Web programming
 
Low-Maintenance Perl
Low-Maintenance PerlLow-Maintenance Perl
Low-Maintenance Perl
 
Decoupled drupal
Decoupled drupal Decoupled drupal
Decoupled drupal
 

Viewers also liked

How to make a Line Follower Robot
How to make a Line Follower RobotHow to make a Line Follower Robot
How to make a Line Follower RobotHassan Raza
 
DIY UNO Play Breadboard ATMEGA328P with FT232 Breakout Board
DIY UNO Play Breadboard ATMEGA328P with FT232 Breakout BoardDIY UNO Play Breadboard ATMEGA328P with FT232 Breakout Board
DIY UNO Play Breadboard ATMEGA328P with FT232 Breakout BoardRaghav Shetty
 
L12 c-language-programming-of-atmega328 p
L12 c-language-programming-of-atmega328 pL12 c-language-programming-of-atmega328 p
L12 c-language-programming-of-atmega328 prsamurti
 
A REVIEW ON MULTI-SEED SOWING MACHINE
A REVIEW ON MULTI-SEED SOWING MACHINEA REVIEW ON MULTI-SEED SOWING MACHINE
A REVIEW ON MULTI-SEED SOWING MACHINEIAEME Publication
 
Arduino camera interfacing OV7670
Arduino camera interfacing OV7670Arduino camera interfacing OV7670
Arduino camera interfacing OV7670Somnath Sharma
 
L11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 pL11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 prsamurti
 
L10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 pL10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 prsamurti
 
L15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 pL15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 prsamurti
 
Introduction to arduino!
Introduction to arduino!Introduction to arduino!
Introduction to arduino!Makers of India
 
Final report on line follower
Final report on line followerFinal report on line follower
Final report on line followerPriya Hada
 
Line follower robot
Line follower robotLine follower robot
Line follower robotPriya Hada
 
Operation and management of primary and secondary tillage
Operation and management of primary and secondary tillageOperation and management of primary and secondary tillage
Operation and management of primary and secondary tillageagriyouthnepal
 
Sowing and planting machines
Sowing and planting machinesSowing and planting machines
Sowing and planting machinesagriyouthnepal
 
Agriculture in indian economy- Vishnu pujari
Agriculture in indian economy- Vishnu pujariAgriculture in indian economy- Vishnu pujari
Agriculture in indian economy- Vishnu pujariVishnu Pujari
 
Roles and problems of agriculture
Roles and problems of agricultureRoles and problems of agriculture
Roles and problems of agricultureRebam Jilani
 
Indian agriculture
Indian agricultureIndian agriculture
Indian agriculturekanishk102
 
FITC 2014 Amsterdam - Adobe Apps for Web Designers in 2014
FITC 2014 Amsterdam - Adobe Apps for Web Designers in 2014FITC 2014 Amsterdam - Adobe Apps for Web Designers in 2014
FITC 2014 Amsterdam - Adobe Apps for Web Designers in 2014Michael Chaize
 
Motivation Movie P P T Version Sample
Motivation  Movie  P P T  Version  SampleMotivation  Movie  P P T  Version  Sample
Motivation Movie P P T Version SampleAndrew Schwartz
 

Viewers also liked (20)

How to make a Line Follower Robot
How to make a Line Follower RobotHow to make a Line Follower Robot
How to make a Line Follower Robot
 
DIY UNO Play Breadboard ATMEGA328P with FT232 Breakout Board
DIY UNO Play Breadboard ATMEGA328P with FT232 Breakout BoardDIY UNO Play Breadboard ATMEGA328P with FT232 Breakout Board
DIY UNO Play Breadboard ATMEGA328P with FT232 Breakout Board
 
L12 c-language-programming-of-atmega328 p
L12 c-language-programming-of-atmega328 pL12 c-language-programming-of-atmega328 p
L12 c-language-programming-of-atmega328 p
 
A REVIEW ON MULTI-SEED SOWING MACHINE
A REVIEW ON MULTI-SEED SOWING MACHINEA REVIEW ON MULTI-SEED SOWING MACHINE
A REVIEW ON MULTI-SEED SOWING MACHINE
 
Arduino camera interfacing OV7670
Arduino camera interfacing OV7670Arduino camera interfacing OV7670
Arduino camera interfacing OV7670
 
Aurdino presentation
Aurdino presentationAurdino presentation
Aurdino presentation
 
L11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 pL11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 p
 
L10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 pL10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 p
 
L15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 pL15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 p
 
Introduction to arduino!
Introduction to arduino!Introduction to arduino!
Introduction to arduino!
 
Final report on line follower
Final report on line followerFinal report on line follower
Final report on line follower
 
Line follower robot
Line follower robotLine follower robot
Line follower robot
 
Operation and management of primary and secondary tillage
Operation and management of primary and secondary tillageOperation and management of primary and secondary tillage
Operation and management of primary and secondary tillage
 
Sowing and planting machines
Sowing and planting machinesSowing and planting machines
Sowing and planting machines
 
Agriculture in indian economy- Vishnu pujari
Agriculture in indian economy- Vishnu pujariAgriculture in indian economy- Vishnu pujari
Agriculture in indian economy- Vishnu pujari
 
Roles and problems of agriculture
Roles and problems of agricultureRoles and problems of agriculture
Roles and problems of agriculture
 
Indian agriculture
Indian agricultureIndian agriculture
Indian agriculture
 
FITC 2014 Amsterdam - Adobe Apps for Web Designers in 2014
FITC 2014 Amsterdam - Adobe Apps for Web Designers in 2014FITC 2014 Amsterdam - Adobe Apps for Web Designers in 2014
FITC 2014 Amsterdam - Adobe Apps for Web Designers in 2014
 
Motivation Movie P P T Version Sample
Motivation  Movie  P P T  Version  SampleMotivation  Movie  P P T  Version  Sample
Motivation Movie P P T Version Sample
 
Olympic Games
Olympic GamesOlympic Games
Olympic Games
 

Similar to Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008

Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practicesmanugoel2003
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesShabir Ahmad
 
How to? Drupal developer toolkit. Dennis Povshedny.
How to? Drupal developer toolkit. Dennis Povshedny.How to? Drupal developer toolkit. Dennis Povshedny.
How to? Drupal developer toolkit. Dennis Povshedny.DrupalCampDN
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Ryan Price
 
Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!mold
 
Making The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To SwallowMaking The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To SwallowPhilip Norton
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalystdwm042
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroSteven Pignataro
 
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
 
Advanced Module development
Advanced Module developmentAdvanced Module development
Advanced Module developmentdrupalindia
 
Drupal
DrupalDrupal
Drupalbtopro
 
Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Phase2
 
Drupal module development training delhi
Drupal module development training delhiDrupal module development training delhi
Drupal module development training delhiunitedwebsoft
 
DrupalCon LA 2015 Review
DrupalCon LA 2015 ReviewDrupalCon LA 2015 Review
DrupalCon LA 2015 ReviewlittleMAS
 
2014 11 20 Drupal 7 -> 8 test migratie
2014 11 20 Drupal 7 -> 8 test migratie2014 11 20 Drupal 7 -> 8 test migratie
2014 11 20 Drupal 7 -> 8 test migratiehcderaad
 

Similar to Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008 (20)

Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practices
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API Changes
 
Drupal development
Drupal development Drupal development
Drupal development
 
How to? Drupal developer toolkit. Dennis Povshedny.
How to? Drupal developer toolkit. Dennis Povshedny.How to? Drupal developer toolkit. Dennis Povshedny.
How to? Drupal developer toolkit. Dennis Povshedny.
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
 
Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!
 
Making The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To SwallowMaking The Drupal Pill Easier To Swallow
Making The Drupal Pill Easier To Swallow
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalyst
 
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven PignataroJoomla! Day Chicago 2011 Presentation - Steven Pignataro
Joomla! Day Chicago 2011 Presentation - Steven Pignataro
 
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
 
Dn D Custom 1
Dn D Custom 1Dn D Custom 1
Dn D Custom 1
 
Dn D Custom 1
Dn D Custom 1Dn D Custom 1
Dn D Custom 1
 
Advanced Module development
Advanced Module developmentAdvanced Module development
Advanced Module development
 
Drupal
DrupalDrupal
Drupal
 
Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7
 
Drupal module development training delhi
Drupal module development training delhiDrupal module development training delhi
Drupal module development training delhi
 
Drupal
DrupalDrupal
Drupal
 
DrupalCon LA 2015 Review
DrupalCon LA 2015 ReviewDrupalCon LA 2015 Review
DrupalCon LA 2015 Review
 
2014 11 20 Drupal 7 -> 8 test migratie
2014 11 20 Drupal 7 -> 8 test migratie2014 11 20 Drupal 7 -> 8 test migratie
2014 11 20 Drupal 7 -> 8 test migratie
 

Recently uploaded

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 

Best Practices For Drupal Developers By Mir Nazim @ Drupal Camp India 2008

  • 1.
  • 2. BEST PRACTICES FOR DRUPAL DEVELOPERS DrupalCamp India August 8/9/10, 2008 Dhirubhai Ambani Institute of Information & Communication Technology Gandhinagar, IN
  • 3. We shall be covering -Best practices for - development environment - module development - theme development - some other stuff
  • 4. Get the source Start out with the CVS checkout ALWAYS ” CVS chekout instruction are available on http://drupal.org/handbooks ”
  • 5.
  • 6.
  • 7. revision control your project -Even if: - it is a small project - only you are working on it - Take a pick - svn, bzr, git, darcs ... - VSS(if you are crazy enough) - BUT NOT CVS('coz drupal uses it) the benifits are way too many!
  • 8. The Editor Wars - Komodo Edit/IDE my favourite - Scribes on GNOME my other favourite - PHPEclipse or Eclipse PDT - Qunta Plus on KDE - TextMate on Mac OS X - What? Windows? Are You Kidding? ;)
  • 9. MODULE DEVELOPMENT UNDERSTAND ALL THE PREREQUISITES THROUGHLY
  • 10. Drupal DB Schema is the most important fundamental - Most importantly, understand: - how content/comments are stored - how taxonomy is stored - how users/ACL is stored
  • 11. you can't escape the hook Drupal has hooks for everything You can use hooks for: - CRUD operations - modifying anything(almost) at runtime - path/routes definitions - cron tasks, forms, schema definitions - and much much more...
  • 12. and do I need to say - That you should know: - PHP - Bsic RDBMS concepts & SQL - Good Programming Style - Software Design Skills - learn that from Drupal ;)
  • 13. so you want to code a new module Let's ask a few questions
  • 14. Question #1 Is there are a contributed module that has the functionality I need? If Yes, use it. PERIOD.
  • 15. Question #2 Is there any contributed module that does something similar to I need? If yes, use it, switch off the other functions, if possible
  • 16. Question #3 Can I adapt any contributed module to do what I need? If yes, adapt it.
  • 17. code your modules when you need to DON'T FORCE A DONKEY TO RUN A DERBY NEITHER FORCE A STALLION TO PULL A CART
  • 18. If you need a new content type CCK will save you lot of time
  • 19. with CCK, use VIEWS a simplified Crystal Reports for Drupal.
  • 20. when writing modules, you will be... - Creating Forms - Receiving input - Doing SQL stuff - Outputing strings - containing text, html and other content
  • 21. Learn and understand Form API Form API has lot of benifits - Define forms in PHP syntax - Drupal will generate correct HTML - Makes form aterable at runtime - Makes programatic submission possible
  • 22. filter out that evil input with check_plain($string) makes sure $string is plain text and filters out those clever scripts and malicious html
  • 23.
  • 24. Drupal has a very powerfull input filter system. LEARN IT – USE IT No Excuses
  • 25. Learn to construct good SQL. PERIOD. Time to go back to basic RDBMS books
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31. modules and html REMEMBER Don't output HTML directly from modules BUT DON'T MAKE IT A RELIGION
  • 32.
  • 33. one more tip NEVER NEVER NEVER use print statemets from inside function AJAX callbacks are exceptions but don't forget to exit() after print
  • 34. THEMES - Learn and be strong at - HTML/CSS - Javascript/jQuery - Basic graphic design - use GIMP, Inkscape - understand difference between svn and png
  • 35. always use PHPTemplate - Default theme engine since v4.7 - Simple to learn and easy to use - Made for Drupal, by Drupal [people] - Uses our own PHP for templating - No new language to learn (die smarty die)
  • 36. use some base theme - well tested - basic stuff is ready - some even have a framework(zen) - you can use zen, framework, base, clean, igniter, etc etc,
  • 37. do you have a separate designer? - Ask him to - take a look at Drupal generated HTML - learn the id/classes generated by Drupal - learn basics of PHP and Drupal FireBug can help here. http://getfirebug.com
  • 38. avoid complex logic in tpl.php - Templates are for html not for logic - Remeber: - no SQL in templates - no complex logic in templates - on basic branching and looping more than 2 levels of nesting is ALARM ALARM SITUATION
  • 39. Other useful stuff - Follow coding standards - coder module can help - its has other tons of features - use devel module - to profile queries - inspect redirects - generate test data/users/taxonomy - debug themes(drupal 6) - and more
  • 40. drush – drupal swiss army knife - drush = drupal shell - unix scripting interface to drupal - API to build command line tools - a package manager, SQL Tools and ToolBox - Build your own tools and utilities
  • 41. there is a lot left to cover Let that be some other time
  • 42. Thank You - any questions? ?