drupal for nongeek -...

167
DrupalCamp Stanford 2012 Drupal For NonGeek If you will never write a line of PHP code but need to understand how Drupal works, this session is for you. We'll focus on a high- level, conceptual understanding of the Drupal framework. Diana Montalion Dupuis : @dianadupuis Developer / Trainer / Hiker / Book Addict Director of Professional Services @fourkitchens Saturday, May 5, 2012

Upload: vannhi

Post on 12-Sep-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

DrupalCamp Stanford 2012

Drupal For NonGeekIf you will never write a line of PHP code but need to understand how Drupal works, this session is for you. We'll focus on a high-level, conceptual understanding of the Drupal framework.

Diana Montalion Dupuis : @dianadupuis Developer / Trainer / Hiker / Book AddictDirector of Professional Services @fourkitchens

Saturday, May 5, 2012

Page 2: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

My next tattoo

Saturday, May 5, 2012

Page 3: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

My next tattooThe wrong solution is implemented when the right questions were never asked.

Saturday, May 5, 2012

Page 4: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

The idea for this session arose when . . .

Saturday, May 5, 2012

Page 5: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

The idea for this session arose when . . .I was working on a proposal with our new (wonderful) client manager and realized that there are rarely any sessions *for her*. She needs to talk solution architecture but will never write any code.

Saturday, May 5, 2012

Page 6: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Common roles

Saturday, May 5, 2012

Page 7: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Client manager

Common roles

Saturday, May 5, 2012

Page 8: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Client manager• Scrum master / project manager

Common roles

Saturday, May 5, 2012

Page 9: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Client manager• Scrum master / project manager• Product owner

Common roles

Saturday, May 5, 2012

Page 10: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Client manager• Scrum master / project manager• Product owner• Stakeholder

Common roles

Saturday, May 5, 2012

Page 11: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Client manager• Scrum master / project manager• Product owner• Stakeholder• The money

Common roles

Saturday, May 5, 2012

Page 12: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Is this session for you?

Saturday, May 5, 2012

Page 13: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Agenda

Saturday, May 5, 2012

Page 14: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Understand how Drupal works - meta level

Agenda

Saturday, May 5, 2012

Page 15: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Understand how Drupal works - meta level• Understand how Drupal structures content

Agenda

Saturday, May 5, 2012

Page 16: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Understand how Drupal works - meta level• Understand how Drupal structures content• Computer science for people who aren’t computer scientists but need to think like one

Agenda

Saturday, May 5, 2012

Page 17: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Understand how Drupal works - meta level• Understand how Drupal structures content• Computer science for people who aren’t computer scientists but need to think like one• Sometimes

Agenda

Saturday, May 5, 2012

Page 18: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Understand how Drupal works - meta level• Understand how Drupal structures content• Computer science for people who aren’t computer scientists but need to think like one• Sometimes• Answer questions that haven’t been answered

Agenda

Saturday, May 5, 2012

Page 19: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

In the olden days . . .

Saturday, May 5, 2012

Page 20: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Webpages were static text documents with tags in them.

In the olden days . . .

Saturday, May 5, 2012

Page 21: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Webpages were static text documents with tags in them.• <p>

In the olden days . . .

Saturday, May 5, 2012

Page 22: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Webpages were static text documents with tags in them.• <p>• <h1>

In the olden days . . .

Saturday, May 5, 2012

Page 23: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Webpages were static text documents with tags in them.• <p>• <h1>• <h4>

In the olden days . . .

Saturday, May 5, 2012

Page 24: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Webpages were static text documents with tags in them.• <p>• <h1>• <h4>• Browsers (which took 10 hours to download) translated this markup.

In the olden days . . .

Saturday, May 5, 2012

Page 25: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Webpages were static text documents with tags in them.• <p>• <h1>• <h4>• Browsers (which took 10 hours to download) translated this markup. • yoursite.com/page.html

In the olden days . . .

Saturday, May 5, 2012

