Drupal - tomasz-ucll/UCLL-ITLandscape_ThomasL GitHub Wiki

Welcome back! Remember when we talked about Docker? Let's actually use it to host another project: a website built on a CMS! To be specific, we're using Drupal!

But what's a Drupal?

Drupal is a Belgian CMS (Content Management System) that lets you build a site, quick and easy and nice, through a relatively intuitive editor (as opposed to writing HTML, which is probably a bit tough for most users!) and provides additional features and options for further customisation by the user. Generally, CMS are designed to let anyone create a pretty website, pretty easily.

I picked it because I wanted to try something new, and I'm also something of a patriot. Also, it turns out Drupal's an open source project, which warms my heart.

But what makes Drupal special?

I just told ya it's open source. Does that mean nothing to you? That's okay, honestly, it doesn't affect the end user that much.

Drupal's documentation in the user guide mentions three concepts early on, which are likely some of their big fundamentals. (I can't get hands-on with the software until I've gotten screenshots to document the installation and set-up.) (Yes, I can do it non-chronologically, but I don't wanna. I'm not Tarantino.)

The Big Three

  1. Modules
  2. Themes
  3. Distributions

We'll cover them one at a time, don't worry.

Modules

Modules are files containing PHP, JavaScript, and/or CSS that hold the code for features that are either essential and bundled in with Drupal (yes, even the core code isn't 100% integrated!) or are otherwise desirable and added by the user.

If Drupal's a car, modules are the engine, radiator, wheel axles, differentials, windshield wipers, radio, tush heaters, and what-have-you. Generally, it makes it run. Or drive, for the metaphor.

Themes

Themes are the look and feel of your Drupal site, and typically have CSS and HTML alike in them (to add a nice header, for example) to make sure your site matches the feel you want for it. You get a few with the base installation, but you can always get third-party ones, both free and paid!

For our car metaphor, themes would be the colours, with the base themes being the usual colours they get from the factory, and third-party ones possibly being like getting a really cool wrap on it.

Distributions

Distributions are pre-configured instances of Drupal, with a few modules and themes hand-picked out for you, while also having a few configuration options set up in advance. They come in two flavours - full-featured, distributions catered to one express purpose (perhaps a blog, a webshop, a gallery, ...) and others, which are mainly just set up as a diving board for you to dive into making it your own.

In our car metaphor, getting a distribution is like exiting the car dealership in a brand new Toyota fitting just what you needed (perhaps a delivery truck if you needed a webshop, or a sports car if you're just talking about how cool you are on there), or perhaps if you got one of the other distributions you've just gotten the frame of a car and are now getting ready to piece together a brand new car just the way you want it.

Did that make any sense or did it just make you more confused? If it did, shame I can't hear you! Let's move on.

But how do I Drupal?

Fret not, I'll tell you! With pictures! How exciting!

Head on over to https://hub.docker.com/_/drupal/ so you know where to find the latest and most official Docker image you can get. You remembered we were using Docker, right?

Scroll down a little bit so we get to the code blocks. image That's what we like to see!

Copy that code block closer to the bottom, the one that designates a port. It'll make it a bit quicker and easier to get in.

Now we visit our old friend, the Docker Desktop client! image Open up the terminal with the button in the bottom right.

Now paste in the code we copied! You'll probably want to remove the dollar sign at the start, though, it caused problems for me. (probably because Belgium's in the EU) image Once your code looks nice, hit Enter. If this is your first time building the Drupal image, it'll probably say something about not having the image locally, freeze for a moment, and then do a bunch of scary looking numbers. Be not afraid! It's just downloading the latest and greatest Drupal image for you. image For me, I already had done it once before, so it just spits out a hexadecimal number (the container's ID) and leaves me be.

So if you're seeing a new container called some-drupal, congratulations, you've made it! All you'll have to do is head to localhost://8080 on a browser of your choice and you're largely good to go. If not, and you're getting some kind of error, let the experts know at one of these helpful locations:

So, uh, can I see what you made with Drupal?

image

no :(