Chapter 1: Understanding Drupal
- Concept: Drupal as a Content Management System
- Concept: Modules
- Concept: Themes
- Concept: Distributions
- Concept: Types of Data
- Concept: The Drupal Project
- Concept: Drupal Licensing
Concept: Drupal as a Content Management System
What is a Content Management System?
A content management system (CMS) is a software tool that lets users add, publish, edit, or remove content from a website, using a web browser on a smartphone, tablet, or desktop computer. Typically, the CMS software is written in a scripting language, and its scripts run on a computer where a database and a web server are installed. The content and settings for the website are usually stored in a database, and for each page request that comes to the web server, the scripts combine information from the database and assets (JavaScript files, CSS files, image files, etc. that are part of the CMS or have been uploaded) to build the pages of the website.
The combination of the operating system that the CMS runs on, the scripting language it is written in, the database it stores its information in, and the web server that runs the scripts to retrieve information and return it to the site visitor's web browser is known as the stack that the CMS runs on; the commonly used combination of the Linux operating system, Apache web server, MySQL database, and PHP scripting language is known as the LAMP stack.
What is Drupal?
Drupal is a flexible CMS based on the LAMP stack, with a modular design allowing features to be added and removed by installing and uninstalling modules, and allowing the entire look and feel of the website to be changed by installing and uninstalling themes. The base Drupal download, known as Drupal Core, contains the PHP scripts needed to run the basic CMS functionality, several optional modules and themes, and many JavaScript, CSS, and image assets. Many additional modules and themes can be downloaded from the Drupal.org website.
Drupal can also run on other technology stacks:
- The operating system can be Windows or Mac OS instead of Linux.
- The web server can be Nginx or IIS instead of Apache.
- The database can be PostgreSQL or SQLite instead of MySQL, or a MySQL-compatible replacement such as MariaDB or Percona.
Other operating systems, web servers, and databases can also be made to work; however, the scripts that the software uses are written in PHP, so that cannot be changed.
What are the reasons for using Drupal?
When building a website, you have your choice of using one of the many existing CMS packages and hosted services, developing your own CMS, or building the site without using a CMS. Here are some of the reasons you might choose to use Drupal:
- Building a small, simple site with static HTML pages is not difficult, and you can get a simple site up very quickly. Setting up a site in a CMS generally requires more time initially, but brings you the benefits of on-line editing (easier for less experienced content maintainers), uniformity (harder to maintain using static HTML for larger sites), and the possibility of more complex features requiring a database.
- Some CMS software is special-purpose; for instance, there are packages and hosted services that you can use to build a blog or a club membership website. Drupal, in contrast, is a general-purpose CMS. If you are building a special-purpose site, you might choose to use a special-purpose CMS; however, if your site falls even slightly outside the intended purpose, you will probably be better off using a general-purpose CMS rather than trying to adapt a special-purpose CMS.
- Building your own CMS-type software can seem attractive. However, using a general-purpose CMS like Drupal as a starting point is usually a better idea, because the basic CMS functionality (such as user accounts and content management) has thousands of developer hours behind it, including many years of user testing, bug fixing, and security hardening.
- Some CMS software packages are expensive to purchase a license for. Some are free or have a free version, but have restrictive licenses that do not allow you to make modifications and extensions. You might prefer to use a package (like Drupal) that has a less restrictive software license, and is developed by a world-wide community. See Concept: The Drupal Project for more on this topic.
Related topics
Additional resources
- Drupal.org community documentation page "Understanding Drupal: Overview"
- Drupal.org page "FAQ" (Frequently Asked Questions)
- Drupal.org page "Case Studies"
- Wikipedia page "Content management systems"
- Wikipedia page "Modular design"
Concept: Modules
Prerequisite knowledge
Concept: Drupal as a Content Management System
What is a module?
A module is a package of files that extends Drupal's core functionality. Modules typically contain PHP code, configuration (YAML), and may include JavaScript, CSS, and Twig template files.
You can turn the features and functionality on by installing the module, and you can turn it off by uninstalling the module; before uninstalling, you may need to remove data and configuration related to the feature or functionality.
Each module that is installed adds to the time needed to generate pages on your site, so it is a good idea to uninstall modules that are not needed.
The core download provides modules for functionality such as:
- Managing user accounts (the core User module)
- Managing basic content (the core Node module) and fields (the core Field and Field UI modules; there are also core modules providing field types)
- Managing navigation menus (the core Menu UI module)
- Making lists, grids, and blocks from existing content (the core Views and Views UI modules)
You can download additional contributed modules from the Drupal.org Module Downloads, or create your own custom modules.
Related topics
- Concept: Themes
- Concept: Distributions
- Uninstalling Unused Modules
- Finding Modules
- Downloading and Installing a Module from Drupal.org
- Concept: Security and Regular Updates
- Updating a Module
Additional resources
Drupal.org community documentation page "Module developer's guide"
Concept: Themes
Prerequisite knowledge
Concept: Drupal as a Content Management System
What is a Theme?
A theme is a set of files that define the visual look and feel of your site. The core software and modules that run on your site determine which content (including HTML text and other data stored in the database, uploaded images, and any other asset files) is displayed on the pages of your site. The theme determines the HTML markup and CSS styling that wraps the content.
The core software provides several basic themes with the core distribution. These themes have largely been designed and built by the community over the last several years and will all be good choices for building your first sites and becoming more familiar with how the core software works.
Drupal is a well-established CMS so the market for 3rd party themes - both free and paid - is very robust.
If none of the 3rd party options suit your needs, you'll need to create a custom theme. A custom theme can be as simple as a single CSS file that adds styling to the markup provided by the core software. Guidance for creating custom themes in Drupal can be found in the Drupal.org community documentation page "Theming Drupal".
Related topics
Additional resources
Drupal.org community documentation page "Theming Drupal"
Concept: Distributions
Prerequisite knowledge
What are Distributions?
Distributions provide site features and functions for a specific type of site as a single download containing the core software, contributed modules, themes, and pre-defined configuration. A distribution makes it possible to set up a complex site for a specific purpose, in fewer steps than installing and configuring elements individually.
There are two main types of distributions:
- Full-featured Distributions: A full-featured distribution is a project that provides a complete solution to set up a site for a specialized purpose, such as academic, business, government, nonprofit, publishing, social, etc. For example, you could use an existing distribution for farmers markets to build your own website, or you could share your set-up for the farmers market site as a distribution for others to use.
- Other Distributions: Distributions can also be quick-start tools that developers and site builders can use as a starting point.
Related topics
Additional resources
Drupal.org Drupal Distribution Downloads
Concept: Types of Data
What are the types of data?
The data and information on your site is divided up into four types, which are edited, translated, and stored differently. These four types are:
- Content: Information (text, images, etc.) meant to be displayed to site visitors. This type of information tends to be relatively permanent, but can normally be edited.
- Configuration: Information about your site that is not content, but is also relatively permanent, and is used to define how your site behaves or is displayed. It is sometimes also displayed to site visitors, but tends to be smaller pieces of text (like field labels, the name of your site, etc.) rather than larger chunks that you'd normally think of as Content.
- State: Information of a temporary nature about the current state of your site, such as the time when cron jobs were last run.
- Session: Information about individual site visitors' interactions with the site, such as whether they are logged in and their cookies. This is technically a subtype of State information, since it is also temporary.
Related topics
- Concept: Content Entities and Fields
- Concept: Cron
- Concept: Users, Roles, and Permissions
- Concept: User Interface, Configuration, and Content translation
Concept: The Drupal Project
Prerequisite knowledge
Concept: Drupal as a Content Management System
What is Free and Open Source Software?
Free and Open Source Software (FOSS) is software that is developed by a community of people, released under a non-commercial license, and whose source code (the program files that make up the software) is freely available. For more information on the non-commercial license used by Drupal, see Concept: Drupal Licensing.
What is the Drupal project?
The Drupal project is a FOSS project whose purpose is to develop the core content management system software, as well as add-on modules, additional themes, translations, documentation, and special-purpose distributions. The people who contribute their time and money to the Drupal project come from all over the world, and are a diverse community that comes together for this common purpose.
The community encompasses many smaller groups who perform many different tasks such as developing a particular piece of Drupal-related software, writing documentation, maintaining the security of Drupal software, translating Drupal software into a particular language, using Drupal for some specific purpose, and coming together to meet in person within a particular geographical area.
For more on how you can connect to and communicate with the world-wide community, see Connecting with the Community and Getting Support.
What is the Drupal Association?
The Drupal Association is a non-profit organization dedicated to supporting the Drupal project and community. Its main functions are:
- Putting on large conventions around the world
- Maintaining the Drupal.org websites and the servers that they run on
- Promoting Drupal as a web platform
- Supporting Drupal education and training
- Providing grants to the Drupal community in support of its mission
- Raising funds for these purposes
Related topics
- Concept: Drupal Licensing
- Concept: Security and Regular Updates
- Connecting with the Community
- Getting Support
Additional resources
Concept: Drupal Licensing
Prerequisite knowledge
Concept: Drupal as a Content Management System
What is Drupal Licensing?
Drupal and all contributed files hosted on Drupal.org are licensed under the GNU General Public License (GPL), version 2 or later. That means you are free to download, reuse, modify, and distribute any files that are part of a project on Drupal.org under the terms of GPL version 2 or 3. You can also run the core software in combination with any code with any license that is compatible with version 2 or 3.
Drupal contributors should follow these guidelines:
- All files (PHP, JavaScript, images, Flash, etc.) that are part of a project on Drupal.org have to be under GPL version 2 or later.
- All Drupal contributors retain copyright on their code, but agree to release it under the same license as Drupal.
- Drupal modules and themes are a derivative work of Drupal. If you distribute them, you must do so under the terms of GPL version 2 or later.
- All content on Drupal.org itself is copyrighted by its original contributors, and is licensed under the Creative Commons Attribution-ShareAlike license 2.0.
- Sample code on Drupal.org is also available under GPL version 2 or later.