Page 26: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Webpages were static text documents with tags in them.• <p>• <h1>• <h4>• Browsers (which took 10 hours to download) translated this markup. • yoursite.com/page.html• yoursite.com/anotherpage.html

In the olden days . . .

Saturday, May 5, 2012

Page 27: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Then CSS

Saturday, May 5, 2012

Page 28: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Added styling to control look and feel

Then CSS

Saturday, May 5, 2012

Page 29: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Added styling to control look and feel• Either inline: <p style=”color:red”>

Then CSS

Saturday, May 5, 2012

Page 30: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Added styling to control look and feel• Either inline: <p style=”color:red”>• Or in their own document, aka “style sheet”

Then CSS

Saturday, May 5, 2012

Page 31: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Added styling to control look and feel• Either inline: <p style=”color:red”>• Or in their own document, aka “style sheet” • .css

Then CSS

Saturday, May 5, 2012

Page 32: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Added styling to control look and feel• Either inline: <p style=”color:red”>• Or in their own document, aka “style sheet” • .css• HTML pages would “include” those .css files and add selectors to the tags

Then CSS

Saturday, May 5, 2012

Page 33: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Added styling to control look and feel• Either inline: <p style=”color:red”>• Or in their own document, aka “style sheet” • .css• HTML pages would “include” those .css files and add selectors to the tags• <p id=”headline”>

Then CSS

Saturday, May 5, 2012

Page 34: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Then came . . . dynamic!

Saturday, May 5, 2012

Page 35: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Most of the pages are the same on every page

Then came . . . dynamic!

Saturday, May 5, 2012

Page 36: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Most of the pages are the same on every page• Why not save what is different (content) in a spreadsheet?

Then came . . . dynamic!

Saturday, May 5, 2012

Page 37: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Most of the pages are the same on every page• Why not save what is different (content) in a spreadsheet?• Databases are, basically, a collection of spreadsheets

Then came . . . dynamic!

Saturday, May 5, 2012

Page 38: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Most of the pages are the same on every page• Why not save what is different (content) in a spreadsheet?• Databases are, basically, a collection of spreadsheets• Why not add some programming logic (if this is true, do this, else, do that)?

Then came . . . dynamic!

Saturday, May 5, 2012

Page 39: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Most of the pages are the same on every page• Why not save what is different (content) in a spreadsheet?• Databases are, basically, a collection of spreadsheets• Why not add some programming logic (if this is true, do this, else, do that)?• And the Content Management System (CMS) was born

Then came . . . dynamic!

Saturday, May 5, 2012

Page 40: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Most of the pages are the same on every page• Why not save what is different (content) in a spreadsheet?• Databases are, basically, a collection of spreadsheets• Why not add some programming logic (if this is true, do this, else, do that)?• And the Content Management System (CMS) was born• Drupal is a CMS

Then came . . . dynamic!

Saturday, May 5, 2012

Page 41: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

The secret is in the URL

Saturday, May 5, 2012

Page 42: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• How does a CMS know to display the content of yoursite.com/page.html when you browse there?

The secret is in the URL

Saturday, May 5, 2012

Page 43: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• How does a CMS know to display the content of yoursite.com/page.html when you browse there?• Query strings: ?q=

The secret is in the URL

Saturday, May 5, 2012

Page 44: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• How does a CMS know to display the content of yoursite.com/page.html when you browse there?• Query strings: ?q=• yoursite.com/?q=1234

The secret is in the URL

Saturday, May 5, 2012

Page 45: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• How does a CMS know to display the content of yoursite.com/page.html when you browse there?• Query strings: ?q=• yoursite.com/?q=1234• The content of the page is in the “spreadsheet” with the ID 1234

The secret is in the URL

Saturday, May 5, 2012

Page 46: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Drupal hides the ?q=

Saturday, May 5, 2012

Page 47: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Drupal uses a query string

Drupal hides the ?q=

Saturday, May 5, 2012

Page 48: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Drupal uses a query string• yoursite.com/node/1234

Drupal hides the ?q=

