# Chapter 1: Understanding Drupal

# 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_](https://www.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](/link/686) for more on this topic.
## Related topics

* [Concept: Modules](/link/682)
* [Concept: Themes](/link/683)
* [Concept: Distributions](/link/684)
* [Concept: The Drupal Project](/link/686)
## Additional resources

* [_Drupal.org_ community documentation page "Understanding Drupal: Overview"](https://www.drupal.org/docs/understanding-drupal/overview)
* [_Drupal.org_ page "FAQ" (Frequently Asked Questions)](https://www.drupal.org/about/faq)
* [_Drupal.org_ page "Case Studies"](https://www.drupal.org/case-studies)
* [Wikipedia page "Content management systems"](https://en.wikipedia.org/wiki/Content_management_system)
* [Wikipedia page "Modular design"](https://en.wikipedia.org/wiki/Modular_design)


# Concept: Modules

## Prerequisite knowledge

[Concept: Drupal as a Content Management System](/link/681)
## 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](https://www.drupal.org/project/project_module), or
create your own _custom modules_.
## Related topics

* [Concept: Themes](/link/683)
* [Concept: Distributions](/link/684)
* [Uninstalling Unused Modules](/link/708)
* [Finding Modules](/link/760)
* [Downloading and Installing a Module from _Drupal.org_](/link/762)
* [Concept: Security and Regular Updates](/link/780)
* [Updating a Module](/link/783)
## Additional resources

[_Drupal.org_ community documentation page "Module developer's guide"](https://www.drupal.org/developing/modules)


# Concept: Themes

## Prerequisite knowledge

[Concept: Drupal as a Content Management System](/link/681)
## 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"](https://www.drupal.org/docs/theming-drupal).
## Related topics

* [Finding Themes](/link/763)
* [Downloading and Installing a Theme from _Drupal.org_](/link/764)
* [Concept: Modules](/link/682)
## Additional resources

[_Drupal.org_ community documentation page "Theming Drupal"](https://www.drupal.org/docs/theming-drupal)


# Concept: Distributions

## Prerequisite knowledge

* [Concept: Drupal as a Content Management System](/link/681)
* [Concept: Modules](/link/682)
* [Concept: Themes](/link/683)
## 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

[Connecting with the Community](/link/786)
## Additional resources

[_Drupal.org_ Drupal Distribution Downloads](https://www.drupal.org/project/project_distribution)


# 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](/link/691)
* [Concept: Cron](/link/778)
* [Concept: Users, Roles, and Permissions](/link/737)
* [Concept: User Interface, Configuration, and Content translation](/link/695)


# Concept: The Drupal Project

## Prerequisite knowledge

[Concept: Drupal as a Content Management System](/link/681)
## 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](/link/687).
## 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](/link/786) and [Getting Support](/link/787).
## What is the Drupal Association?

The [Drupal Association](https://www.drupal.org/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](/link/687)
* [Concept: Security and Regular Updates](/link/780)
* [Connecting with the Community](/link/786)
* [Getting Support](/link/787)
## Additional resources

* [Drupal project governance](https://www.drupal.org/governance)
* [Drupal Code of Conduct](https://www.drupal.org/dcoc)


# Concept: Drupal Licensing

## Prerequisite knowledge

[Concept: Drupal as a Content Management System](/link/681)
## 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.
## Related topics

[Connecting with the Community](/link/786)
## Additional resources

* [_Drupal.org_ page on "Licensing"](https://www.drupal.org/about/licensing)
* ["Drupal LICENSE.txt" page on _api.drupal.org_](https://api.drupal.org/api/drupal/core!LICENSE.txt/9.0.x)
* [GNU General Public License, version 2](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* [GNU General Public License, version 3](http://www.gnu.org/licenses/gpl-3.0.en.html)
* [Creative Commons Attribution-ShareAlike license 2.0.](https://creativecommons.org/licenses/by-sa/2.0/)
* ["Legal Group" on _groups.drupal.org_](https://groups.drupal.org/legal)