Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 37 ยท Getting Started

What Is Drupal?

Learn what Drupal is, what it is good at, who uses it, and how this course teaches a system that cannot run inside your browser.

Drupal is a free, open-source content management system and web application framework written in PHP. You use it to build websites where the content is more complicated than a few pages and a blog: course catalogs, government portals, university sites, multilingual news platforms, intranets, and APIs that feed mobile apps. It stores content in a database, lets editors manage it in a browser, and gives developers a structured toolbox to change almost everything that happens along the way.

What makes Drupal different is its stance on structure. Instead of starting from "a page" or "a post", Drupal starts from content modeling: you describe the kinds of things your site holds (an event, a recipe, a staff member), the fields each one has, and how they relate. Everything else, from listings to search pages, is built on top of that model.

A note on how this course runs

The site you are reading cannot run Drupal. It needs PHP with several extensions, a database server, Composer and a web server, none of which exist in your browser tab. So this course does two things:

  • It shows real Drupal code and commands in read-only blocks (PHP, YAML, Twig, shell). Where output is shown, it is output we are certain about.
  • It gives you runnable stand-ins in JavaScript. These are small programs that reproduce the idea behind a Drupal mechanism: how a hook system dispatches, how a view filters a list, how a route maps to a controller. Every stand-in is labelled. They teach the concepts, but they are not Drupal.

To follow along for real, you will install Drupal on your own machine in Installing Drupal with Composer.

What Drupal is good at

Drupal's strengths show up when a project grows:

  • Structured content. Custom content types with typed fields, references between content items, and reusable media.
  • Fine-grained permissions. Roles, permissions per action, and workflows with moderation states.
  • Multilingual by design. Content, interface and configuration can all be translated in core.
  • Scale and caching. A detailed cache system with tags and contexts keeps large sites fast.
  • API-first options. Core ships JSON:API, so Drupal can serve as the back end of a JavaScript or mobile front end.
  • Security process. A dedicated security team publishes advisories and coordinated releases.

Its trade-off is a steeper learning curve than simpler tools. You spend time up front learning concepts such as entities, bundles, render arrays and configuration management, and you get predictability in return.

The big building blocks

flowchart TD
    A["Visitor request"] --> B["Routing"]
    B --> C["Controller or entity page"]
    C --> D["Entities and fields (content)"]
    D --> E["Render system"]
    E --> F["Theme and Twig templates"]
    F --> G["HTML response"]
    H["Modules and hooks"] -.-> C
    H -.-> D
    H -.-> E

Modules can step in at almost every stage. That is how Drupal is extended.

You will meet each box in this course. For now, remember three words:

  • Core is the part everyone gets: the entity system, users, Views, Twig, the cache layer and more.
  • Contributed modules and themes are free add-ons from the community at drupal.org, installed with Composer.
  • Custom code is the modules and themes you write for your own site.

Try a mental model: a content list

A stand-in is the fastest way to feel Drupal's approach. Here a "site" is just an array of content items, and a tiny function plays the role of a listing. This is not Drupal code; it shows that Drupal thinks in typed items with fields, not in pages.

JS Stand-in: typed content items

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The same shape will return in later lessons: a type, some fields, and a query that selects items. In real Drupal the type is a content type, the item is a node, and the query is a View.

A first look at real Drupal code

To keep the first taste concrete, this is what a very small piece of real Drupal looks like: a route definition in YAML that tells Drupal "when someone visits /hello, call this controller".

YAML
# mymodule.routing.yml
mymodule.hello:
  path: '/hello'
  defaults:
    _controller: '\Drupal\mymodule\Controller\HelloController::content'
    _title: 'Hello'
  requirements:
    _permission: 'access content'

And the controller it points to:

PHP
<?php

namespace Drupal\mymodule\Controller;

use Drupal\Core\Controller\ControllerBase;

class HelloController extends ControllerBase {

  public function content(): array {
    return [
      '#markup' => $this->t('Hello from Drupal.'),
    ];
  }

}

Notice that the controller returns an array, not an HTML string. Drupal turns that "render array" into HTML later, which is what allows themes, caching and modules to change the output. You will study this in the Themes chapter.

What people build with Drupal

  • Publishing sites with editorial workflows, scheduled publishing and revisions.
  • Directories and catalogs: members, products, courses, events.
  • Intranets and portals with strict access control.
  • Headless back ends that deliver content as JSON.
  • Multisite platforms, where one codebase powers many related sites.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does Drupal ask you to do first when you design a site?

    Drupal is built around structured content, so you describe your content types and fields before building listings and pages.
  2. 2. Why are the JavaScript examples in this course called stand-ins?

    Drupal needs PHP and a database. The stand-ins reproduce concepts so you can experiment, but they are not Drupal itself.
  3. 3. What does a Drupal controller return in the example?

    Returning a render array lets themes, caching and other modules alter the output before it becomes HTML.
  4. 4. Which part is NOT a reason people choose Drupal?

    Drupal rewards learning its concepts. It is powerful rather than instantly simple.

Summary

  • Drupal is an open-source PHP CMS and framework built around structured content.
  • Core provides entities, users, Views, Twig and caching; contributed modules and your own code extend it.
  • Modules can hook into nearly every stage of a request.
  • Real Drupal code is read-only here; JavaScript stand-ins let you experiment with the ideas.

Next: Drupal Compared with Other CMSs