Saturday, May 5, 2012

Page 49: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Drupal uses a query string• yoursite.com/node/1234• It hides the ?q=

Drupal hides the ?q=

Saturday, May 5, 2012

Page 50: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Drupal uses a query string• yoursite.com/node/1234• It hides the ?q=• But the ID is still there: 1234

Drupal hides the ?q=

Saturday, May 5, 2012

Page 51: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Drupal uses a query string• yoursite.com/node/1234• It hides the ?q=• But the ID is still there: 1234• When you see words, it’s an alias

Drupal hides the ?q=

Saturday, May 5, 2012

Page 52: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Drupal uses a query string• yoursite.com/node/1234• It hides the ?q=• But the ID is still there: 1234• When you see words, it’s an alias • yoursite.com/mypage

Drupal hides the ?q=

Saturday, May 5, 2012

Page 53: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Drupal uses a query string• yoursite.com/node/1234• It hides the ?q=• But the ID is still there: 1234• When you see words, it’s an alias • yoursite.com/mypage• but the URL is still really yoursite.com/node/1234

Drupal hides the ?q=

Saturday, May 5, 2012

Page 54: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Drupal isn’t really a CMS

Saturday, May 5, 2012

Page 55: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Psyche!

Drupal isn’t really a CMS

Saturday, May 5, 2012

Page 56: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Psyche!• Wordpress is a CMS. And if you blog, it’s great!

Drupal isn’t really a CMS

Saturday, May 5, 2012

Page 57: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Psyche!• Wordpress is a CMS. And if you blog, it’s great!• Drupal is a framework that does CMSy stuff

Drupal isn’t really a CMS

Saturday, May 5, 2012

Page 58: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Psyche!• Wordpress is a CMS. And if you blog, it’s great!• Drupal is a framework that does CMSy stuff• Here’s where it gets confusing and ingenious

Drupal isn’t really a CMS

Saturday, May 5, 2012

Page 59: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

It’s all about the questions

Saturday, May 5, 2012

Page 60: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• When a browser hits a page, Drupal asks a series of questions

It’s all about the questions

Saturday, May 5, 2012

Page 61: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• When a browser hits a page, Drupal asks a series of questions• This is an oversimplification

It’s all about the questions

Saturday, May 5, 2012

Page 62: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• When a browser hits a page, Drupal asks a series of questions• This is an oversimplification• It is called bootstrapping

It’s all about the questions

Saturday, May 5, 2012

Page 63: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

The process

Saturday, May 5, 2012

Page 64: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Who are you (generally) and what do you want? Initialize and store general info.

The process

Saturday, May 5, 2012

Page 65: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Who are you (generally) and what do you want? Initialize and store general info.• Can I just give you a stored copy? Serve cached data.

The process

Saturday, May 5, 2012

Page 66: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Who are you (generally) and what do you want? Initialize and store general info.• Can I just give you a stored copy? Serve cached data.• Can I connect to the database?

The process

Saturday, May 5, 2012

Page 67: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Who are you (generally) and what do you want? Initialize and store general info.• Can I just give you a stored copy? Serve cached data.• Can I connect to the database?• Do I need anything from there to work?

The process

Saturday, May 5, 2012

Page 68: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Who are you (generally) and what do you want? Initialize and store general info.• Can I just give you a stored copy? Serve cached data.• Can I connect to the database?• Do I need anything from there to work?• Who are you (specifically)? Start a session.

The process

Saturday, May 5, 2012

Page 69: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Who are you (generally) and what do you want? Initialize and store general info.• Can I just give you a stored copy? Serve cached data.• Can I connect to the database?• Do I need anything from there to work?• Who are you (specifically)? Start a session.• What are your requirements? Server / browser page headers

The process

Saturday, May 5, 2012

Page 70: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Who are you (generally) and what do you want? Initialize and store general info.• Can I just give you a stored copy? Serve cached data.• Can I connect to the database?• Do I need anything from there to work?• Who are you (specifically)? Start a session.• What are your requirements? Server / browser page headers• Where are you? Select language.

