drupal introduction
DESCRIPTION
Basic overview of Drupal, given at the Northwest Ohio PHP User GroupTRANSCRIPT
![Page 1: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/1.jpg)
DrupalNWO-PUG CMS Shootout
April 26, 2011 NWO-PUG 1
E-mail: [email protected]: @dragonmantankIdenti.ca: dragonmantank
![Page 2: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/2.jpg)
Who Are You and Why Are You In My House?
Chris Tankersley Doing PHP for 8 Years Lots of projects no one uses, and a
few that some do TL;DR
https://github.com/dragonmantank
April 26, 2011 NWO-PUG 2
![Page 3: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/3.jpg)
Drupal
Web Application Framework Open-Sourced in 2001 by Dries Buytaert As of April 17, had 367,865 registered
sites Estimated 1.5% of all websites, which is around
2.8 million Powers websites from basic blogs all the
way to government websites Gigantic user community Functional, but moving toward OOP
April 26, 2011 NWO-PUG 3
![Page 4: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/4.jpg)
Nodes/EntitiesWhat Everything Is
April 26, 2011 NWO-PUG 4
![Page 5: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/5.jpg)
You Must Assimilate
Data is stored in Drupal as Nodes (Drupal 6) or Entities (Drupal 7) Posts, Images, Users, etc, are all the
same thing, just different characteristics Nodes are great in theory, a pain in
practice Drupal 7 went one level below nodes
and created Entities. Same idea, better implementation
April 26, 2011 NWO-PUG 5
![Page 6: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/6.jpg)
Working With Nodes
All nodes have the same basic layout All nodes invoke the same hooks
This means you have to do this:
April 26, 2011 NWO-PUG 6
![Page 7: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/7.jpg)
Hook SystemHow Everything Works
April 26, 2011 NWO-PUG 7
![Page 8: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/8.jpg)
There’s a Hook for That
Drupal uses a system of predefined ‘hooks’ for developers to attach to
Hooks allow developers to attach to almost anything that Drupal does What to do something when a thing is
deleted? Hook into ‘hook_delete’ Very powerful, but very steep
learning curve
April 26, 2011 NWO-PUG 8
![Page 9: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/9.jpg)
Hooking Into A Hook
Find the hook you want (‘hook_delete’)
Add your module name in place of Hook
April 26, 2011 NWO-PUG 9
![Page 10: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/10.jpg)
Log a Node Deletion
April 26, 2011 NWO-PUG 10
![Page 11: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/11.jpg)
ModulesBending Drupal To Our Will
April 26, 2011 NWO-PUG 11
![Page 12: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/12.jpg)
Hooks, Hook, Hooks
Modules are collections of Functions that implement Hooks
Contains a .info file with the module information
Contains a .module with all the functions
April 26, 2011 NWO-PUG 12
![Page 13: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/13.jpg)
Modules In Drupal’s Lifecycle
Drupal kicks up and figures out what the user wants to do
Drupal invokes the main hook Main hook calls all registered hooks Hooks all return data, and Drupal
finally finishes the original hook out
April 26, 2011 NWO-PUG 13
![Page 14: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/14.jpg)
Modules = Hook Registration
Really, ‘modules’ just allow you an easy way to enable/disable what code runs during the lifecycle
April 26, 2011 NWO-PUG 14
![Page 15: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/15.jpg)
ThemesMaking it look purdy
April 26, 2011 NWO-PUG 15
![Page 16: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/16.jpg)
Anatomy of a Theme
Basically a specialized Module
Folder contains PHP files, CSS, and JS
Instead of hooking into Hooks, you hook into Templates
April 26, 2011 NWO-PUG 16
![Page 17: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/17.jpg)
Build From Foundations
Drupal has many great Foundation Themes
Download, Install, and modify CSS/JS to get going faster
April 26, 2011 NWO-PUG 17
![Page 18: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/18.jpg)
Taking the Good with the BadThere are some downsides…
April 26, 2011 NWO-PUG 18
![Page 19: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/19.jpg)
Performance
All registered hooks always fire The more modules you have, the longer
Drupal has to process 100 modules that hook into hook_delete
fire every time hook_delete is fired, regardless of the situation
Drupal is coded for developers, not sysadmins
April 26, 2011 NWO-PUG 19
![Page 20: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/20.jpg)
The Admin Interface
Sucks
April 26, 2011 NWO-PUG 20
![Page 21: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/21.jpg)
The Admin Interface
Can be hard to find things Community has tried to fix this with
plugins I still find it a pain
April 26, 2011 NWO-PUG 21
![Page 22: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/22.jpg)
Learning Curve
It’s there, and it’s big API Documentation is there, but hard
to find what you want When you have 100’s of hooks, you
kinda guess what you want Hard to find intermediate-advanced
tutorials Lot of it is ‘Install this Module!’
instead of architecture
April 26, 2011 NWO-PUG 22
![Page 23: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/23.jpg)
Backward Compatibility
Major Revisions break Backward Compatibility
Makes for Slow Adoption of new releases
Drupal 6 -> 7 is painful because many modules just didn’t work
Drupal 7 -> 8 probably will be too
April 26, 2011 NWO-PUG 23
![Page 24: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/24.jpg)
Questions?
April 26, 2011 NWO-PUG 24
![Page 25: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/25.jpg)
LinksWhere to Find Stuff I Talked About
April 26, 2011 NWO-PUG 25
![Page 26: Drupal Introduction](https://reader035.vdocument.in/reader035/viewer/2022070317/5564afffd8b42a366c8b567a/html5/thumbnails/26.jpg)
Links
Drupal Main Site: http://www.drupal.org
API Site: http://api.drupal.org Contributions: http://drupal.org/
download Creating Themes:
http://tips.webdesign10.com/how-to-make-a-drupal-theme
April 26, 2011 NWO-PUG 26