Catalog / Drupal CMS Cheatsheet
Drupal CMS Cheatsheet
A comprehensive Drupal CMS cheatsheet covering essential concepts, modules, theming, and development practices.
Core Concepts & Architecture
Drupal Core Components
Nodes |
The fundamental content entity in Drupal, representing articles, pages, and other content types. |
Taxonomy |
A system for classifying and organizing content using vocabularies and terms (categories, tags). |
Blocks |
Reusable content elements that can be placed in different regions of a website (navigation menus, sidebars). |
Users |
Registered users with defined roles and permissions to access and manage content. |
Modules |
Extend Drupal’s functionality by adding new features, content types, or integrations. |
Themes |
Control the look and feel of a Drupal website using templates, CSS, and JavaScript. |
Key Drupal Directories
|
Contains Drupal core files. |
|
Stores contributed and custom modules. |
|
Holds contributed and custom themes. |
|
Default location for uploaded files. |
|
Stores composer dependencies. |
Content Entity API
Drupal’s Entity API provides a standardized way to manage content, allowing for creating, reading, updating, and deleting (CRUD) operations on various entities like nodes, users, and taxonomy terms. Key concepts:
|
Module Development
Basic Module Structure
A Drupal module typically consists of the following files:
|
Common Hooks
|
Called after a node is created. |
|
Called after a node is updated. |
|
Called after a node is deleted. |
|
Allows altering existing forms. |
|
Alter menu links |
Creating a Simple Module
|
Theming in Drupal
Theme Structure
A Drupal theme typically includes:
|
Twig Templating
|
Renders the main content of a page. |
|
Renders content in the sidebar region. |
|
Displays the title of a node. |
|
Adds a CSS class to an element. |
|
Debugging tool to output variable information (requires Devel module). |
Regions
Regions are defined in the theme’s Example:
|
Drush & Drupal Console
Drush Commands
|
Clear all Drupal caches. |
|
Enable a module. |
|
Disable a module. |
|
Run database updates (after module updates or core updates). |
|
Import configuration from the |
|
Export current configuration to the |
|
Execute a SQL query. |
Drupal Console Commands
|
Generate a new module with boilerplate code. |
|
Generate a new theme with basic files. |
|
Execute chain commands. |
|
Display help and usage information. |