The process

Saturday, May 5, 2012

Page 71: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Who are you (generally) and what do you want? Initialize and store general info.• Can I just give you a stored copy? Serve cached data.• Can I connect to the database?• Do I need anything from there to work?• Who are you (specifically)? Start a session.• What are your requirements? Server / browser page headers• Where are you? Select language.• Which page? Serve up the page.

The process

Saturday, May 5, 2012

Page 72: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

The hooks

Saturday, May 5, 2012

Page 73: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• As each question is asked, “hooks” are called

The hooks

Saturday, May 5, 2012

Page 74: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• As each question is asked, “hooks” are called• Hooks are functions, little blocks of code, that run when they are called on

The hooks

Saturday, May 5, 2012

Page 75: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• As each question is asked, “hooks” are called• Hooks are functions, little blocks of code, that run when they are called on• Hooks are what make Drupal a framework

The hooks

Saturday, May 5, 2012

Page 76: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• As each question is asked, “hooks” are called• Hooks are functions, little blocks of code, that run when they are called on• Hooks are what make Drupal a framework• Drupal core (the code that comes out of the box) includes hooks

The hooks

Saturday, May 5, 2012

Page 77: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• As each question is asked, “hooks” are called• Hooks are functions, little blocks of code, that run when they are called on• Hooks are what make Drupal a framework• Drupal core (the code that comes out of the box) includes hooks• Drupal modules can add hooks or change existing hooks

The hooks

Saturday, May 5, 2012

Page 78: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• As each question is asked, “hooks” are called• Hooks are functions, little blocks of code, that run when they are called on• Hooks are what make Drupal a framework• Drupal core (the code that comes out of the box) includes hooks• Drupal modules can add hooks or change existing hooks • So can themes (where the XHTML and CSS goes)

The hooks

Saturday, May 5, 2012

Page 79: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Core, modules, themes

Saturday, May 5, 2012

Page 80: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Core is the “out of the box” code

Core, modules, themes

Saturday, May 5, 2012

Page 81: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Core is the “out of the box” code• Never hack core

Core, modules, themes

Saturday, May 5, 2012

Page 82: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Core is the “out of the box” code• Never hack core• Kittens will die

Core, modules, themes

Saturday, May 5, 2012

Page 83: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Core is the “out of the box” code• Never hack core• Kittens will die• Modules are where new hooks go. This is where functionality is changed or added. Views is a module. So is Organic Groups.

Core, modules, themes

Saturday, May 5, 2012

Page 84: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Core is the “out of the box” code• Never hack core• Kittens will die• Modules are where new hooks go. This is where functionality is changed or added. Views is a module. So is Organic Groups.• Themes handle the presentation, the look and feel

Core, modules, themes

Saturday, May 5, 2012

Page 85: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Core is the “out of the box” code• Never hack core• Kittens will die• Modules are where new hooks go. This is where functionality is changed or added. Views is a module. So is Organic Groups.• Themes handle the presentation, the look and feel• Themes include .tpl files that contain the HTML

Core, modules, themes

Saturday, May 5, 2012

Page 86: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Core is the “out of the box” code• Never hack core• Kittens will die• Modules are where new hooks go. This is where functionality is changed or added. Views is a module. So is Organic Groups.• Themes handle the presentation, the look and feel• Themes include .tpl files that contain the HTML• Hooks dictate which .tpl file should be used on your page

Core, modules, themes

Saturday, May 5, 2012

Page 87: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Core is the “out of the box” code• Never hack core• Kittens will die• Modules are where new hooks go. This is where functionality is changed or added. Views is a module. So is Organic Groups.• Themes handle the presentation, the look and feel• Themes include .tpl files that contain the HTML• Hooks dictate which .tpl file should be used on your page• It’s all about organizing the hooks and the files correctly

Core, modules, themes

Saturday, May 5, 2012

Page 88: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Do I care about the “framework” distinction?

