Drupal Introduction

Post on 27-May-2015

1,962 views 3 download

Tags:

description

Basic overview of Drupal, given at the Northwest Ohio PHP User Group

transcript

DrupalNWO-PUG CMS Shootout

April 26, 2011 NWO-PUG 1

E-mail: chris@ctankersley.comTwitter: @dragonmantankIdenti.ca: dragonmantank

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

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

Nodes/EntitiesWhat Everything Is

April 26, 2011 NWO-PUG 4

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

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

Hook SystemHow Everything Works

April 26, 2011 NWO-PUG 7

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

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

Log a Node Deletion

April 26, 2011 NWO-PUG 10

ModulesBending Drupal To Our Will

April 26, 2011 NWO-PUG 11

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

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

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

ThemesMaking it look purdy

April 26, 2011 NWO-PUG 15

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

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

Taking the Good with the BadThere are some downsides…

April 26, 2011 NWO-PUG 18

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

The Admin Interface

Sucks

April 26, 2011 NWO-PUG 20

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

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

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

Questions?

April 26, 2011 NWO-PUG 24

LinksWhere to Find Stuff I Talked About

April 26, 2011 NWO-PUG 25

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