1. Week 7
Drupal
The worlds most complex
and expensive CMS
Reclaimhosting.com
Drupal.org
Bryan Ollendyke
[at]btopro
Developer Activist
2. - Drupal is vastly more complicated than WP
- We will do 2 labs on Drupal
- The labs build on each other
- I HIGHLY recommend attending Thurs so
we can work through it together
4. Today’s Topic / What you'll learn about
- Drupal - Why everyone hates it but loves
profiting from it
- Setup Drupal in reclaim hosting
- To a “team” based design exercise in
class to get a feel for data modeling
as it’s a popular reason Drupal exists
- Play with site building capabilities
- Build a small site on Drupal:
- Use Views to visualize data
- Content types to model data
- Add some user roles
Drupal
5. Week 7
Drupal
The worlds most
needlessly expensive CMS
Reclaimhosting.com
Drupal.org
Bryan Ollendyke
[at]btopro
Developer Activist
6. Links to poke around / sources
- https://drupal.org/
Community hub for the project
- https://reclaimhosting.com/
where we’ll install it
- https://backdropcms.org/
Popular fork of Drupal 7; different
reason for forking but still interesting
- https://simplytest.me/
A cool testing platform that spins up a
container running Drupal + modules you
tell it to download. Gives you 30 minute
and then the site self destructs
Drupal
20. Terms / definitions for today
- Module – Plugin / way of extending
platform. Drupal is the MOST modular
- Install Profile – starting point for new
sites. Similar to Grav’s skeleton concept
- Drupal – A project built out of a
misspelling, started by friends in a dorm
in Belgium to communicate between dorms
- Views – 1 of the most powerful concepts
of all CMSs that exist. Allows secure,
click and build database querying and
rendering. This is why Drupal kills the
competition.
Drupal
21. Terms / definitions for today
- Content Types – Data modeling concept
baked into the system. WordPress ships
with “Pages” and “Posts”. Drupal ships
with nothing.. Then adds in “Page” so
you can grasp it. But you can define new
types of content dynamically, great for
data modeling an organization.
- PHP – backend language it’s written in.
Drupal 7 and below are custom PHP and
“hook” based. Drupal 8+ are Object
oriented
- MySQL / MariaDB – database engine
- Backdrop - popular Drupal 7 fork
Drupal
22. Terms / definitions for today
Node / Entity – Drupal “pages” are called
nodes. A node is a type of entity.
Entities power the entire system
(menus, nodes, perms, configuration)
This expresses drupal’s flexibility to
it’s core. It happens to deliver websites
that’s not the required purpose of it.
I’ve built Drupal apps to accept photos
from car insurance adjusters, build
brands for sporting websites and deliver
educational material online.
There is no use-case it can’t meet.
Drupal
23. My bias in this situation
- I’ve written 100s of modules for Drupal
- I’ve got multiple million downloads of
these projects with several 10,000+
active installs (I don’t track anymore)
- Drupal is dramatically, technologically
superior and flexible. Without question.
That superiority expands the digital divide
and it’s part of why I’ve stopped
participating in the community as well. I
still attend DrupalCon regularly and have
many friends from events in the space but I
now try to get them onto webcomponents.
Drupal
24. However...
- That superiority expands the digital
divide
- As empowerment is my highest axiom I
have largely stopped participating in
the community
(outside of DCNJ / Gov events)
- I have many friends via the community
and social capital is a real thing
- Now I try to get them into webcomponents
as much as possible
Drupal
25. Why people like Drupal
- Crazy flexible. Great for ”headless”
development and acting as a backend /
content storage system
- Content is stored in complex database
format that’s hard to read manually,
but makes for incredible abstractions
between the data and visualization layer
- Drupal is a massive onion, layers upon
layers of complexity, each layer staying
in it’s lane though. So it’s highly
configurable and scalable as a result
of these abstractions
Drupal
29. Why people like Drupal
- Content modeling is second to none
field types can be added to give even
more possibilities
- Views to visualize and build database
queries in the browser is complex but
saves hundreds of tedious hours of
manual hours writing database queries
and does so securely
- Extensibility – Drupal is built for
professional, elite class dev.
It requires using conventions that are
expected by elite firms and government
agencies for security
Drupal
34. Why people like Drupal
- Security – Drupal’s got tons of things
built into the platform that help enforce
secure code being created and launched
- Form API that allows for building forms
out of array / object data
Drupal
38. WP vs Drupal code methodology (refresher)
- WordPress conventions from 2003 are still
prevalent
- Code / standards / conventions have
dramatically improved since 2003.. Yet
WP code remains in a stasis
- WP is hacked a lot historically because
of it’s ”autoupdating” nature
- Each Drupal major version is an API
breaking change. Meaning Developers have
to rewrite / update all plugins each
release and are responsible for
making the changes themselves
Drupal
42. Drupal versions (1-8) is breaking change
- This is great for security / conventions
- Allows for pruning “technical debt” or
code and ideas that no longer are valid
- WordPress supports every version always
so you can see the major difference here
Drupal
43. Drupal versions (8.8.x +) deprecates
- Major historical shift for Drupal
- 8.8.x will effectively be the same API
wise as Drupal 9
- Drupal 9 and beyond will no longer hijack
core APIs but will instead provide
deprecation notices which can be easily
checked via command line
- This will make it far less painful to
upgrade while still being able to keep
only code that makes sense as conventions
refine over time
Drupal
44. HAXcms 2019 < 10 Experimental
Edu
GravCMS 2014 < 100 Docs
Edu
WordPress 2003 > 10,000,000 Small / Mid
NGO
EDU
Drupal 2000 > 100,000 Top level
Gov, EDU
Marketing
Name Age Community Industries
46. Drupal Key concepts
- Modules
- Install profiles
- Themes
- Views
- Blocks
- Content types / Entity API
- Field API
- Permissions / Roles / User accounts
Drupal
47. What Drupal is not great for
- Small sites
- Cost. It costs a ton to operate
- Complexity / team size. Lots of layers
is great for scope but terrible for
number of people required to know how
to do everything
- I am a unicorn / full stack bc of this
Drupal
48.
49.
50. Drupal 7 vs Drupal 8/9
- Drupal 7 was “hook” based
hook_page_build
hook_page_build_alter
hook_module_enable
hook_node_update
hook_node_view
- Drupal 8/9 is built on Symphony and is
almost completely object oriented
Drupal
52. Backdrop
- Drupal 7 with functions renamed from
drupal_ to backdrop_
- Lots of enhancements to UX backported
from D8
- ”Configuration management” changes in
Drupal 8 backported to Backdrop
- Stores all configuration changes
in YAML files
- More small community focused, easier to
maintain for NGOs, education, small sites
Drupal
53. Dirty Drupal secret
- Every example site I showed today is
built in Drupal 7... Still.
- Drupal’s expense and flexibility make it
really hard to upgrade historically and
Drupal 8 was released Nov 2015
- Still talks at events about ”which way
do we go?”
- Upgrade to D9? Expensive.
- Stay in Drupal 7? Risky / stasis
- Move to Backdrop? How big is it really?
Drupal
54.
55.
56.
57.
58.
59.
60.
61. What we’ll do now
- An in class activity building an “app”
- We’re going to practice some data modeling
(Drupal excels at Data model mapping)
- You’re in a temporary group with the
people in the row your sitting in
(ugh, group work, I know, don’t worry)
- Have someone write / type up the data
model you agree would accurately model the
relationships and fields of each entity
Drupal
62. Data modeling scenario
- We are creating an online course
registration system called Pion Lath
- A university is made up of colleges
which offer courses, have faculty and
need classrooms
- Work on a single data model to express
these entities and their relationship to
each other
- I’ll use Draw.io to create a single image
to demonstrate the relationships between
them based on a shared definition and
upload it to the course website / Slack
Drupal
63. Data modeling
Take 10 minutes and figure out the fields
and relationships of this data
Courses
{come up with the relationships}
{come up with the fields}
Faculty
{come up with the relationships}
{come up with the fields}
Rooms
{come up with the fields}
Drupal
64. Data modeling into lab
- Now, let’s build a shared data model
that we all agree on
- I’ll use Draw.io to create a single image
to demonstrate the relationships between
them based on a shared definition
- Based on our shared definition we will
then use the image as the basis for what
will be needed in the Drupal site
- I’ll add this to Slack / Course site
Drupal
65. Lab Context
- You are the site builder that works in the
organization who has been doing Grav / WP
- You’ve starting to do websites that require
a lot of data and users and you don’t think
that WordPress is the right fit anymore
- Your Project Manager (with the same name as
you, weird huh?) agrees but has never used
Drupal and is concerned about you being able
to handle it
- They give you a map of the data model and
ask you to model the information in Drupal
and create a views that pull data together
Drupal
66. Lab Deliverable
- Create a Drupal site that accurately
represents the data model that we’ve
agreed on in class (on website / slack)
- Model these entities:
- Course
- Faculty
- Room
- Create 5 courses on the site (either
your own or make them up whatever)
- Create (real or fake) rooms and faculty
and associate them with the courses so all
courses have a faculty and a room / location
Drupal
67. Lab Deliverable
- Create a View that shows the list of courses
- Title this My schedule
- Make sure it shows up in the menu bar
- Make it display as a table
- Add fields that are relevant for people
viewing the site
- Create a View showing a list of the faculty
- Title this Our Faculty
- Make sure it shows up in the menu bar
- Make it display as a grid / list
- Add fields for photo, name
- BONUS 2PTS: Use a “Relationship” in the
view in order to show the courses that
faculty members are teaching
Drupal
68. Submitting the Lab
- Create your Drupal site building out the views and content
types that we chose to model our data off of this week
- Create a Home page in the menu that includes:
- 500 words on why Drupal is the choice for big organizations
- Links to 3 resources backing this claim
- A link to your YouTube video
- Record the video explaining Drupal’s use-case / context and
then show one of the following techniques (or both if u like)
- How to create a content type and add fields
OR
- How to create views, adding filters and sorting to the view
- Post your link to your site in: #lab7-drupal
69. Grading the Lab deliverable
- Did you create a Drupal site in Reclaim and
post your link to the channel (1pts)
- Did you create content types that match our
data model? (3pts)
- Did you create the view that matches the
requested data to display? (3pts)
- Did you record a video that demonstrates
site building technique (3pts)
10 point lab
BONUS 2PTS: Use a “Relationship” in the view in
order to show the courses that faculty members
are teaching
Drupal
70. Quick break / Questions?
Let’s build a Drupal
site on Reclaim hosting
Log into
reclaimhosting.com
Drupal
reclaimhosting.com
Bryan Ollendyke
[at]btopro
Notas del editor
Icon created by Creative Stall from the Noun Project
Icon created by Creative Stall from the Noun Project
Icon created by Creative Stall from the Noun Project