Saturday, May 5, 2012

Page 89: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Mostly, no

Do I care about the “framework” distinction?

Saturday, May 5, 2012

Page 90: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Mostly, no• Except . . .

Do I care about the “framework” distinction?

Saturday, May 5, 2012

Page 91: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Mostly, no• Except . . .• Understanding this helps you make sense of why some things are easy and some things are hard

Do I care about the “framework” distinction?

Saturday, May 5, 2012

Page 92: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

The truth is . . . almost every conversation you are ever having about Drupal development is really about hooks

Saturday, May 5, 2012

Page 93: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Easy to hard

Saturday, May 5, 2012

Page 94: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Drupal already does what you want it to do because the necessary hooks, with the necessary code, run by default

Easy to hard

Saturday, May 5, 2012

Page 95: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Drupal already does what you want it to do because the necessary hooks, with the necessary code, run by default• Drupal provides an admin interface for you to turn it on or change it

Easy to hard

Saturday, May 5, 2012

Page 96: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Drupal already does what you want it to do because the necessary hooks, with the necessary code, run by default• Drupal provides an admin interface for you to turn it on or change it• A module or theme has already been written with the hooks (code) you need

Easy to hard

Saturday, May 5, 2012

Page 97: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Drupal already does what you want it to do because the necessary hooks, with the necessary code, run by default• Drupal provides an admin interface for you to turn it on or change it• A module or theme has already been written with the hooks (code) you need• Custom code has to be written (new hooks)

Easy to hard

Saturday, May 5, 2012

Page 98: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Drupal already does what you want it to do because the necessary hooks, with the necessary code, run by default• Drupal provides an admin interface for you to turn it on or change it• A module or theme has already been written with the hooks (code) you need• Custom code has to be written (new hooks)• Custom database tables (new spreadsheets) have to be created

Easy to hard

Saturday, May 5, 2012

Page 99: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Drupal already does what you want it to do because the necessary hooks, with the necessary code, run by default• Drupal provides an admin interface for you to turn it on or change it• A module or theme has already been written with the hooks (code) you need• Custom code has to be written (new hooks)• Custom database tables (new spreadsheets) have to be created• Your tasks can’t run on page load, a special process has to be written

Easy to hard

Saturday, May 5, 2012

Page 100: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Easy hard game!

Saturday, May 5, 2012

Page 101: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Add 15 custom fields to your Book Review page: author, publisher, etc.

Easy hard game!

Saturday, May 5, 2012

Page 102: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Add 15 custom fields to your Book Review page: author, publisher, etc.• Make the Book Review page look like the design you created.

Easy hard game!

Saturday, May 5, 2012

Page 103: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Add 15 custom fields to your Book Review page: author, publisher, etc.• Make the Book Review page look like the design you created.• Display a Most Commented list on your homepage

Easy hard game!

Saturday, May 5, 2012

Page 104: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Add 15 custom fields to your Book Review page: author, publisher, etc.• Make the Book Review page look like the design you created.• Display a Most Commented list on your homepage• Make all of your file uploads include the word “porcupine” in their file names

Easy hard game!

Saturday, May 5, 2012

Page 105: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Add 15 custom fields to your Book Review page: author, publisher, etc.• Make the Book Review page look like the design you created.• Display a Most Commented list on your homepage• Make all of your file uploads include the word “porcupine” in their file names• Create Groups for users to join and share content

Easy hard game!

Saturday, May 5, 2012

Page 106: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Add 15 custom fields to your Book Review page: author, publisher, etc.• Make the Book Review page look like the design you created.• Display a Most Commented list on your homepage• Make all of your file uploads include the word “porcupine” in their file names• Create Groups for users to join and share content• Display a list of Groups they can join

Easy hard game!

Saturday, May 5, 2012

Page 107: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Add 15 custom fields to your Book Review page: author, publisher, etc.• Make the Book Review page look like the design you created.• Display a Most Commented list on your homepage• Make all of your file uploads include the word “porcupine” in their file names• Create Groups for users to join and share content• Display a list of Groups they can join• Add a custom form

Easy hard game!

Saturday, May 5, 2012

Page 108: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Information architecture

Saturday, May 5, 2012

Page 109: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• From here on out, everything is about creating structure, associating content with other content

Information architecture

Saturday, May 5, 2012

Page 110: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• From here on out, everything is about creating structure, associating content with other content• Because nobody wants a website that spits out all the content in one big blob.

Information architecture

Saturday, May 5, 2012

Page 111: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• From here on out, everything is about creating structure, associating content with other content• Because nobody wants a website that spits out all the content in one big blob.• Nodes and Content Types

Information architecture

Saturday, May 5, 2012

Page 112: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• From here on out, everything is about creating structure, associating content with other content• Because nobody wants a website that spits out all the content in one big blob.• Nodes and Content Types• Menus

Information architecture

Saturday, May 5, 2012

Page 113: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• From here on out, everything is about creating structure, associating content with other content• Because nobody wants a website that spits out all the content in one big blob.• Nodes and Content Types• Menus• Blocks

Information architecture

Saturday, May 5, 2012

Page 114: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• From here on out, everything is about creating structure, associating content with other content• Because nobody wants a website that spits out all the content in one big blob.• Nodes and Content Types• Menus• Blocks• Taxonomy

Information architecture

Saturday, May 5, 2012

Page 115: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• From here on out, everything is about creating structure, associating content with other content• Because nobody wants a website that spits out all the content in one big blob.• Nodes and Content Types• Menus• Blocks• Taxonomy• Views

Information architecture

Saturday, May 5, 2012

Page 116: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• From here on out, everything is about creating structure, associating content with other content• Because nobody wants a website that spits out all the content in one big blob.• Nodes and Content Types• Menus• Blocks• Taxonomy• Views• And the users who view and create them (which is you too)

Information architecture

Saturday, May 5, 2012

Page 117: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Nodes and Content Types

Saturday, May 5, 2012

Page 118: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Nodes are the primary content in Drupal. Out of the box, nodes are everything that fills up the big space on your pages

Nodes and Content Types

Saturday, May 5, 2012

Page 119: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Nodes are the primary content in Drupal. Out of the box, nodes are everything that fills up the big space on your pages• By default, they come with a Title and Body field

Nodes and Content Types

Saturday, May 5, 2012

Page 120: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Nodes are the primary content in Drupal. Out of the box, nodes are everything that fills up the big space on your pages• By default, they come with a Title and Body field• Like a blog

Nodes and Content Types

Saturday, May 5, 2012

Page 121: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Nodes are the primary content in Drupal. Out of the box, nodes are everything that fills up the big space on your pages• By default, they come with a Title and Body field• Like a blog• Content types are nodes that are assigned a type name. Articles and Basic Page are default in 7

Nodes and Content Types

Saturday, May 5, 2012

Page 122: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Nodes are the primary content in Drupal. Out of the box, nodes are everything that fills up the big space on your pages• By default, they come with a Title and Body field• Like a blog• Content types are nodes that are assigned a type name. Articles and Basic Page are default in 7• Different content types can have different Fields (and other differences). A Book Review type, for example.

Nodes and Content Types

Saturday, May 5, 2012

Page 123: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Nodes are the primary content in Drupal. Out of the box, nodes are everything that fills up the big space on your pages• By default, they come with a Title and Body field• Like a blog• Content types are nodes that are assigned a type name. Articles and Basic Page are default in 7• Different content types can have different Fields (and other differences). A Book Review type, for example.• They are still nodes

Nodes and Content Types

Saturday, May 5, 2012

Page 124: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Menus

Saturday, May 5, 2012

Page 125: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Menus enable navigation by creating paths for users to follow

Menus

Saturday, May 5, 2012

Page 126: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Menus enable navigation by creating paths for users to follow• Most sites have at least 3 menus

Menus

Saturday, May 5, 2012

Page 127: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Menus enable navigation by creating paths for users to follow• Most sites have at least 3 menus• Main: the primary links, usually in the header

Menus

Saturday, May 5, 2012

Page 128: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Menus enable navigation by creating paths for users to follow• Most sites have at least 3 menus• Main: the primary links, usually in the header• Secondary: sometimes in the footer or in a sidebar

Menus

Saturday, May 5, 2012

Page 129: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Menus enable navigation by creating paths for users to follow• Most sites have at least 3 menus• Main: the primary links, usually in the header• Secondary: sometimes in the footer or in a sidebar• Admin or Management: links to tasks

Menus

Saturday, May 5, 2012

Page 130: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Menus enable navigation by creating paths for users to follow• Most sites have at least 3 menus• Main: the primary links, usually in the header• Secondary: sometimes in the footer or in a sidebar• Admin or Management: links to tasks• Many sites have more

Menus

Saturday, May 5, 2012

Page 131: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Menus enable navigation by creating paths for users to follow• Most sites have at least 3 menus• Main: the primary links, usually in the header• Secondary: sometimes in the footer or in a sidebar• Admin or Management: links to tasks• Many sites have more• Menus items (parents) can have children, for a deeper structure

Menus

Saturday, May 5, 2012

Page 132: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Menus enable navigation by creating paths for users to follow• Most sites have at least 3 menus• Main: the primary links, usually in the header• Secondary: sometimes in the footer or in a sidebar• Admin or Management: links to tasks• Many sites have more• Menus items (parents) can have children, for a deeper structure• Nodes can be associated with menu items to give the site structure

Menus

Saturday, May 5, 2012

Page 133: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

For example . . .

Saturday, May 5, 2012

Page 134: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• The Main menu contains an item Books

For example . . .

Saturday, May 5, 2012

Page 135: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• The Main menu contains an item Books• Books (parent) has a child item called Book Reviews

For example . . .

Saturday, May 5, 2012

Page 136: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• The Main menu contains an item Books• Books (parent) has a child item called Book Reviews• Nodes with the content type Book Review can be associated (when they are created) with the Book Reviews menu item

For example . . .

Saturday, May 5, 2012

Page 137: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• The Main menu contains an item Books• Books (parent) has a child item called Book Reviews• Nodes with the content type Book Review can be associated (when they are created) with the Book Reviews menu item• The URL to your review would be yoursite.com/books/book-reviews/why-be-happy-when-you-can-be-normal (aka node/1234)

For example . . .

Saturday, May 5, 2012

Page 138: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Blocks

Saturday, May 5, 2012

Page 139: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Blocks are boxes of content displaying in a region

Blocks

Saturday, May 5, 2012

Page 140: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Blocks are boxes of content displaying in a region• Regions are defined in the theme. For example, “sidebar” or “footer”

Blocks

Saturday, May 5, 2012

Page 141: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Blocks are boxes of content displaying in a region• Regions are defined in the theme. For example, “sidebar” or “footer”• Blocks can contain all kinds of content: menus, content from nodes, text with markup and links, custom output (yup, there are hooks to create blocks)

Blocks

Saturday, May 5, 2012

Page 142: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Blocks are boxes of content displaying in a region• Regions are defined in the theme. For example, “sidebar” or “footer”• Blocks can contain all kinds of content: menus, content from nodes, text with markup and links, custom output (yup, there are hooks to create blocks)• It is common to confuse node content with block content or to want a block where there is no region

Blocks

Saturday, May 5, 2012

Page 143: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Taxonomy

Saturday, May 5, 2012

Page 144: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Lists of terms that can be associated with contentTaxonomy

Saturday, May 5, 2012

Page 145: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Lists of terms that can be associated with content• A list can be static -- a defined vocabulary

Taxonomy

Saturday, May 5, 2012

Page 146: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Lists of terms that can be associated with content• A list can be static -- a defined vocabulary• or dynamic -- free tagging

Taxonomy

Saturday, May 5, 2012

Page 147: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Lists of terms that can be associated with content• A list can be static -- a defined vocabulary• or dynamic -- free tagging• A list can be flat or hierarchical (with parents and children)

Taxonomy

Saturday, May 5, 2012

Page 148: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Lists of terms that can be associated with content• A list can be static -- a defined vocabulary• or dynamic -- free tagging• A list can be flat or hierarchical (with parents and children)• yoursite.com/taxonomy/term

Taxonomy

Saturday, May 5, 2012

Page 149: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Lists of terms that can be associated with content• A list can be static -- a defined vocabulary• or dynamic -- free tagging• A list can be flat or hierarchical (with parents and children)• yoursite.com/taxonomy/term

Taxonomy

Fruit - Apples - PearsVeggies - Carrots - Spinach

Saturday, May 5, 2012

Page 150: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Views

Saturday, May 5, 2012

Page 151: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Views is a module that enables content to be organized and presented

Views

Saturday, May 5, 2012

Page 152: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Views is a module that enables content to be organized and presented• For example, “all Book Reviews posted in the last three months”

Views

Saturday, May 5, 2012

Page 153: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Views is a module that enables content to be organized and presented• For example, “all Book Reviews posted in the last three months”• It can also display content using the associations

Views

Saturday, May 5, 2012

Page 154: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Views is a module that enables content to be organized and presented• For example, “all Book Reviews posted in the last three months”• It can also display content using the associations• For example, “all nodes with the taxonomy term Apples AND Spinach, sorted alphabetically”

Views

Saturday, May 5, 2012

Page 155: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Views is a module that enables content to be organized and presented• For example, “all Book Reviews posted in the last three months”• It can also display content using the associations• For example, “all nodes with the taxonomy term Apples AND Spinach, sorted alphabetically”• Views can be created administratively

Views

Saturday, May 5, 2012

Page 156: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Views is a module that enables content to be organized and presented• For example, “all Book Reviews posted in the last three months”• It can also display content using the associations• For example, “all nodes with the taxonomy term Apples AND Spinach, sorted alphabetically”• Views can be created administratively • We could do a whole session just on Views

Views

Saturday, May 5, 2012

Page 157: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• Views is a module that enables content to be organized and presented• For example, “all Book Reviews posted in the last three months”• It can also display content using the associations• For example, “all nodes with the taxonomy term Apples AND Spinach, sorted alphabetically”• Views can be created administratively • We could do a whole session just on Views• and still not know everything about creating them

Views

Saturday, May 5, 2012

Page 158: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Users and permissions

Saturday, May 5, 2012

Page 159: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• user/1234

Users and permissions

Saturday, May 5, 2012

Page 160: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• user/1234• See the user ID?

Users and permissions

Saturday, May 5, 2012

Page 161: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• user/1234• See the user ID?• Users can have fields associated with them, like City and State

Users and permissions

Saturday, May 5, 2012

Page 162: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• user/1234• See the user ID?• Users can have fields associated with them, like City and State• Users can be assigned roles, like Editor or Student

Users and permissions

Saturday, May 5, 2012

Page 163: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• user/1234• See the user ID?• Users can have fields associated with them, like City and State• Users can be assigned roles, like Editor or Student• Roles are given permissions, like Edit Book Reviews or Delete Own Content

Users and permissions

Saturday, May 5, 2012

Page 164: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

• user/1234• See the user ID?• Users can have fields associated with them, like City and State• Users can be assigned roles, like Editor or Student• Roles are given permissions, like Edit Book Reviews or Delete Own Content• Anonymous users have the ID 0

Users and permissions

Saturday, May 5, 2012

Page 165: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

PHEW!

Saturday, May 5, 2012

Page 166: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Any Questions?

Saturday, May 5, 2012

Page 167: Drupal For NonGeek - web.stanford.eduweb.stanford.edu/group/drupal/cgi-bin/2012drupalcamp/sites/default/... · • And the Content Management System (CMS) was born • Drupal is a

Thank You!

Saturday, May 5, 2012