Drupal 用户指南(英文原版)

Drupal 是一个开源内容管理系统。本书(英文)从规划站点讲起,依次介绍安装、基本配置、页面与菜单管理、内容结构、用户账号与权限、区块、Views 列表、多语言、扩展与部署,以及缓存、备份、安全更新等日常维护,适合搭建和管理 Drupal 网站的人。

Drupal User Guide

Drupal User Guide

Preface

Overview of introductory topics that help to leverage this guide in an efficient manner.

Understanding Drupal

Overview of Drupal concepts such as modules, themes, distributions, and types of data.

Planning Your Site

Overview of site planning concepts and details of common site layout tasks. Content entity and structure concepts are covered.

Installation

Overview of server requirements and details of common installation tasks.

Basic Site Configuration

Overview of basic site configuration concepts. Tasks on module installation, user account settings, and themes are covered.

Basic Page Management

Overview of page management concepts. Tasks on content items, in-place editing, and menus are covered.

Setting Up Content Structure

Overview of content structure concepts. Tasks on content types, taxonomies, and reference fields are covered.

Managing User Accounts

Overview of user account concepts and details of common user account tasks.

Blocks

Overview of block concepts and details of common block tasks.

Creating Listings with Views

Overview of view concepts and details of common view tasks.

Making Your Site Multilingual

Details of tasks needed to make a site multilingual.

Extending and Customizing Your Site

Overview of site customization and development. Tasks on downloading modules and themes are covered.

Preventing and Fixing Problems

Overview of cache, data backup, and log concepts. Task on clearing the cache is covered.

Security and Maintenance

Overview of security and maintenance concepts. Tasks on updating the core software, modules, and themes are covered.

Final Thoughts

Overview of the Drupal community and how to connect with other users.

Preface

Preface

Audience and Goal

This guide was written mainly for people with minimal knowledge of the Drupal content management system. The topics will help them become skilled at installing, administering, site building, and/or maintaining the content of a Drupal-based website. The guide is also aimed at people who already have some experience with a current or past version of Drupal, and want to expand the range of their skills and knowledge or update them to the current version.

This guide assumes that you have already decided you want to learn and use Drupal. If you need to learn more before deciding, see Concept: Drupal as a Content Management System.

Depending on which aspects of Drupal you would like to learn, you will need some background knowledge to understand this guide: general Internet skills and knowledge are assumed, and the guide concentrates on how to use the software itself. For instance, the sections about installing Drupal on a web server assume you can obtain web hosting and figure out how to transfer files to your chosen web host. Similarly, the sections about content management assume you can log into a website and fill in a web-based form.

After reading this guide, you should be able to:

Preface

Organization

This user guide contains a series of topics, each of which covers either a task (how to do something) or a concept (background knowledge, terminology, and the like). Concept topics have names starting with Concept:, while task topics have names containing verbs, like Editing Basic Site Information.

The topics are grouped into chapters in a logical order, with concepts and tasks interleaved so that concepts are presented before related tasks, and tasks build on each other. To take advantage of this, you are encouraged to read the entire guide in its presented order, possibly skipping topics that are not of interest or that present information you already know. Remember to try out the tasks on your own site as you read the guide; most people learn better by doing rather than reading.

If you prefer, you can also use the index or table of contents to jump straight to a topic that you'd like to learn about, rather than reading the entire guide. To facilitate this approach, each topic lists the prerequisite knowledge that you'd need in order to understand it, if any (with links to the topics that present that knowledge); task topics also list site prerequisites (things that you would need to have configured or created on your site in order to perform the task). Also, most topics have sections at the end where you can find related information and/or tasks for expanded understanding, to continue your learning.

You may also want to refer to the Glossary section as you read -- it gives brief definitions of most of the terminology used in the guide, with links to topics having more detailed explanations.

Preface

Reporting Problems

Goal

Report a problem with this guide, such as:

Steps

  1. Make a note of the topic or topics that contain the problem you have found.
  2. Log in to Drupal.org (you will need to create a user account if you do not already have one).
  3. Visit the User Guide issues page on Drupal.org.
  4. Verify that the problem you found has not already been reported in another issue:
    • If there are only a few open issues, scan the Summary column to see if any of their descriptions match the problem you found. You may also need to read some of the issues to make sure, which you can do by clicking the links in the Summary column.
    • If the open issue list is long, enter either a keyword related to the problem you found or the title of the topic where the problem occurs in the Search for box, and click Search to reduce the issue list. Then either scan the summaries or read the issues to see if they match your problem.
  5. If you determine that your problem has not already been reported, click Create a new issue, and fill in the issue report as follows:
    Field name Explanation Example value
    Title Short summary of the problem you found Instructions in "Adding
    Category Type of issue being reported Bug report
    Version Version of the guide you found the problem in 9.1.x-dev
    Issue summary Details of the problem you found In the "Adding a Content
  6. Reread the Title and Issue summary you entered, and verify that the following information is included in your report:
    • A complete description of the problem you found
    • The name of the topic or topics where you found the problem
    • The language you are reading the guide in (if not English)
    • If you read the guide on a website, a link to the page or pages with the problem
  7. Click Save to create the issue.
  8. Check back on the issue in a few days. If one of the project maintainers has asked for clarification, respond by adding a comment to the issue.
Preface

Conventions of the Guide

Assumptions and prerequisites

This guide has the following assumptions and prerequisites:

Text conventions

The following conventions are used in the text of this guide:

drush cache:rebuild

Navigation

To do most of the task topics in this guide, you will need to navigate to one or more pages in the administrative interface of your site. You might see something like this in the instructions (this will make more sense after you have the base software installed):

In the Manage administrative menu, navigate to Structure > Taxonomy (admin/structure/taxonomy).

Navigation instructions like this assume that you have the core Toolbar module installed, and this example means that in the menu bar at the top of your site, you would need to click Manage to expose the menu choices, then click Structure, then Taxonomy, and that at the end, you would be on a page with URL http://example.com/admin/structure/taxonomy (if your site base URL is http://example.com).

Admin menu

Here's another example:

In the Manage administrative menu, navigate to Configuration > System > Basic site settings (admin/config/system/site-information).

In this example, after clicking on Manage and Configuration, you would need to find the System section of the page, and within that, click Basic site settings. After that, you'd end up on http://example.com/admin/config/system/site-information.

System section of the Configuration page

One other note: if you are using the standard administrative core Seven theme, many "Add" buttons in the administrative interface are displayed with + signs on them. For instance, on admin/content, the Add new content button appears as + Add new content. However, this is theme-dependent and is not really part of the text on the button (for instance, it would not necessarily be read by a screen reader), so in this guide, the convention is to not mention the + sign on the buttons.

Filling in forms

Many of the task topics in this guide include steps where you will fill out a web form. In most cases, a screen capture image of the form will be included, along with a table of the values you will need to enter into each form field. For example, you might see a table that starts out like this, explaining the site information form you would see if you navigated to Configuration > System > Site information (admin/config/system/site-information):

Field name Explanation Example value
Site details > Site name Name of your site Anytown Farmers Market

To use this table, find the field labeled Site name in the section that is under Site details in the form, and enter the name of your site in this field. An example site name of "Anytown Farmers Market" is suggested in the table, which relates to the scenario of building a website for a farmers market that you'll find all through this guide (see Guiding Scenario for details). Also note that on some forms, you might have to click a section title (like Site details in this example) to expand the section and find the field it contains.

Preface

Guiding Scenario

When reading this guide, it is helpful to have a website building project in mind. The following project scenario provides context and links together the examples in this guide:

You are making a website for a farmers market. The site needs to display information about the location and hours of the market, and an About page with the history of the market. It also needs to list the vendors. Vendors should be able to edit their listings (including a logo or photo), and post recipes. Site visitors should be able to browse recipes, or locate recipes using ingredients that they purchased at the market. Some visitors to your site speak another language, so the main pages and vendor pages need to be translated.

As you read through the guide and try out the tasks it describes, you may choose to follow the scenario exactly; you could also modify the tasks to suit your purposes. If you do want to follow the scenario exactly, you'll find that you need some image files, which are located in the assets directory of the .zip or .tgz file download available on the User Guide project page.

Chapter 1: Understanding Drupal

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 website.

Drupal can also run on other technology stacks:

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:

Additional resources

Chapter 1: Understanding Drupal

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:

You can download additional contributed modules from the Drupal.org Module Downloads, or create your own custom modules.

Additional resources

Drupal.org community documentation page "Module developer's guide"

Chapter 1: Understanding Drupal

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".

Additional resources

Drupal.org community documentation page "Theming Drupal"

Chapter 1: Understanding 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:

Connecting with the Community

Additional resources

Drupal.org Drupal Distribution Downloads

Chapter 1: Understanding Drupal

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:

Chapter 1: Understanding Drupal

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:

Additional resources

Chapter 1: Understanding Drupal

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:

Connecting with the Community

Additional resources

Chapter 2: Planning Your Site

Chapter 2: Planning Your Site

Concept: Regions in a Theme

Prerequisite knowledge

Concept: Themes

What is a region?

Besides its primary content, a web page contains other content such as site branding (site name, slogan, and logo), navigation aids (menus, links, and icons), formatted text, and images. Each theme provides a set of named regions, such as Header, Content, and Sidebar, where site builders may choose to place their content.

The available regions depend on the theme design. Only the Content region, which contains the primary content, is required; others are optional. The core Olivero theme provides the regions highlighted in the following image.

core Olivero theme regions
Chapter 2: Planning Your Site

Planning Your Site Layout

Goal

Plan the navigation and layout of the site, for both mobile and desktop browsers.

Prerequisite knowledge

Steps

It is a good idea to plan the site layout before you start building the site and writing content; however, your plan may need to be revised either before you start implementing it or after you have some of the site built with draft content in place, based on budgetary concerns or stakeholder feedback.

  1. Make a list of the information that your site should present to visitors. In the farmers market scenario, this might include:
    • Location of the market, with directions and a map
    • Hours and days the market is open
    • History of the market
    • List of vendors
    • Details about each vendor
    • Searchable list of recipes
    • Details about each recipe
    • List of the most recently added recipes
  2. Decide which information should be on which pages or types of pages on the site:
    • Information that should be on all pages: Address, hours, and recently-added recipes list
    • Vendor details pages: Information about each vendor on its own page
    • Recipe details pages: Details of each recipe on its own page
    • Home page: Location, map, directions, and hours
    • About page: History of the market
    • Vendors list page: List of vendors, with links to vendor detail pages
    • Recipe list page: Searchable list of recipes, with links to recipe detail pages
  3. Decide which information is the most important on each page. Site visitors using mobile phones or other small browsers will often only see the content that is presented first, and they may not scroll down to see all of the information.
  4. Decide which of these pages should appear in the main site navigation. For instance, the main navigation might consist of the Home, About, Vendors, and Recipes pages.
  5. Make a rough design sketch for each page, showing how it would look when viewed on a small screen such as a phone, as well as on a larger screen such as a desktop browser. Considering that most site visitors will be using smaller browsers, it is a good idea to start with the phone-size layout, to make sure that these visitors will be able to find the information they need without too much scrolling. In making these page layout plans, you might find that you need to revise your plan for which information should be on which pages. For example, you might decide that the address, hours, and recently-added recipes list would all fit well in the right sidebar area of all pages, when the site is viewed on desktop-sized browsers. On the other hand, you might decide that for mobile browsers, you would instead put the address and hours in a short format at the top of each page, but only display the recent recipe list at the bottom of the home page.

Expand your understanding

Planning your Content Structure

Videos

Planning Your Site Layout

Chapter 2: Planning Your Site

Concept: Content Entities and Fields

Prerequisite knowledge

What is a content entity?

A content entity (or more commonly, entity) is an item of content data, which can consist of text, HTML markup, images, attached files, and other data that is intended to be displayed to site visitors. Content entities can be defined by the core software or by modules.

Content entities are grouped into entity types, which have different purposes and are displayed in very different ways on the site. Most entity types are also divided into entity subtypes, which are divisions within an entity type to allow for smaller variations in how the entities are used and displayed. Here is a table of some common content entity types:

Entity type Entity subtype Defining Module Main uses
Content item Content type Node module Content intended to be the main page area for pages on the site

Example: In the farmers market site example, you might have content types for basic pages, vendor pages, and recipe pages.
Comment Comment type Comment module Commentary added to content entities (typically to Content item entities)

Example: On a blog site, blog posts might have comments. They are not needed in the farmers market site example.
User profile (none) User module Data related to a person with a user account (login access) on the site

Example: Every site has at least basic user profiles with user names and email addresses; social networking sites may have more complex user profiles with more information.
Custom block Block type Custom Block module Text and images in smaller chunks, often displayed in the site header,

Example: In the farmers market site example, you might put the hours and location in a sidebar block.
Taxonomy term Vocabulary Taxonomy module Used to classify other types of content

Example: In the farmers market site example, you might classify Recipe content with an Ingredients taxonomy vocabulary, with taxonomy terms like Carrots and Tomatoes. In a blogging site, blog posts might be classified using a Tags vocabulary, and perhaps also a Categories vocabulary.
File (none) File module An image or attachment file that is tracked and managed by the site, often

Example: In the farmers market site example, both Recipe and Vendor pages might have image attachments, which would (behind the scenes) be managed as File entities by the site.
Contact form Form type Contact module A form that lets site visitors contact site owners

Example: A contact form is needed in the farmers market site example.

What is a field?

Within entities, the data is stored in individual fields, each of which holds one type of data, such as formatted or plain text, images or other files, or dates. Field types can be defined by the core software or by modules.

Fields can be added by an administrator on entity subtypes, so that all entities of a given entity subtype have the same collection of fields available. For example, the Vendor content type in the farmers market example might have fields for the vendor name, a logo image, website URL, and description, whereas the Basic page content type might only have fields for the title and page body. When you create or edit entities, you are specifying the values for the fields on the entity.

Chapter 2: Planning Your Site

Concept: Modular Content

Prerequisite knowledge

What is modular content?

Given that the content of your site is stored in a database, it is desirable to make the content modular, meaning that certain pages on your site, rather than being edited as a whole page, are instead generated automatically from other content items. For instance, in the farmers market site scenario, you might create individual content items for recipes. If the recipe content items have a field that keeps track of ingredients, then your site could include a composite page that would list recipes, and allow visitors to search for a recipe that contained some particular ingredient they had bought at the market.

Smaller sections of pages can also be generated as composites. For instance, recipe content items could have a field that keeps track of which vendor submitted the recipe (see Concept: Reference Fields), with the vendor details edited in separate vendor content items. This would allow you to do the following on your site:

The key idea is that each piece of information is only edited in one place. When vendor information is updated, all recipe pages that display that vendor information are automatically updated; when a recipe is submitted by a vendor, it is automatically displayed on the vendor page. The core Views module is the usual way to use modular content to create composite pages and page sections; see Concept: Uses of Views for more information. Also, view modes are useful for defining different ways to display each content item; see Concept: View Modes and Formatters for more information.

Chapter 2: Planning Your Site

Planning your Content Structure

Goal

Make a plan for the content structure of the site (which type and subtype of entity to use for which content), and which pages will contain listings of content.

Prerequisite knowledge

Steps

  1. Brainstorm about what content your site needs to contain, which could include content that visitors would be looking for, as well as content that you want to show to visitors. The result could be the description in Guiding Scenario.

  2. For each identified piece of content, decide which content entity type would be the best fit. In doing this, you'll need to consider where and how the content will be used and edited on the site. For example, in the farmers market site scenario, you might want to display the hours and location of the farmers market on the sidebar of every page. For that content, a single custom block makes sense. As another example, you might decide that pages displaying information about each vendor should be content items managed by the core Node module, because you want vendors to be able to edit their own listings. The core Node module permission system lets you do this easily. These decisions do not necessarily always have only one right answer; for instance, you could decide that vendor pages should be user profiles instead of content items, but if you did that the content would be tied to a specific user account, and it would not be as easy to later change the ownership of a vendor page to a different user account.

  3. Within each content entity type you identified, decide what division into entity subtypes would make sense. For example, in the farmers market site example, you would probably decide that under the Content item entity type, there should be one content type for basic pages (Home and About), one for vendor pages, and one for recipe pages.

  4. For each entity subtype you decided on, decide what fields are needed. For instance, the Vendor content type might need fields for the vendor name, web page URL, image, and description.

  5. Decide on what entity listings are needed, which could be entire pages or smaller areas on the page. For each listing, you'll need to determine which entities should be listed. Then you'll need to decide in what order and with what filtering options they should be displayed; for example, you might want to give the site visitor the option to search by keyword, to filter the list down to a subset, or to sort the list. You'll also need to decide what information from the entities should be shown, which might result in adding to the list of fields you determined in the previous step. The farmers market site, for example, needs to have a Recipes listing page that lists content items of type Recipe, with the ability to filter by ingredients, so that means that the Recipe content type needs an Ingredients field.

  6. For each identified field on each entity subtype, identify what type of data it should contain (such as plain text, formatted text, a date, an image file, etc.), and how many values should be allowed. Most fields are single-valued, but for example, a Recipe should allow for multiple values in its Ingredients field.

  7. Consider which fields would be best as references to taxonomy term entities: fields whose values should be chosen from a list of allowed values. Allowed values that are expected to change and grow over time, are good candidates. An example is the Ingredients field for the Recipe content type.

  8. Consider which fields should reference other content entities. An example is that since vendors will be submitting recipes, a field will be needed on the Recipe content type that references the Vendor content item for the vendor who submitted the recipe.

    Here's an example of the resulting content structure for the farmers market scenario example site:

    Entity type Entity subtype Examples Fields
    Content item Basic page Home page, about page Title, page body
    Content item Vendor A page for each vendor at the market
    Content item Recipe A page for each submitted recipe
    Custom block (generic) Copyright notice for footer, Hours and location for sidebar No special fields
    Taxonomy term Ingredients Carrots, tomatoes, and other recipe ingredients
    Contact form (generic) Generic contact form Name, email, subject, message
    User profile (none) Will not be displayed on site No special fields

    And here are the listings the site needs:

    Page or page area Entity type and subtype Filter/sort/pagination
    Vendors page Vendor content items All vendors, alphabetical, paged
    Recipes page Recipe content items Filter by ingredients, alphabetical, paged Image, recipe name
    Recent recipes sidebar Recipe content items List 5 most recent

Expand your understanding

Concept: Taxonomy

Videos

Planning Your Content Structure

Chapter 2: Planning Your Site

Concept: Editorial Workflow

Prerequisite knowledge

What is an editorial workflow?

An editorial workflow is the process organizations follow to create, review, edit, and publish content. Multiple people in different roles in the organization can be part of the process. For example, content creators could collect information and write content; editors could review, edit, ask for changes, and publish the content once it's ready to be shared with the audience. Later on, content revisions could go through a simple process for small changes, or a more complex process with reviews for larger changes.

What tools are available for managing workflows?

Chapter 2: Planning Your Site

Concept: User Interface, Configuration, and Content translation

Prerequisite knowledge

What languages does the software support?

The base language for the software that your site runs (core software, modules, and themes) is English. However, using this software you can create a site whose default language is not English, in which case anyone viewing the site should see only that language (assuming that the site is fully translated). You can also use this software to create a multi-lingual site, with a language switcher that site visitors can use to switch to their preferred language. You need to have the core Language module installed in order to use a language other than English on the site.

What can be translated on your site?

There are three types of information that you can translate, each with its own method for translating:

What information will remain in English on my site?

Even if the default language of your site is not English, you will still see English text on certain administrative pages used to manage configuration. The reason is that when you edit configuration, you are editing the base, untranslated configuration values; translating configuration is a separate operation. For example, if you visit the Menus administration page, you will see menu names in English (for the menus that were set up when you installed your site), and if you click an Edit menu link, you will be editing the English name and description of the menu. To edit the menu name in a different language, you would need to have the core Configuration Translation module installed, and use the Translate link to edit the translated menu information.

Chapter 3: Installation

Chapter 3: Installation

Preparing to Install

Goal

Outline the steps to download the core software, and handle any required prerequisites.

Prerequisite knowledge

Site prerequisites

Server software must be installed on the computer where you plan to host your site. See Concept: Server Requirements for a list of requirements.

See Setting Up an Environment with DDEV for the recommended way to get started running the software locally.

Depending on how you plan to download the core software, you may need to install additional software tools first. See Concept: Methods for Downloading and Installing the Core Software and Concept: Additional Tools.

Steps

  1. Choose methods for downloading and installing the core software, from those listed in Concept: Methods for Downloading and Installing the Core Software. The rest of these instructions apply to the Composer and manual download options; if you chose other options, like a one-click installer from a hosting provider, consult the relevant documentation for any additional steps.
  2. Set up a URL and hosting for your site on the server. Verify that the hosting is working by putting a simple HTML file in the web root directory of the hosting, and visiting the URL for your site.
  3. Create a database, along with a database user account with full access.
  4. Download the core software files to the web root directory, using the method you decided on. See Concept: Methods for Downloading and Installing the Core Software for links to instructions.

Expand your understanding

See Running the Interactive Installer to run the interactive installer.

Videos

Preparing to Install

Additional resources

Drush

Chapter 3: Installation

Concept: Server Requirements

What are the requirements for running the core software?

Disk space

The total amount of disk space needed for your site is not a fixed amount, as it depends on your site. The base files for the core software take up about 100 MB on the web server. You will need more space if you install additional modules or themes, and you'll also need space for media, backups, and other files generated by and uploaded to your site. The database also uses disk space, although that is typically not in the same area (and in some cases, not even on the same server) as that used by the site files.

PHP

PHP 8.3 or a higher PHP 8 version. PHP must be set up with a minimum memory size of 64MB; if you are running multiple modules on your site or using memory-intensive PHP-based command-line tools (such as Composer), considerably more memory than that may be needed.

Certain PHP extensions are also required; the exact list of required PHP extensions depends on how you install the core software and which modules you are using on your site. Generally, hosting service providers have installed all the PHP extensions you will need. If you are self-hosting or running your site on your local computer, you will get error messages during installation if any required PHP extensions are missing, and should be able to install them and continue. See PHP requirements for a complete list of requirements.

Web server

Database

Use one of the following databases:

Additional resources

Chapter 3: Installation

Concept: Additional Tools

What tools are available for site builders?

There are several additional tools available that help you create sites faster, more accurately and with less effort.

What are command-line tools?

Command-line tools provide an alternative to using the administrative interface for various operations on your site. Many site builders and maintainers have invested the time to install and learn a command-line tool, because:

To use these tools, you will need to have command-line terminal access to the environment where your website will be hosted, and you will need to install Composer first in order to install Drush.

To install Drush first make sure your project is using Composer to manage dependencies. See below for more about Composer. Then use the following commands:

# Install Drush
composer require drush/drush

What is a version control system?

A version control system is software that keeps copies of files and revision history in a repository, and allows you to add, delete, and update files. For a web site project, revision control software can help you:

There are many proprietary and open-source version control systems to choose from; a popular choice is Git, which is open-source software that runs on most computer platforms. Git is a distributed version control system that allows you to have one or more copies of your repository, which allows you to commit changes to a copy and then only push them to the repository you've designated as canonical when you're ready to share them with others. The canonical git repository can be hosted on your local computer or a server at your company, but many software projects and individuals host their Git repositories using third-party services provided by GitLab or GitHub.

What is Composer used for?

Composer is a tool for managing PHP dependencies, where the developer specifies what version of each external library is needed, and Composer manages the process of downloading and installing the libraries.

Composer can be installed on the local development environment or webserver but is often already available in Drupal development tool kits.

The core software is a primary user of Composer, because it makes use of several externally-developed software libraries, which must be downloaded and installed in order for the core software to work. When you install the core software, you either need to download an archive that contains compatible versions of the external libraries, or you need to run Composer to download the external libraries after the initial download. The Drush command-line tool is also downloaded using Composer.

Some contributed modules also make use of externally-developed software libraries; for example, a Facebook integration module might require Facebook's integration library to be installed for the module to work, and a geographical module might make use of a standard library of geographical functions. To install a module with external dependencies, you will need to run Composer.

What tools are available for module and theme developers?

In addition to the site builder tools mentioned above, the following tools are useful for module and theme developers.

Using Composer to Download and Update Files

Additional resources

Chapter 3: Installation

Concept: Methods for Downloading and Installing the Core Software

Prerequisite knowledge

What methods are available for downloading the core software?

Before you can build a site, you will need to first download the core software. Depending on your plans, there are several ways that you can download the core software:

What happens when I install the core software?

Installing the core software means setting up some database tables, configuration, and an administrative user account, so that you can build and use your site.

What methods are available for installing the core software?

There are several ways to install the core software:

  php -d memory_limit=256M core/scripts/drupal quick-start demo_umami
Chapter 3: Installation

Setting Up an Environment with DDEV

Goal

Set up a local development environment using DDEV to serve the application and Composer to download the required files.

Prerequisite knowledge

Concept: Server Requirements Using Composer to Download and Update Files

Why use DDEV?

DDEV is a local development environment for PHP applications built on Docker. It includes all the necessary components to run the core software, and is used by many developers in the Drupal community.

Steps

  1. Follow the official DDEV installation instructions to install DDEV on your local machine. DDEV is available for Windows, Mac, and Linux. The installation process is different for each operating system, so be sure to follow the instructions for your OS.
  2. After installing DDEV, follow the Drupal Quickstart instructions to download the core software using Composer and install it in the DDEV environment.
  3. Run the command ddev launch from the directory created in the previous step to open the site in your web browser and confirm the environment is working correctly.

Additional resources

Chapter 3: Installation

Using Composer to Download and Update Files

Goal

Use Composer to download or update files and dependencies in the core software, or in add-on modules and themes.

Prerequisite knowledge

Concept: Additional Tools

Site prerequisites

If you want to use Composer, it must be installed either on a local development server or your live site. See Concept: Additional Tools.

Steps

If you are unable to install the Composer tool on your live server, you can follow the steps in any of the sections below on your local server, and then transfer any updated or added files to your live server. The recommended procedure is to make an archive or zip file of the new and changed directories, transfer the archive to your live server, delete the directories that have changed, and extract the archive. Make sure to check for updates and additions to the following files, in the root of your installation:

Using Composer to download the core software

Follow these steps if you have not yet downloaded or installed the core software, and you want to use Composer to download both the core software and its external dependencies:

  1. At the command line, change to one level above the directory where you want the software to reside.
  2. Enter this command, where mydir is the directory you want to create:
    composer create-project drupal/recommended-project mydir
    
  3. The latest release of the core software will be downloaded to the mydir/web sub-directory.

Using Composer to download a module or theme

Follow these steps if you are already using Composer to manage the core software, and you want to use Composer to add a contributed module or theme with its dependencies.

  1. Each time you want to add a contributed module or theme, determine the project's short name. This is the last part of the URL of the project page; for example, the Geofield module, at https://www.drupal.org/project/geofield, has short name geofield.
  2. To download the contributed module or theme, along with its external dependencies, enter the following command at the root of your site (substituting the short name of the module or theme for geofield):
    composer require drupal/geofield
    

Using Composer to update previously-downloaded files

Follow these steps to update the files for the core software or a contributed module or theme, after having already started to manage dependencies with Composer:

  1. Determine the short name of the project you want to update. For the core software, it is core. For contributed modules and themes, it is the last part of the URL of the project page; for example, the Geofield module, at https://www.drupal.org/project/geofield, has short name geofield.
  2. If you want to update to the latest stable release, use the following command, substituting the short name of the project to be updated for geofield:
    composer update drupal/geofield --with-dependencies
    
  3. If you need a specific version, determine how to enter the version number you want to update to. For example, for version 8.x-1.16 of a contributed module, you would enter just the 1.16, and for the core software version 9.0.7, you would enter 9.0.7. Then enter the following command at the root of your site (substituting the short name of the project for geofield and the correct version number):
    composer require drupal/geofield:1.16
    

Expand your understanding

You can learn more about Composer commands by using Composer's built-in help system. For example, to learn more about the create-project command, enter composer help create-project in your command window.

Videos

Using Composer and Git to Download Files

Additional resources

Chapter 3: Installation

Running the Interactive Installer

Goal

Install the core software and create the admin account by running the included installer.

Site prerequisites

Preparing to Install

Note that if you followed the instructions in Setting Up an Environment with DDEV the core software was already installed. If you wish to install the core software again, you can run the command ddev drush sql:drop and then follow the instructions below.

Steps

  1. If you are using a 1-click install from a hosting provider or demo site, you will most likely see some or all of the following screens as part of the installation process. If you uploaded the core files manually or using Composer, to start the installer, open a browser and visit the URL that you set up for your hosting.

  2. Select a language on the first page of the installer; for example, English. You could optionally choose from any of the other listed languages. The language files for the chosen language will be downloaded and installed so that the rest of the installation process can be finished in the chosen language. After choosing a language, click Save and continue. Choose a language

  3. Select an installation profile. Installation profiles 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. Core contains two installation profiles. Select the core Standard installation profile. Click Save and continue. Choose an installation profile

  4. The next step in the installer will verify that your system meets the minimum requirements. If it does not, you'll be presented with an outline of what needs to be corrected in order to proceed. If it does, the installer will automatically advance to the next step.

  5. Provide details of the database you created in the Preparing to Install chapter. Then click Save and continue.

    Field name Explanation Value
    Database name The custom name given to the database drupal
    Database username Username created databaseUsername
    Database password Password chosen ************
    Database configuration form
  6. The next step will display a progress bar under the heading Installing Drupal. After the installer has completed, it will automatically advance to the next step. Installation progress bar

  7. The next step is to configure some basic information about your new site (also notice if there is a warning about file permissions, for a later step). Note that the user account you create in this step is the site's admin account. See Concept: The User 1 Account for important information about this unique account. You can safely name this account "admin", and make sure to choose a secure and unique password. Fill in the form with the following information:

    Field name Explanation Value
    Site name The name chosen for the site Anytown Farmers Market
    Site email address The email associated with the site info@example.com
    Username The designated user's credentials admin
    Password The password chosen ************
    Confirm password Repeat the password ************
    Email address The user's email admin@example.com

    The remaining fields can likely be left at their default values. Configuration form

  8. Click Save and continue.

  9. You will be redirected to the front page of your new site and you should see the message Congratulations, you installed Drupal! displayed at the top of the page. Installation success

  10. You may have seen a warning in the Configuration step about file permissions, and you may continue to see this warning until you fix the permissions. To avoid the warning and make your site more secure, change the permissions on the sites/default directory and the sites/default/settings.php file so that they are read-only (you may need to consult your hosting company documentation about how to do that).

Expand your understanding

Alternatively, you can install the software using Drush instead of the UI. Use the following Drush command, from inside the directory that you downloaded the software to, where DB_NAME, DB_USER and DB_PASS are your database's credentials:

drush site:install standard --db-url='mysql://DB_USER:DB_PASS@localhost/DB_NAME' --site-name=example

Check the Status Report to see if there are any problems with the installation. See Concept: Status Report.

Videos

Running the Installer

Additional resources

Chapter 4: Basic Site Configuration

Chapter 4: Basic Site Configuration

Concept: Administrative Overview

Prerequisite knowledge

What is the administrative menu?

The toolbar provided by the core Toolbar module displays the Manage administrative menu at the top or left side of the site, for users with permission to see it. This menu provides access to all of the administrative areas of the site. The menu links will vary depending on which modules are active on your site and the permissions of the person viewing the menu; if you install using the core Standard installation profile and have full administrative permissions, the top-level links are as follows:

Administrative menu in horizontal mode

The arrow button on the far right side of the second line of the toolbar (or far left side, if the site is being viewed using a right-to-left-reading language like Arabic) can be used to switch the menu from appearing horizontally at the top of the page, to a vertical format on the left side (or right side, in right-to-left languages). When viewed vertically, the menu becomes an interactive tree.

Administrative menu in vertical mode

This guide has a standard way to describe navigation to administrative pages using the administrative toolbar. See Conventions of the Guide for more information.

What are contextual links?

Some administrative and editing functionality on the site can be accessed through the contextual links displayed by the core Contextual Links module. Contextual links take you to some of the same pages that you can access through the administrative menu, but instead of having to navigate through the menu hierarchy, these links are provided near where the related content is displayed on your site.

Chapter 4: Basic Site Configuration

Editing Basic Site Information

Goal

Change basic site information such as Site name, Slogan, Default time zone.

Prerequisite knowledge

Concept: Administrative Overview

Steps

Configuring the basic site information

  1. In the Manage administrative menu, navigate to Configuration > System > Basic site settings (admin/config/system/site-information) to change the Site name, Slogan, administrative Email address, or the Default front page path.

  2. Fill in the available fields as appropriate for your site.

    Field name Explanation Example value
    Site details > Site name Used to identify the site and displayed in browsers Anytown Farmers Market
    Site details > Slogan How this is used depends on your site's theme. Not displayed by default when using the Olivero theme. Farm Fresh Food
    Site details > Email address Used as _From_ address in automated email messages (registrations, password resets, etc) info@example.com

    Site Information

  3. After editing the fields, click Save configuration to see the changes applied to the site.

Configuring default Regional settings

  1. In the Manage administrative menu, navigate to Configuration > Regional and language > Regional settings (admin/config/regional/settings).

  2. Fill in the form as follows:

    Field name Explanation Example value
    Locale > Default country The primary country for your site United States
    Locale > First day of week The day when the week starts on calendars Sunday
    Time zones > Default time zone The primary time zone for your site America > Los Angeles
    Time zones > Users may set their own time zone Whether logged-in users can choose a different time zone for display of dates and times on the site Unchecked

    Time Zones

  3. After editing the fields, click Save configuration to see the changes applied to the site.

Videos

Editing Basic Site Information

Additional resources

Drupal.org community documentation page "Getting started with Drupal administration"

Chapter 4: Basic Site Configuration

Installing a Module

Goal

Install a core module, or a contributed module whose files have already been uploaded to the site, through the administrative interface or using Drush.

Prerequisite knowledge

Concept: Modules Using Composer to Download and Update Files

Site prerequisites

If you want to use Drush to install modules, Drush must be installed. See Concept: Additional Tools.

Steps

You can use the administrative interface or Drush to install modules.

Contributed modules are not included with the core software must first be downloaded using Composer. See Using Composer to Download and Update Files for more information.

Using the administrative interface

  1. In the Manage administrative menu, navigate to Extend (admin/modules). The Extend page appears showing all the available modules in your site.
  2. Check the boxes for the module or modules you want to install. For example, check the box for the core Ban module. Enabling the core Ban module
  3. Click Install. The checked modules will be installed.

Using Drush

  1. In the Manage administrative menu, navigate to Extend (admin/modules). The Extend page appears showing all the available modules in your site.
  2. Find the machine name of the module you want to install, by expanding the information area for the module. For instance, the core Ban module's machine name is ban.
  3. Run the following Drush command to install the module:
    drush pm:enable ban
    

Expand your understanding

If you do not see the effect of these changes in your site, you might need to clear the cache. See Clearing the Cache.

Videos

Installing a Module

Additional resources

Drush

Chapter 4: Basic Site Configuration

Uninstalling Unused Modules

Goal

Uninstall the core Search and History modules, as well as the core Ban module if you installed it in Installing a Module, to reduce overhead.

Prerequisite knowledge

Concept: Modules

Site prerequisites

Steps

You can use the administrative interface or Drush to uninstall modules.

Using the administrative interface

  1. In the Manage administrative menu, navigate to Extend > Uninstall (admin/modules/uninstall) where you will find the list of modules that are ready to be uninstalled.
  2. Check the boxes for the modules you are uninstalling (Ban, History, and Search). Click Uninstall at the bottom of the page. Uninstalling module
Chapter 4: Basic Site Configuration

Configuring User Account Settings

Goal

Turn off the ability for people to register user accounts on the site. Also, review and/or edit the email messages generated by the site for events related to user accounts.

Prerequisite knowledge

Concept: Administrative Overview

Steps

  1. In the Manage administrative menu, navigate to Configuration > People > Account settings (admin/config/people/accounts).
  2. Under Registration and cancellation, select Administrators only as the people with permissions to register user accounts. You can check Require email verification when a visitor creates an account in case you want to change the settings for account registration later on. Account registration only by admin
  3. Optionally, change the default email address from which user account notifications from the farmers market website will be sent. This will help you maintain a separate email address from the one used for the website in general. For example, this email address for user account notifications will be useful for a staff member(s) communicating with vendors. Notification email from address
  4. Optionally, edit the email templates under Emails to customize automated emails. There are several email templates provided by the core software. They are meant for different user-specific occasions. All of them can be personalized and three can be disabled via checkboxes: activation, blocking, and cancellation. You can send out your own text (for example, welcoming the new vendors for whom accounts were just created) by editing the Welcome (new user created by administrator) template. Email notification on account events
  5. Click Save configuration to save the changes.

Expand your understanding

See Drupal User Guide for more information about user accounts and permissions.

Videos

Configuring User Account Settings

Additional resources

Securing your site can help you with a more safety-focused approach to configuration.

Chapter 4: Basic Site Configuration

Configuring the Theme

Goal

Edit the settings of the default core Olivero theme to change the color scheme and to add a logo.

Prerequisite knowledge

Concept: Themes

Steps

  1. In the Manage administrative menu, navigate to Appearance (admin/appearance).

  2. Under Installed themes, you will find Olivero listed as your default theme. Under Olivero (default theme), click Settings. Default theme, Olivero

  3. Under Logo image, uncheck Use the logo supplied by the theme. New logo in core Olivero theme settings

  4. Under Upload logo image, locate a logo file and upload it to your site. Note: You can also set a universal logo for all themes under Appearance > Settings (admin/appearance/settings). A custom logo for your theme will override the universal logo. Once you have selected the file you would like to upload, you will see its filename next to the Choose File or Browse button in your browser.

  5. Under Olivero Utilities, you can choose to use a different color scheme for the theme. You can choose from a list of existing color scheme's, or enter a color and the core software will generate a new scheme based on that color.

    For example, use the following custom color:

    Field Color
    Primary base color #7db84a (green)

    Note: You can also use a color picker by pressing the colored square on the right to select a color of your choice. The web color codes will be added for you.

  6. In order to save your changes and see the updated colors and logo on your site, click Save configuration at the bottom of the page.

  7. Click Return to site or Home in the toolbar to verify that you have updated the core Olivero theme settings for your website. Final result of editing the core Olivero theme settings - colors and logo

Expand your understanding

Videos

Configuring the Theme

Chapter 5: Basic Page Management

Chapter 5: Basic Page Management

Concept: Paths, Aliases, and URLs

What is a URL?

URL is the abbreviation for "Uniform Resource Locator", which is the page's address on the web. It is the "name" by which a browser identifies a page to display. In the example "Visit us at example.com.", example.com is the URL for the home page of your website. Users use URLs to locate content on the web.

What is a Path?

A path is the unique, last part of the URL for a specific function or piece of content. For example, for a page whose full URL is http://example.com/node/7, the path is node/7.

Here are some examples of paths you might find in your site:

What is an Alias?

The core software has a feature called "URL Alias" that allows you to provide a more understandable name to the content. So, if you have an "About Us" page with the path node/7, you can set up an alias so that your visitors will see it as http://www.example.com/AboutUs. The core Path module, which supports URL aliasing, provides this functionality.

Chapter 5: Basic Page Management

Creating a Content Item

Goal

Create and publish a content item that will be used as the home page of the site.

Prerequisite knowledge

Site prerequisites

The Basic page content type must exist. This is created on your site when you install with the core Standard installation profile.

Steps

  1. In the Manage administrative menu, navigate to Content > Add content > Basic page (node/add/page). The Create Basic page form appears.

  2. Click Edit summary.

  3. Fill in the fields as shown below.

    Field name Explanation Value
    Title Title of the page. Will also be used as a meta tag in the source code, URL alias, and as label of the content item in administration screens Home Summary Summary of the value of the body field. Can be used as teaser
    Body Full content of the page Welcome to City Market - your neighborhood
    Published Whether the content is published for public view or not Checked
    URL alias > URL alias Alternate relative path for the content /home

    By clicking the Source button in the rich text editor toolbar, you can see the HTML source code of the text that you are editing. Create a basic page

  4. Click Preview to ensure everything looks like expected.

  5. Click Back to content editing.

  6. Click Save. The content is saved and can be found on the Content page.

  7. Follow the same steps to create an About page, with title "About", and a body telling about the history of the farmer's market.

Expand your understanding

Videos

Creating a Content Item

Additional resources

Drupal.org community documentation page "About nodes"

Chapter 5: Basic Page Management

Editing a Content Item

Goal

Update the hours on the Home page content item.

Prerequisite knowledge

Creating a Content Item

Site prerequisites

A content item for the Home page must exist. See Creating a Content Item.

Steps

  1. In the Manage administrative menu, navigate to Content (admin/content).
  2. If the content item you want to edit was updated or created recently, it should appear near the top of the content list on that page. If not, you can use the Content type, Title, or other filters to locate the content item. Content administration page
  3. Click Edit in the row of the content item you want to edit (Home), to open the content editing form. Update the opening hours in the Body field. See Creating a Content Item for an explanation of the fields and a screenshot.
  4. Check Create new revision under Published, if it is not already checked, and enter a Revision log message explaining what changes you are making (for example, you might enter "Updated opening hours"). This text will appear in the revision log for the page. Revision information section of the content edit page
  5. Click Save to save your changes.
  6. You will be redirected back to the Content administrative page, and there should be a message showing that the content item was updated. Updated content message

Expand your understanding

As an alternative to the first two steps above, you can also reach the content edit form as follows:

  1. Starting from your site's home page, use the site's navigation menus to locate the page where the content you want to edit is displayed to visitors.
  2. Most themes will display an Edit link or tab near the top of that page to people with permission to edit the page; clicking the link will take you to the full content edit form.

Videos

Editing a Content Item

Chapter 5: Basic Page Management

Designating a Front Page for your Site

Goal

Configure which content item is displayed as the front page of your website.

Site prerequisites

The content item that you want to designate as the front page of your site must exist. See Creating a Content Item.

Steps

  1. In the Manage administrative menu, navigate to Configuration > System > Basic site settings (admin/config/system/site-information).
  2. Under Front page, replace /node with the name of the page you would like to make the home page. To use the home page that was previously created, provide its path /home. Click Save configuration. 'FRONT PAGE' area with /home in text field
  3. Navigate to the home page to verify that it displays content as configured by you. 'FRONT PAGE' with 'Home' (Basic page) content added

Expand your understanding

Concept: Menu

Videos

Designating a Front Page for Your Site

Chapter 5: Basic Page Management

Concept: Menu

What is a menu?

Menus are a collection of links used to navigate a website. The core Menu UI module provides an interface to control and customize the menu system. Menus are primarily displayed as a hierarchical list of links. By default, new menu links are placed inside a built-in menu labeled Main navigation, but administrators can also create custom menus.

The core Standard installation profile contains five menus:

You can customize menus in the following ways, using the menu administration functionality:

Chapter 5: Basic Page Management

Adding a Page to the Navigation

Goal

Add a page to the navigation. For example, the About page.

Prerequisite knowledge

Site prerequisites

The About page content item must exist. See Creating a Content Item.

Steps

  1. In the Manage administrative menu, navigate to Content (admin/content).

  2. Find the About page, and click Edit in that row. The content editing form appears. Page edit link

  3. Click Menu settings on the right to expand it.

  4. Check Provide a menu link for the menu options to appear.

  5. Enter values from the table below:

    Field name Explanation Example value
    Menu link title Title that will be displayed in the menu About
    Description Text that will be displayed when a visitor hovers over the link History of the market
    Parent link Location of the page in the menu hierarchy. For example, if you choose _<Main navigation>_, the page will appear in the highest level of the navigation. By choosing another menu link as parent, you can create a menu hierarchy of multiple levels. <Main navigation> Weight The order in which the page should appear in the menu (lower-weighted

    Creating a menu link from within the content edit form

  6. Click Save to save the changes. Click Home or Return to site in the navigation bar to see the result, which could look like the picture below. Link has been added to the main menu

Expand your understanding

Changing the Order of Navigation

Videos

Adding a Page to the Navigation

Additional resources

Drupal.org community documentation page "Adding a link to a menu"

Chapter 5: Basic Page Management

Changing the Order of Navigation

Goal

Prerequisite knowledge

Site prerequisites

Home and About pages must exist in the main navigation menu. See Adding a Page to the Navigation.

Steps

  1. In the Manage administrative menu, navigate to Structure > Menus (admin/structure/menu) where all menus on your site are listed. Click Edit Menu from the Operations dropdown for Main navigation. You can also reach this page using contextual links (refer to Concept: Administrative Overview) for the menu. Note that the names and descriptions of the menus that were provided by your installation profile are shown in English on this page; see Concept: User Interface, Configuration, and Content translation for an explanation. List of menus on the site with 'Main navigation' highlighted
  2. The Edit menu page will display a list of each link in the menu you chose (Main navigation). List of menu links under Main navigation
  3. Drag the cross bar handles of menu links to change their order: Home, then About. As an alternative to dragging, you can click the Show row weights link at the top of the table and select numerical weights (menu links with lower or more negative weights will be shown first). Reordered menu links with warning message about unsaved changes and the Save button
  4. Click Save.
  5. The home page now displays the main navigation with the Home menu link displayed first. Reordered menu links on the home page with 'Home' first and then 'About'

Expand your understanding

Concept: Menu

Videos

Changing the Order of Navigation

Chapter 6: Setting Up Content Structure

Chapter 6: Setting Up Content Structure

Adding a Content Type

Goal

Add and configure a new content type Vendor.

Prerequisite knowledge

Concept: Content Entities and Fields

Site prerequisites

You need to have a plan in place for your content structure. See Planning your Content Structure.

Steps

  1. In the Manage administrative menu, navigate to Structure > Content types (admin/structure/types). The Content types page appears showing all the available types of content. Note that the names and descriptions of the content types that were provided by your installation profile are shown in English on this page; see Concept: User Interface, Configuration, and Content translation for an explanation.

  2. Click Add content type. The Add content type page appears. Fill in the fields as shown below.

    Field name Explanation Example value
    Name Name of the content type Vendor
    Description Explain the use of the content type Information about a vendor

    Adding a Content type

  3. Under Submission form settings, configure the form that is used for creating and editing content of this type. Fill in the fields as shown below.

    Field name Explanation Example value
    Title field label Label of the Title field that is shown when editing or creating content of this type. Vendor name
    Preview before submitting Option to choose whether you should preview the content before submitting. Optional
    Explanation or submission guidelines Instructions for creating or editing content. (Leave blank)

    Submission form settings

  4. Under Publishing options, decide on default options for new content of this type. Fill in the fields as shown below.

    Field name Explanation Example value
    Published Make the content item published by default. Checked
    Promoted to front page In a default website, this setting can be used to show content on the homepage. Unchecked
    Sticky at top of lists In a default website, this setting can be used to keep content on top of a list. Unchecked
    Create new revision Create a new revision each time the vendor is being edited. Checked

    Changing these settings does not affect the content items that have already been created. Publishing Options

  5. Under Display settings, decide if the author and publication date will be visible in the content item. Fill in the fields as shown below.

    Field name Explanation Example value
    Display author and date information Display the author username and publication date on each vendor page. Unchecked

    Display settings

  6. Under Menu settings, fill in the fields as shown below.

    Field name Explanation Example value
    Available menus Menus that this type of content can be added to. Vendors do not need to appear in menus, so uncheck all menu options. Unchecked

    Menu settings

  7. Click Save and manage fields to save the content type. The Manage fields page appears that allows you to add fields to the content type. See Adding Basic Fields to a Content Type Confirmation

  8. Follow the same steps to create a content type for recipes. Example values for the fields in the forms, where they are different from the steps above:

    Field name Example value
    Name Recipe
    Description A recipe submitted by a vendor
    Submission form settings - Title Recipe name

Expand your understanding

Videos

Adding a Content Type

Chapter 6: Setting Up Content Structure

Deleting a Content Type

Goal

Delete the unneeded content type Article.

Prerequisite knowledge

Concept: Administrative Overview

Site prerequisites

The Article content type must exist. It is created on your site when you install with the core Standard installation profile.

Steps

  1. In the Manage administrative menu, navigate to Structure > Content types (admin/structure/types). The Content types page appears.
  2. Click Delete in the Operations dropdown button for the Article content type. Note that the name of this content type is in English on this page; see Concept: User Interface, Configuration, and Content translation for an explanation. Article delete dropdown
  3. A confirmation page is displayed. Click Delete. Article delete confirmation page
  4. The Content types page appears with a confirmation message saying that the content type has been deleted: Article delete confirmation message

Videos

Deleting a Content Type

Chapter 6: Setting Up Content Structure

Adding Basic Fields to a Content Type

Goal

Prerequisite knowledge

Concept: Content Entities and Fields

Site prerequisites

The Vendor content type must exist. See Adding a Content Type.

Steps

Add the fields Vendor URL and Main image to the Vendor content type.

  1. In the Manage administrative menu, navigate to Structure > Content types (admin/structure/types). Then click Manage fields in the dropdown button for the Vendor content type. The Manage fields page appears. From here you can either create a new field for the content type or re-use an existing field. Note that the names and descriptions of the content types and fields that were provided by your installation profile are shown in English on these pages; see Concept: User Interface, Configuration, and Content translation for an explanation.

  2. Click Create a new field. The Add field page appears. Add field page to choose field type

  3. Choose the Link field type from the Choose a field type options. Click Continue. The Add field page appears with a form to configure the field label.

  4. Fill in the fields as shown below.

    Field name Explanation Value
    Label Label that is visible in administration pages Vendor URL
    Choose a type of field Field type Link

    A machine name is automatically generated, based on the Label value. Click Edit if you want to override the default name. Add field page to set field label

  5. Click _Continue. The page Vendor URL settings for Vendor appears which allows you to configure the field. Fill in the fields as shown below.

    Field name Explanation Value
    Label Label that is visible in the content form Vendor URL
    Allowed number of values The number of values that can be entered Limited, 1
    Help text The instruction that is shown below the field (leave blank)
    Required field Whether the field is required or not Unchecked
    Allowed link type The kind of links that can be entered External links only
    Allow link text Whether a link text can be entered Disabled
    Field settings page for Vendor URL
  6. Click Save settings. The Vendor URL has been added to the content type. Continue creating the Main image field.

  7. Click Create a new field. The Add field page appears.

  8. Choose the File upload field type from the Choose a field type options. Click Continue. The Add field page appears with a form to configure the field label.

  9. Some field types require the selection of a sub-type. Fill in the fields as shown below.

    Field name Explanation Value
    Label Label that is visible in administration pages Main image
    Choose an option below Field sub-type Image
  10. Click Continue. The page Main image settings for Vendor appears. Fill in the fields as shown below.

    Field name Explanation Value
    Label Label that is visible in the content form Main image
    Allowed number of values The number of values that can be entered Limited, 1
    Default image You can set a default image here. This will be used when you do not provide an image when creating a Vendor content item. (leave blank) Help text The instruction that is shown below the field (leave blank)
    Required field Whether the field is required or not Checked
    Allowed file extensions The type of images that can be uploaded png, gif, jpg, jpeg
    File directory The directory where the files will be stored. By providing a file directory value, you ensure that all images uploaded via the Main image field will be located in the same directory. vendors
    Minimum image dimensions The minimum dimensions of the uploaded image 600 x 600
    Maximum upload size The maximum file size of the uploaded image 5 MB
    Enable Alt field Whether an alternative text can be entered Checked
    Alt field required Whether an alternative text is required Checked
    Field settings page for Main Image
  11. Click Save settings. Main image has been added to the content type. Manage fields page

  12. Add a Main image field to the Recipe content type, using similar steps. Start by navigating to the Recipe content type's Manage Fields page. Then use the Re-use an existing field button to open the modal dialog and press the Re-use button that corresponds with the Main image field in the table. Then skip to step 7 and follow the remaining steps. Select a field to re-use

  13. Create two Vendor content items (see Creating a Content Item) called "Happy Farm" and "Sweet Honey". Make sure that they include images and URLs.

Expand your understanding

Videos

Adding Basic Fields to a Content Type

Additional resources

Drupal.org community documentation page "Add a field to a content type"

Chapter 6: Setting Up Content Structure

Concept: Reference Fields

Prerequisite knowledge

Concept: Content Entities and Fields

What is a reference field?

A reference field is a field that represents a relationship between an entity and one or more other entities, which may belong to the same or different entity type. The three most commonly-used reference fields are:

Concept: Taxonomy

Chapter 6: Setting Up Content Structure

Concept: Taxonomy

Prerequisite knowledge

What is Taxonomy?

Taxonomy is used to classify website content. One common example of taxonomy is the tags used to classify or categorize posts in a blog website; the farmers market website could use an ingredients taxonomy to classify recipes. Individual taxonomy entities are known as terms (the blog tags or recipe ingredients in these examples); and a set of terms is known as a vocabulary (the set of all blog post tags, or the set of all recipe ingredients in these examples). Technically, taxonomy terms are an entity type and the entity subtypes are the vocabularies. Like other entities, taxonomy terms can have fields attached; for instance, you could set up an image field to contain an icon for each term.

An individual vocabulary can organize its terms in a hierarchy, or it could be flat. For example, blog tags normally have a flat structure, while a recipe ingredients vocabulary could be hierarchical (for example, tomatoes could be a sub-term of vegetables, and under tomatoes, you could have green and red tomatoes).

Taxonomy terms are normally attached as reference fields to other content entities, which is how you can use them to classify content. When you set up a taxonomy reference field, you can let users enter terms in two ways:

Taxonomy reference fields can be added to any entity, such as user accounts, custom blocks, or regular content items. If you use them to classify regular content items, your site will automatically be set up with taxonomy listing pages for each term; each of these pages lists all of the content items that are classified with that term. For example, if you created several recipes that all had carrots as an ingredient, you might see something like this on the Carrots taxonomy listing page:

Taxonomy listing page - Carrots

Chapter 6: Setting Up Content Structure

Setting Up a Taxonomy

Goal

Create an Ingredients vocabulary and add it to the Recipe content type as a field that can contain an unlimited number of values and that allows adding new terms to the vocabulary.

Prerequisite knowledge

Site prerequisites

The Recipe content type must exist. See Adding a Content Type.

Steps

  1. In the Manage administrative menu, navigate to Structure > Taxonomy (admin/structure/taxonomy). You will see the Tags vocabulary that was created with the core Standard installation profile. (Note that the name and description of this vocabulary are shown in English on this page; see Concept: User Interface, Configuration, and Content translation for an explanation.) taxonomy list page

  2. Click Add vocabulary, and fill in the values below.

    Field name Explanation Example value
    Name The name of the vocabulary Ingredients
    Description A brief note about the vocabulary (Leave blank)
    taxonomy add Ingredients
  3. Click Save. You will be taken to the Ingredients page, which shows a list of all the terms in this vocabulary. Ingredients taxonomy term listing

  4. Click Add term. Enter "Butter" in the Name field. Click Save. Add term page

  5. You will receive a confirmation about the term you created. Add more terms. For example, "Eggs" and "Milk".

  6. In the Manage administrative menu, navigate to Structure > Content Types (admin/structure/types). Click Manage fields for your Recipe content type.

  7. Click Create a new field. The Add field page appears. Choose the Reference field type from the Choose a field type options. Click Continue. The Add field page appears with a form to configure the field. Add Ingredients field to Content type Recipe

  8. Enter values from the table below. Click Continue.

    Field name Explanation Value
    Label The title to give the field Ingredients
    Choose an option below: Type of content to reference Taxonomy term

    Settings for Ingredients field

  9. On the following configuration screen, enter the values from the table below. Click Save settings.

    Field name Explanation Value
    Help text Help shown to users creating content Enter ingredients that site visitors might want to search for
    Type of item to reference The type of entity that is referenced by the field Taxonomy term
    Allowed number of values The number of values a user can enter Unlimited
    Reference type > Reference method Select the method used to choose allowed values Default
    Reference type > Vocabulary Select the vocabulary to choose allowed values from Ingredients
    Reference type > Create referenced entities if they don't already exist Whether new ingredient terms can be created from the content editing form Checked
    reference type field settings
  10. Click Save settings. You will be taken back to the Manage Fields page. A message will be displayed saying that the configuration for Ingredients is complete. Manage fields page for Recipe content type

Videos

Setting up a Taxonomy

Chapter 6: Setting Up Content Structure

Adding a Reference Field

Goal

Add a reference field so that recipes can be linked to the vendor that has submitted it.

Prerequisite knowledge

Site prerequisites

The Recipe and Vendor content types must exist. See Adding a Content Type.

Steps

  1. In the Manage administrative menu, navigate to Structure > Content types (admin/structure/types). Then click Manage fields in the dropdown button for the Recipe content type. The Manage fields page appears.

  2. Click Create a new field. The Add field page appears. Choose the Reference field type from the Choose a field type options. Click Continue. The Add field page appears with a form to configure the field label. Adding a reference field to a content type

  3. Fill in the fields as shown below. Click Save and continue.

    Field name Explanation Value
    Label The title you want to give the field Submitted by
    Choose an option below: Type of content to reference Content

    Adding a reference field to a content type

  4. The page Submitted by appears which lets you set the allowed number of values. Fill in the fields as shown below. Click Save settings.

    Field name Explanation Value
    Type of item to reference Option to select the type of referenced entity Content
    Allowed number of values Specify the count of values associated with the field Limited, 1

    Storage configuration of a reference field

  5. The page Submitted by settings for Recipe appears which allows you to configure the field. Fill in the fields as shown below. Click Save settings.

    Field name Explanation Value
    Label Title shown for this field on the page Submitted by
    Help text Brief text aiding the person creating content Choose the vendor that submitted this recipe
    Required field Whether a value has to be provided or not Checked
    Reference type > Reference method Option to select reference method Default
    Reference type > Content type Specify the content type Vendor
    Reference type > Sort by Sorting field Vendor name
    Reference type > Sort direction Sorting order Ascending
    Settings for a reference field
  6. The Submitted by field has been added to the content type. Manage fields page for the Recipe content type

Videos

Adding a Reference Field

Chapter 6: Setting Up Content Structure

Concept: Forms and Widgets

Prerequisite knowledge

Concept: Content Entities and Fields

What are forms and widgets?

The content management system software that your site is running allows administrators to edit content and configure settings online, using various web forms. In particular, content editing forms are used to edit your site's content entities, and they are configurable by administrators; settings configuration forms are provided by modules and cannot themselves be configured.

The data in your site's content entities is stored in one or more fields that are attached to the entity type and/or subtype. When you configure the content editing form for each entity subtype, you can:

In principle, you can also have multiple content editing forms available for each entity subtype. This feature is rarely used, however; the only exception in common use is for the user profile fields: you can use different forms for user registration and user editing. For example, you might have a limited set of fields shown when users first register on the site, and more fields shown later on when they edit their profiles.

Chapter 6: Setting Up Content Structure

Changing Content Entry Forms

Goal

Change the Recipe form to use a different widget to enter terms in the Ingredients field.

Prerequisite knowledge

Site prerequisites

The Recipe content type must exist, and it must have an Ingredients taxonomy term reference field. At least one Vendor content item must exist. See Adding a Content Type and Setting Up a Taxonomy.

Steps

  1. In the Manage administrative menu, navigate to Content > Add content > Recipe (node/add/recipe) to look at the content entry form that is set up by default. Notice how you have to enter ingredients one by one, instead of having a more compact format.
  2. In the Manage administrative menu, navigate to Structure > Content types (admin/structure/types). Then click Manage form display on the dropdown button for the Recipe content type. The Manage form display page appears.
  3. For the Ingredients field, select Autocomplete (Tags style) in the Widget column. Manage the Recipe form
  4. Click Save.
  5. In the Manage administrative menu, navigate to Content > Add content > Recipe (node/add/recipe) to verify the changed behavior of the content form. The Ingredients field is now a single text field that accepts multiple values. Add a recipe
  6. Create two Recipe content items (see Creating a Content Item), such as recipes for "Green Salad" and "Fresh Carrots". Make sure all the fields have values, including images, ingredients, and submitted by (set this to one of the Vendor content items you created in Adding Basic Fields to a Content Type).

Expand your understanding

Change the main site Contact form by navigating in the Manage administrative menu to Structure > Contact forms. For instance, you may want to hide the Send yourself a copy or Language fields.

Videos

Changing Content Entry Forms

Chapter 6: Setting Up Content Structure

Concept: View Modes and Formatters

Prerequisite knowledge

Adding a Content Type

What is a View mode?

How an entity (such as content, a user or a comment) is displayed, depends on the context in which it is shown. This context is known as a view mode. Examples of view modes are:

Every view mode can be configured through the administration pages. To see the configuration options for the view modes of the Recipe content type, navigate in the Manage administrative menu to Structure > Content types (admin/structure/types) and click Manage display from the dropdown button. In each view mode, all fields can be hidden or displayed, and if they are displayed, you can choose and configure the field formatter.

What is a field formatter?

A field formatter is a setting for displaying the field values. For example, long text fields can be displayed trimmed or full-length, and taxonomy term reference fields can be displayed in plain text or linked to the taxonomy term page. Consult the Manage display page to see the field formatters for the fields of the Recipe content type.

Additional resources

Drupal.org community documentation page "View modes"

Chapter 6: Setting Up Content Structure

Changing Content Display

Goal

Make the content items more readable, accessible, and visibly attractive by reordering the fields, hiding labels, and tuning the output of the fields.

Prerequisite knowledge

Site prerequisites

The Vendor content type must exist, it must have Main Image and Vendor URL fields, and your site must have at least one Vendor content item. See Adding a Content Type, Adding Basic Fields to a Content Type, and Creating a Content Item.

Steps

  1. Find and view a Vendor content item you created in Adding Basic Fields to a Content Type. Notice that there are several things that could be done to improve how the page looks:

    • The Main Image and Vendor URL fields should not have labels.
    • The order of the fields should be changed so that the image comes first.
    • The image should be smaller.
  2. To fix the first two problems, and update some additional settings, in the Manage administrative menu, navigate to Structure > Content types (admin/structure/types). Then click Manage display in the dropdown button for the Vendor content type. Manage display

  3. Under the Label column, select Hidden for Main image. Do the same for Vendor URL. Selecting _main image title_ as _hidden_

  4. Click the gear wheel for the Vendor URL field, to open the configuration options.

  5. Fill in the fields as shown below.

    Field name Explanation Example value
    Trim link text length Maximum displayed length for link text Blank (no trimming)
    Open link in new window Whether links should open in a new window or the same window Checked
    Link trim length
  6. Click Update.

  7. Drag the cross bar handles of the fields to reorder as Main image, Body, Vendor URL, and Links. As an alternative to dragging, you can click the Show row weights link at the top of the table and enter numerical weights (fields with lower or more negative weights will be shown first). Changing order of fields

  8. Click Save.

  9. Find the Vendor content item from step 1 again, and verify that the updates have been made.

  10. Repeat similar steps to manage the display of the Recipe content type fields.

Expand your understanding

Concept: Image Styles

Videos

Changing Content Display

Additional resources

Chapter 6: Setting Up Content Structure

Concept: Image Styles

Prerequisite knowledge

Adding Basic Fields to a Content Type

What are image styles?

Image styles allow you to upload a single image but display it in several ways; each display variation, or image style, is the result of applying one or more effects to the original image.

As an example, you might upload a high-resolution image with a 4:3 aspect ratio, and display it scaled down, square cropped, or black-and-white (or any combination of these effects). The core software provides a way to do this efficiently:

  1. Configure an image style with the desired effects on the Image styles page (admin/config/media/image-styles).

  2. The effects will be applied the first time a particular image is requested in that style.

  3. The resulting image is saved.

  4. The next time that same style is requested, the saved image is retrieved without the need to recalculate the effects.

    The core software provides several effects that you can use to define styles; others may be provided by contributed modules.

    Visit the Image styles page via the Manage administrative menu, navigate to Configuration > Media > Image styles (admin/config/media/image-styles) to see the image styles that are defined by default.

Additional resources

Drupal.org community documentation page "Working with images"

Chapter 6: Setting Up Content Structure

Setting Up an Image Style

Goal

Add an image style and use it to display images on Vendor pages.

Prerequisite knowledge

Site prerequisites

Steps

  1. In the Manage administrative menu, navigate to Configuration > Media > Image styles (admin/config/media/image-styles).

  2. Click Add image style.

  3. Enter the name Extra medium (300x200)

  4. Click Create new style. The page Edit style Extra medium (300x200) appears.

  5. In the Effect table, select Scale and crop. Click Add.

  6. Fill in the fields as shown below.

    Field name Value
    Width 300
    Height 200
  7. Click Add effect. The image style is saved with the chosen effects. Add an image style

  8. In the Manage administrative menu, navigate to Structure > Content types (admin/structure/types).

  9. Click Manage display in the Operations dropdown for the Vendor content type. The Manage display page (admin/structure/types/manage/vendor/display) appears.

  10. Ensure that the secondary tab Default is selected.

  11. Click the gear wheel for the Main image field, to open the configuration options.

  12. Fill in the fields as shown below.

    Field name Explanation Example value
    Image style Which image style to use Extra medium (300x200)
    Link image to Page to visit if image is clicked Nothing

    Change field formatter settings of image field

  13. Click Update.

  14. Click Save. The new image style will be used while displaying Vendor content.

  15. Open a Vendor content item and verify that it now shows up with the scaled-down image. See Editing a Content Item for information on how to locate an existing content item.

  16. Repeat steps 8-15 for the Recipe content type.

Videos

Setting up an Image Style

Additional resources

Drupal.org community documentation page "Working with images"

Chapter 6: Setting Up Content Structure

Concept: Responsive Image Styles

Prerequisite knowledge

What are responsive image styles?

The core Responsive Image module provides responsive image styles. This allows you to have images in your website that are specifically sized for different screen sizes. This is useful, for example, to make your site load faster on mobile devices because image sizes are optimized for smaller screens.

A responsive image style is a mapping between image styles and breakpoints. Breakpoints are the points where a responsive design needs to change in order to respond to different screen sizes. Responsive image styles can either work with breakpoints defined in your theme or with breakpoints defined in the responsive image style settings.

When a responsive image style is defined, it can be used in the display settings for Image fields. This allows the site to display responsive images using the HTML5 picture tag, or using the srcset and sizes attributes in an img tag, depending on how the responsive image style is set up.

Adding Basic Fields to a Content Type

Additional resources

Chapter 6: Setting Up Content Structure

Concept: Text Formats and Editors

What are text formats and filters?

Text formats change how HTML tags and other text are processed and displayed on your site. Text formats are composed of a series of filters, each of which transforms text. When users create content, a text format is associated with the content, and the full, original text is stored in the database. The content is then passed through the filters in the text format before it becomes output on the site.

The core Filter module provides text format functionality, and the core Standard installation profile sets up Basic HTML, Restricted HTML, and Full HTML text formats. Each text format has an associated permission, so that you can allow only trusted users to use permissive text formats. This restricts untrusted users to text formats like Basic HTML, which filters out dangerous HTML tags.

What are the editors associated with text formats?

Each text format can be associated with an editor, such as a visual WYSIWYG (What You See Is What You Get) HTML editor. The core Text Editor module provides the ability to associate editors with text formats, and to configure the editors (such as adding and removing buttons from their toolbars). The core CKEditor module provides the industry-standard editor known as CKEditor, so that it can be used to edit HTML content on your site.

What is cross-site scripting?

Cross-site scripting (XSS) is a security vulnerability typically found in websites. In a site that is not well protected, malicious users can enter script into web pages that are viewed by other users (for example, in a comment or in the body of a page). A cross-site scripting vulnerability may be used by attackers to login as another user. It is important to configure the text formats of your website to prevent such abuse.

Concept: Security and Regular Updates

Additional resources

Chapter 6: Setting Up Content Structure

Configuring Text Formats and Editors

Goal

Add a horizontal rule tag to the Basic HTML text format, and a corresponding button to its editor configuration.

Prerequisite knowledge

Concept: Text Formats and Editors

Site prerequisites

Steps

  1. In the Manage administrative menu, navigate to Configuration > Content authoring > Text formats and editors (admin/config/content/formats). The Text formats and editors page appears. Note that the names of the text formats that came with your installation profile are shown in English on this page; see Concept: User Interface, Configuration, and Content translation for an explanation.
  2. Click Configure for the Basic HTML text format. The Basic HTML page appears.
  3. Note that CKEditor is selected in the Text editor field. This allows you to configure the editor's toolbar.
  4. Drag the horizontal line button from Available buttons to the Active toolbar. Toolbar items can be visually grouped together using a vertical divider. As an alternative to dragging, you can tab to select buttons and then move them using keyboard arrow keys. Configuring the editor
  5. Note that you can change the Filter processing order.
  6. Under Filter settings > Limit allowed HTML tags and correct faulty HTML, in the field Allowed HTML tags, verify that &lt;hr&gt; is present (adding its editor button will automatically update the allowed tags). Configuring the HTML tags
  7. Click Save configuration. You will be taken back to the Text formats and editors page. A message will be displayed saying that the text format has been updated. Confirmation message for text format configuration

Expand your understanding

If you do not see the effect of these changes in your site, you might need to clear the cache. See Clearing the Cache.

Videos

Configuring Text Formats and Editors

Chapter 7: Managing User Accounts

Chapter 7: Managing User Accounts

Concept: Users, Roles, and Permissions

What are Users?

Anyone who visits your website is a user, including you. There are three groups of users:

What are Permissions?

The ability to do actions on your site (including viewing content, editing content, and changing configuration) is governed by permissions. Each permission has a name (such as View published content) and covers one action or a small subset of actions. A user must be granted a permission in order to do the corresponding action on the site; permissions are defined by the modules that provide the actions.

What are Roles?

Rather than assigning individual permissions directly to each user, permissions are grouped into roles. You can define one or more roles on your site, and then grant permissions to each role. The permissions granted to authenticated and anonymous users are contained in the Authenticated user and Anonymous user roles, and depending on the installation profile you used when you installed your site, there may also be an Administrator role that is automatically assigned all permissions on your site.

Each user account on your site is automatically given the Authenticated user role, and may optionally be assigned one or more additional roles. When you assign a role to a user account, the user will have all the permissions of the role when logged in.

It is a good practice to make several roles on your site. In the farmers market site example, you might want the following roles:

Additional resources

Chapter 7: Managing User Accounts

Concept: The User 1 Account

Prerequisite knowledge

Concept: Users, Roles, and Permissions

What is the user 1 account?

During the installation of your site, you created the first user account. Each user account internally has a numeric user ID, and since the ID of this user is one, it is commonly referred to as the user 1 account. This user account is special, because independent of what roles it is assigned, someone logged in as user 1 has permission to do all actions on the site, including viewing and editing all content, editing any user account, changing site configuration, installing and uninstalling modules, and running the update script.

Because of this level of permission, some people refer to this account as the root user, similar to the "root" user account that has full administrative permissions in Linux and other operating systems.

It is usually better to make separate accounts for each administrative user, giving them the Administrator role, rather than having all administrative users log in using the user 1 account. There are several reasons for this:

It is not possible to delete the user 1 account from the administrative user interface. It would be possible to do with a database query, but it could cause problems in your site and is not advisable.

Additional resources

Drupal.org community documentation page "Accounts and roles"

Chapter 7: Managing User Accounts

Creating a Role

Goal

Create a Vendor role to allow some - but not all - users to perform specific tasks.

Prerequisite knowledge

Concept: Users, Roles, and Permissions

Steps

  1. In the Manage administrative menu, navigate to People > Roles (admin/people/roles).
  2. You will find default roles Anonymous user, Authenticated user, and Administrator already present. Roles page
  3. Click Add Role to add a custom role.
  4. Type Vendor in the Role name field. Click Save. adding vendor as a role
  5. You will see the message "Role Vendor has been added." displayed at the top of the page. vendor role added success message

Expand your understanding

Videos

Creating a Role

Additional resources

Drupal.org community documentation page "User Roles"

Chapter 7: Managing User Accounts

Creating a User Account

Goal

Create Vendor user accounts for Sweet Honey and Happy Farm vendors.

Prerequisite knowledge

Site prerequisites

The Vendor role must exist on your site. See Creating a Role.

Steps

  1. In the Manage administrative menu, navigate to People (admin/people).
  2. Click Add user. Form for creating a new user account
  3. Fill in the form fields. See the table below.
    Field name Explanation Example value
    Email address A valid email address for the vendor. All emails from the system will be sent to this address. The email address is not made public. honey@example.com
    Username A username for the vendor that they will use to sign in or author content items. Spaces are allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores. Sweet Honey
    Password A password the vendor will use to sign in to the site. You can see how safe the password is on the _Password strength_ gauge. You also get tips on how to make it safer. (Make a secure password)
    Confirm password Type the same password to avoid any typing mistakes. (Repeat password)
    Status Set the status of the user account. _Blocked_ users will not be able to sign in. Active
    Roles Set the role of the user account. Vendor
    Notify user of new account Whether or not to send a notification to the vendor's email address. Checked
    Picture Click _Browse_ and select a picture to upload. Pay attention to size restrictions. Photo of the vendor
    Contact settings Enable or disable the display of a contact form for the account. Checked
  4. Click Create new account. You will get a notification about the user account creation. New user account has been created
  5. Create a second Vendor account for Happy Farm by following the steps above.

Expand your understanding

Create a user account for yourself.

Videos

Creating a User Account

Chapter 7: Managing User Accounts

Assigning Permissions to a Role

Goal

Change the permissions for the Vendor role so that users can create, edit, and delete Recipe and Vendor content, format the content, and contact each other.

Prerequisite knowledge

Site prerequisites

The Vendor role must exist on your site. See Creating a Role.

Steps

  1. In the Manage administrative menu, navigate to People > Roles (admin/people/roles). The Roles page appears.

  2. Click Edit permissions in the dropdown for the Vendor role. The Edit role page appears where you can see all the available actions for the website such as, for example, Post comments or Administer blocks. The available permissions depend on the modules that are installed in the site. Note: Some permissions may have security implications. Be cautious while assigning permissions to roles.

  3. Check the boxes for the following permissions, listed by module:

    Module Permission
    Contact Use users' personal contact forms
    Filter Use the Restricted HTML text format
    Node Recipe: Create new content
    Node Recipe: Edit own content
    Node Recipe: Delete own content
    Node Vendor: Edit own content
    Granting users with the Vendor role the rights to create, delete and edit Recipes
  4. Click Save permissions. You will get a message saying your changes have been saved. Confirmation message after updating permissions

Expand your understanding

Concept: The User 1 Account

Videos

Assigning Permissions to a Role

Additional resources

Drupal.org community documentation page "Managing Users"

Chapter 7: Managing User Accounts

Changing a User's Roles

Goal

Change or add roles to a given user, either by editing a single-user or by applying a bulk operation.

Prerequisite knowledge

Concept: Users, Roles, and Permissions

Site prerequisites

The user account that you want to update, and the role you want it to have, must already exist. See Creating a User Account, Creating a Role, and Assigning Permissions to a Role.

Steps

Updating the roles using single-user editing method

  1. In the Manage administrative menu, navigate to People (admin/people).
  2. Locate the user 1 account (named "admin") to assign it the Administrator role. If it is not immediately visible, use the Name or email contains filter, or other filters, to narrow down the list.
  3. Click Edit to update the user account. People page
  4. On the Edit page, scroll down to Roles section. Check the Administrator role for the user account. Roles section of user edit page
  5. Click Save to update the user account. You should be returned to the People page and see a message saying that the changes have been saved. Confirmation message

Updating the roles using bulk editing method

  1. If the users Happy Farm and Sweet Honey did not already have the Vendor role, here is how you would add it. In the Manage administrative menu, navigate to People (admin/people).
  2. Locate Vendor user accounts Sweet Honey and Happy Farm and check them. If they are not immediately visible, use the Name or email contains filter, or other filters, to narrow down the list.
  3. Select Add the Vendor role to the selected user(s) from the Action select list. People page with bulk operation set up
  4. Click Apply to selected items. You should see a message indicating that the desired changes were made. Confirmation message

Videos

Changing a User

Chapter 7: Managing User Accounts

Assigning Authors to Content

Goal

Assign Vendor content items Happy Farm and Sweet Honey to the corresponding Vendor user accounts, so they can edit their own Vendor profiles on the site.

Prerequisite knowledge

Site prerequisites

Steps

  1. In the Manage administrative menu, navigate to Content (admin/content).
  2. Find Vendor content item Happy Farm in the list. If it is not immediately visible, you can filter the list by Published status, Content type (Vendor), Title, or Language. Click Edit for the Vendor content item you would like to assign an author to.
  3. Under Authoring information, start typing the Vendor's user name Happy Farm in the Authored by field. The field lists matching user names. Select the Vendor's user name from the list. Assigning an author to the Vendor content item
  4. Click Save.
  5. You will get a notification that the Vendor content item has been updated. Vendor content item has been updated
  6. Follow these steps again to assign Vendor content item Sweet Honey to the Vendor user account Sweet Honey.

Videos

Assigning Authors to Content

Chapter 8: Blocks

Chapter 8: Blocks

Concept: Blocks

What is a block?

Blocks are individual pieces of your site's web page layout. They are placed inside the regions (see Concept: Regions in a Theme) of your theme, and can be created, removed, and rearranged in the Block layout (admin/structure/block) administration page. Examples of blocks include the Who's online listing, the main navigation menu, and the breadcrumb trail. The main page content is also a block.

Some modules make new blocks available for placement on your site. For example, when the core Search module is installed and configured, it provides a block that contains a search form. You may also create and place your own custom blocks.

Each block has its own configuration settings, which allow you to select which pages of your site will display the block. It is even possible to place multiple copies of a block, each with its own separate configuration and visibility rules.

Chapter 8: Blocks

Creating A Custom Block

Goal

Create a block showing the hours and location of the farmers market.

Prerequisite knowledge

Steps

  1. In the Manage administrative menu, navigate to Content_ > Blocks (admin/content/block).

  2. Click Add content block. The Add content block page appears.

  3. Fill in the fields as shown below.

    Field name Explanation Example value
    Block description Name of the block shown to administrators Hours and location block
    Body Content of the block when it is displayed Open: Sundays, 9 AM to

    Add a content block

  4. Click Save. A message appears indicating the block has been saved.

Expand your understanding

Videos

Creating a Custom Block

Additional resources

Drupal.org community documentation page "Managing blocks"

Chapter 8: Blocks

Placing a Block in a Region

Goal

Place the Opening hours and location block in the website's sidebar.

Prerequisite knowledge

Concept: Blocks

Site prerequisites

Steps

  1. In the Manage administrative menu, navigate to Structure > Block layout (admin/structure/block). The Block layout page appears, listing the theme's regions.

  2. Ensure that in the secondary tab the core Olivero theme is selected. Block placement is defined per theme.

  3. Locate the region Sidebar in the list and click Place block next to it. The Place block window appears, listing all the blocks.

  4. Locate the Hours and location block and click Place block next to it. The Configure block window appears. Fill in the fields as shown below.

    Field name Explanation Example value
    Title Title to be displayed for the block Hours and location
    Display title Whether or not to display the title with the block Checked
    Region Which theme region to display it in Sidebar

    You can also hide or display the block on specific pages. In the case of the Farmer's market website you do not set any of these configuration options because you want to show the block everywhere. Block configuration page

  5. Click Save block. The Block layout page appears. You can drag the cross bar handles of blocks to change their order within each region. As an alternative to dragging, you can click the Show row weights link at the top of the table and select numerical weights (blocks with lower or more negative weights will be shown first).

  6. Verify that the Hours and location block is listed in the Sidebar region, and click Save blocks. The block has been placed on the sidebar of all pages that use the core Bartik theme. Page with a block placed on the Sidebar region

Expand your understanding

Videos

Placing a Block in a Region

Chapter 9: Creating Listings with Views

Chapter 9: Creating Listings with Views

Concept: Uses of Views

Prerequisite knowledge

What is a view?

A view is a listing of content on a website. The core Views module handles the display of views, and the core Views UI module allows you to create and edit them in the administrative interface. When you define views, you are interested in taking data from your website and displaying it to the user.

What types of data can be displayed using views?

You can create views to output practically any content entity that is stored in the system. For example, you can create the following lists for the farmers market site:

What are the ways data can be output using views?

A listing created by a view can be in any of the following forms:

Chapter 9: Creating Listings with Views

Concept: The Parts of a View

Prerequisite knowledge

What are the parts of a view?

When you are editing a view in the administrative interface, you will see the following parts (or sections), which allow you to specify what data to output, in what order, and in what format:

Creating a Content List View

Chapter 9: Creating Listings with Views

Creating a Content List View

Goal

Create a page listing vendors that will be automatically updated whenever a vendor is added, deleted, or updated on the site.

Prerequisite knowledge

Site prerequisites

Steps

  1. In the Manage administrative menu, navigate to Structure > Views > Add view (admin/structure/views/add). The Add view wizard appears.

  2. Fill in the fields as shown below.

    Field name Explanation Example value
    View basic information > View name Name of the view that will be visible in the administration pages Vendors
    View settings > Show Type of information listed in the view Content
    View settings > of type Specify content type Vendor
    View settings > sorted by List order Title
    Page settings > Create a page Create a page that displays the view Checked
    Page settings > Page title Title show above the view Vendors
    Page settings > Path Address of the page vendors
    Page settings > Page display settings > Display format Type of list Table
    Page settings > Items to display Number of items visible on the page 10
    Page settings > Use a pager Split up the list in several pages if there are more items Checked
    Page settings > Create a menu link Add the view page to the menu Checked
    Page settings > Menu > Type Type of menu item to create Normal menu entry
    Page settings > Menu > Menu link title Label of the link in the menu Vendors
    Page settings > Menu > Parent Menu in which to add the link Main navigation
    Add new view wizard
  3. Click Save and edit. The view configuration page appears.

  4. Under Fields, click Add from the dropdown button. The Add fields pop-up appears.

  5. Enter the word "image" in the search field.

  6. Check Main image in the table.

  7. Click Apply. The Configure field: Content: Main Image pop-up appears.

  8. Fill in the fields as shown below.

    Field name Explanation Example value
    Create a label Add a label before the field value Unchecked
    Image style The format of the image Medium (220x220)
    Link image to Add a link to the content item Content
  9. Click Apply. The view configuration page appears.

  10. Under Fields, click Add from the dropdown button. The Add fields pop-up appears.

  11. Enter the word "body" in the search field.

  12. Select Body in the table.

  13. Click Apply. The Configure field: Content: Body pop-up appears.

  14. Fill in the fields as shown below.

    Field name Explanation Example value
    Create a label Add a label before the field value Unchecked
    Formatter The presentation of the field value Summary or trimmed
    Trimmed limit: The number of maximum characters shown 120
  15. Click Apply. The view configuration page appears.

  16. Under Fields, click Content: Title (Title). The Configure field: Content: Title pop-up appears.

  17. Uncheck Create a label. This will remove the label that was created by the wizard.

  18. Click Apply. The view configuration page appears.

  19. Under Fields, click Rearrange in the dropdown button. The Rearrange fields pop-up appears.

  20. Drag the cross bar handles of fields to put them into the right order: Image, Title, Body. As an alternative to dragging, you can click the Show row weights link at the top of the table and enter numerical weights (fields with lower or more negative weights will be shown first).

  21. Click Apply. The view configuration page appears.

  22. Optionally, click Update preview for a preview.

  23. Click Save. Vendors view configuration page

  24. Navigate to the homepage and click Vendors from the main navigation to see the result. Vendors view output

Expand your understanding

Videos

Creating a Content List View

Chapter 9: Creating Listings with Views

Duplicating a View

Goal

Create a page listing recipes by duplicating the existing Vendors view. Modify the page so that the recipes are displayed in a grid and can be filtered by ingredients.

Prerequisite knowledge

Site prerequisites

Steps

  1. In the Manage administrative menu, navigate to Structure > Views (admin/structure/views). Find the view "Vendors" and click Duplicate in its dropdown button. (Note that the names of views that came with your installation profile are shown in English on this page; see Concept: User Interface, Configuration, and Content translation for an explanation.) Duplicate existing view

  2. Name the duplicate "Recipes" and click Duplicate. The view configuration page appears.

  3. To change the title of the view page to "Recipes", click Vendors in the Title field under Title. The Page: The title of this view pop-up appears. Enter "Recipes". Click Apply. Change view title

  4. To change from a table to a grid format, click Table in the Format field under Format. The Page: How should this view be styled pop-up appears. Check Grid and click Apply. The Page: Style options pop-up appears. Retain the default values and click Apply.

  5. To retain only the title and image fields for the Recipes view, click Content: Body under Fields. Click Remove in the pop-up that appears.

  6. To change the content type filter to use the Recipe content type, click Content: Type (=Vendor) under Filter criteria. In the Configure filter criterion: Content: Type pop-up, check Recipe and uncheck Vendor. Click Apply.

  7. To add a further filter that is exposed to visitors, click Add in the dropdown button under Filter criteria. Search for "ingredients" and check "Ingredients (field_ingredients)". Click Add and configure filter criteria.

  8. The appearing pop-up offers extra settings on vocabulary and selection type. Click Apply and continue. The next pop-up allows you to expose this filter to visitors. Fill in the fields as shown below, and click Apply.

    Field name Explanation Example value
    Expose this filter to visitors, to allow them to change it Allow visitors to filter and search Checked
    Required Whether a value has to be provided or not Unchecked
    Label Label shown for this filter on the view page Find recipes using...

    Expose filter

  9. To change the Path label field to "Recipes", click "/vendors" in the Path field under Page settings. In the pop-up that appears, enter the path "recipes" and click Apply. Note that when editing a view, you enter paths without the leading "/", unlike on other administrative pages (such as when providing a path to a content item page).

  10. To change the menu link title, click "Normal: Vendors" in the Menu field under Page settings. In the pop-up that appears, change the title to "Recipes" and click Apply.

  11. In order to use Ajax (see Ajax entry in the Glossary) to make filtering and paging faster for users, under Advanced > Other, click No in the Use AJAX field. Check Use AJAX in the pop-up that appears, and click Apply.

  12. Click Save to save the view.

  13. Go back to the home page and click Recipes in the navigation to view the new Recipes page. Recipes view

Expand your understanding

Videos

Duplicating a View

Chapter 9: Creating Listings with Views

Adding a Block Display to a View

Goal

Add a block display to the Recipes view to display the most recent recipes in a sidebar, and change its configuration without changing the existing Recipes page view.

Prerequisite knowledge

Site prerequisites

Steps

  1. In the Manage administrative menu, navigate to Structure > Views (admin/structure/views). Find the view "Recipes" and click Edit from its dropdown button. Alternatively, navigate to the Recipes page in the main site navigation, and click the Edit view contextual link in the main area of the page. See Concept: Administrative Overview for information about contextual links.
  2. Create a new block display by clicking Add under Displays. Click Block from the list of links that appears. The new display is created, and the focus is automatically switched to its configuration. Add block display
  3. To change the title of this display, click Block in the Display name field. The Block: The name and the description of this display pop-up appears. Change the Administrative name to "Recent recipes". Click Apply.
  4. To change the title of the block, click Recipes in the Title field under Title. In the pop-up that appears, select This block (override) from the For select list. Change the Title field to "New recipes" and click Apply (this display). Title only for this block
  5. To change the block's style, click Grid in the Format field under Format. In the pop-up that appears, select This block (override) from the For select list. Select Unformatted list and Click Apply (this display). You can further configure the style options in the next pop-up that appears. Then click Apply.
  6. To configure the image field, click Content: Main image under Fields. In the pop-up that appears, select This block (override) from the For select list. Select Image style Thumbnail (100x100). Click Apply (this display). Image to thumbnail
  7. To remove ingredients as a filter, click Content: Ingredients (exposed) under Filter criteria. In the pop-up that appears, select This block (override) from the For select list. Click Remove at the bottom.
  8. To configure how you want the content to be sorted in the view, click Add from the dropdown button under Sort criteria. In the pop-up that appears, select This block (override) from the For select list. Check Authored on (in the Content category), and then click Add and configure sort criteria.
  9. In the appearing configuration pop-up, select Sort descending to have the most recent recipes appear first. Click Apply.
  10. To specify the number of items to be displayed, click Mini in the Use pager field under Pager. In the pop-up that appears, select This block (override) from the For select list. Under Pager, select Display a specified number of items. Click Apply (this display). In the Block: Pager options pop-up, provide "5" as the value for Items to display. Click Apply.
  11. Click Save. You will either see the view editing page again, or the Recipes page, depending on what you did in step 1. You should also see a message saying that the view has been saved. Summary page after configuration
  12. Place the "Recipes: Recent Recipes" block in the Sidebar second region. See Placing a Block in a Region. Navigate to the site's home page to see the block. New Recipes block on homepage

Videos

Adding a Block Display to a View

Chapter 10: Making Your Site Multilingual

Chapter 10: Making Your Site Multilingual

Adding a Language

Goal

Add one or more languages to your site and define which one is used by default.

Prerequisite knowledge

Concept: User Interface, Configuration, and Content translation

Steps

  1. Install the four core multilingual modules (Language, Interface Translation, Content Translation, and Configuration Translation), by following the steps in Installing a Module.
  2. In the Manage administrative menu, navigate to Configuration > Region and language > Languages (admin/config/regional/language).
  3. Click Add language.
  4. Select Spanish (or your preferred language) from the Language name select list. Click Add language. After waiting for translations to finish downloading, you will be returned to the Languages page, with a confirmation message and the new language shown. List of available languages in the website
  5. Follow the steps in Placing a Block in a Region to place the Language switcher block in the Sidebar second region. This will enable site visitors to switch between languages, once the site has been translated.

Expand your understanding

Videos

Adding a Language

Additional resources

Drupal.org community documentation page "Multilingual guide"

Chapter 10: Making Your Site Multilingual

Configuring Content Translation

Goal

Make Custom block, Custom menu link, and Content entity types translatable. Select specific subtypes and set which fields of these can be translated.

Prerequisite knowledge

Site prerequisites

The core Content Translation module must be installed, and your site must have at least two languages. See Adding a Language.

Steps

  1. In the Manage administrative menu, navigate to Configuration > Regional and language > Content language and translation (admin/config/regional/content-language).

  2. Under Custom language settings, check Content, Content block and Custom menu link to make these entity types translatable. Custom language settings checklist

  3. Configuration options appear for Content, Content block and Custom menu link. Choose the subtypes you want to translate for each entity type. Check Basic page for Content, Basic block for Content block and Custom menu link for Custom menu link.

  4. Verify the settings for the entity types as shown below:

    Field name Explanation Example value
    Default language The default language for the entity subtype Site's default language (English)
    Show language selector on create and edit pages Whether or not the language selector should be shown while editing and creating content Checked

    Default language and translatability for content types

  5. Choose the fields that should be translatable for Basic page as shown in the table below. If a field is not translation-dependent, leave it unchecked.

    Field name Explanation Example value
    Title The title of the content Checked
    Authored by The author Unchecked
    Published Whether the content has been published or not Checked
    Authored on Date of publishing Unchecked
    Changed Date of last update Unchecked
    Promoted to front page Whether the content will be included in some content views Unchecked
    Sticky at top of lists Whether the content will be displayed first in some content views Unchecked
    URL alias Nicer URL for the content Checked
    Body The main content of the page Checked

    Translatable content entity subtypes' fields checklist

  6. Similarly, check the appropriate boxes for translatable fields belonging to Basic block and Custom menu link.

  7. Click Save configuration.

Expand your understanding

Videos

Configuring Content Translation

Additional resources

Chapter 10: Making Your Site Multilingual

Translating Content

Goal

Translate the home page to Spanish.

Prerequisite knowledge

Concept: User Interface, Configuration, and Content translation

Site prerequisites

Steps

  1. In the Manage administrative menu, navigate to Content (admin/content).
  2. Locate the home page. You can search for it by entering "Home" in the title field.
  3. Select Translate from the dropdown button in the row of the Home content item. The page Translations of Home appears.
  4. Click Add in the row Spanish. Adding a content translation
  5. Note that the user interface has switched to Spanish. To switch it back to English, remove the first instance of es in the browser's URL. For example, if your URL looks like example.com/es/node/5/translations/add/en/es, remove the es that comes immediately after example.com.
  6. Fill in the fields as shown below.
    Field name Explanation Value
    Title Translated title of the page Página principal
    Body Translated body of the page
    URL alias > URL alias Translated address of the webpage pagina-principal
  7. Click Save (this translation).
  8. Go to your site's home page to view the newly translated page.

Expand your understanding

Videos

Translating Content

Chapter 10: Making Your Site Multilingual

Translating Configuration

Goal

Translate the labels on the Recipes view page into Spanish.

Prerequisite knowledge

Site prerequisites

Steps

The basic steps for translating any configuration on your site are:

  1. In the Manage administrative menu, navigate to Configuration > Regional and Language > Configuration translation (admin/config/regional/config-translation).

  2. Locate the configuration item that you would like to translate. For example, to translate the site name, you need to find System information. For configuration that is grouped by type (for example, views or date formats), click the List button to list all configuration of that type, and then locate the item you are looking for.

  3. Click Translate for the item you located.

  4. Find a button that will let you add a translation in the desired language, and click this button.

  5. Enter the translation in the form, and save.

    Most configuration is fairly straightforward and intuitive to edit in this manner. Views configuration is an exception, because the translation editing form is nothing like the view editing form, and it is complex and hierarchical rather than being a simple form with just a few fields. As an example of how to translate a view, here are the steps to translate the labels in the Recipes view to Spanish:

  6. In the Manage administrative menu, navigate to Configuration > Regional and Language > Configuration translation (admin/config/regional/config-translation).

  7. Click List in the Views row.

  8. Click Translate in the Recipes row.

  9. Click Add in the Spanish row. The page Add Spanish translation for Recipes view appears.

  10. Under Displays > Default Display settings > Recipes default display Options, translate Display title from "Recipes" to "Recetas".

  11. Under Displays > Default display settings > Recipes default display options > Exposed form > Reset options, translate Submit button text from "Apply" to "Applicar". The other buttons and labels in this section do not appear on the Recipes page or block, and do not need to be translated. Translate the Recipes view

  12. Under Displays > Default display settings > Recipes default display options > Filters > (Empty) taxonomy term ID > Find recipes using... Expose, translate Label from "Find recipes using..." to "Encontrar recetas usando...".

  13. Click Save translation.

  14. Navigate to the Recipes page and switch to Spanish using the Language switcher block. Verify that the labels have been translated.

Expand your understanding

** To translate the site name, navigate in the Manage administrative menu to Configuration > System > Basic site settings > Translate system information (admin/config/system/site-information/translate).

** To translate the contact form, navigate in the Manage administrative menu to Structure > Contact forms (admin/structure/contact). Click Translate in the dropdown button in the Website feedback row.

** To translate the name of a menu, navigate in the Manage administrative menu to Structure > Menus (admin/structure/menu). Click Translate in the dropdown button for the menu whose name you want to translate.

** To translate field labels on a content type, navigate in the Manage administrative menu to Structure > Content types (admin/structure/types). Click Manage fields in the dropdown button for the content type whose field labels you want to edit. Click Translate in the dropdown button for the field whose label you want to edit.

Videos

Translating Configuration

Chapter 11: Extending and Customizing Your Site

Chapter 11: Extending and Customizing Your Site

Finding Modules

Goal

Find and evaluate modules on Drupal.org.

Prerequisite knowledge

Steps

  1. Go to Drupal.org, and navigate to Download & Extend > Modules (https://www.drupal.org/project/project_module).

  2. Filter your search using the categories on the module search page. Fill in the fields as shown below.

    Field name Explanation Example value
    Maintenance status How actively should the module be maintained? Actively maintained
    Development status What kind of development should the module undergo? Any
    Module categories The module's topic area. Administration
    Core compatibility The version of the core software the module is compatible with. 9.x
    Status Project status: _Sandbox projects_ are experimental projects. _Full projects_ have already gone through an approval process, but they can still be in development. Full projects Stability Whether or not the project maintainer has created a production-ready version.
    Has a supported stable release Security advisory coverage Whether or not the project maintainer has agreed to follow Drupal
    Search modules Search for _Admin Toolbar_, a module that will be covered in detail later. Alternatively, you can also leave the field blank if you are not sure which module to search for. Admin Toolbar
    Sort by Order your search results by criteria like _Most installed_ (popular modules that many sites use) or _Last release_ (date of latest version released). Most installed

    Filters on the module search page on Drupal.org

  3. Click Search. Search results will appear. Module search results page on Drupal.org

  4. To further evaluate a module, click its title in the list of search results to visit its project page.

    Some aspects to pay attention to when evaluating modules:

    • Project description: The description of the module on its project page should be clear and useful. You should get an idea of its features and requirements.
    • Project information: There may be warnings in this area of the page, such as if a module is no longer being developed, or is not covered by the security advisory policy.
    • Project information > Reported installs, downloads: You can see how many people have downloaded and how many sites use the module. If it's only used by a few sites, it might be a unique solution that not many people need, or it might be a warning sign that you shouldn't use it either.
    • Maintainers: When was the last commit (the last time someone updated something on the module) or last release (new version)? If the project has few open issues, a long time since commits/releases might be appropriate, but if it has a lot of open issues and there are no commits/releases, that would be a clue that it might be abandoned.
    • Issues: See if there are any open issues, potential problems with the module. Check the Statistics to see how regularly issues are responded to.
    • Documentation, Resources: Check if the module has documentation or a README file, that can help you install, configure, explore, and test it. Information on the project page to look for when evaluating a module

Expand your understanding

Downloading and Installing a Module from Drupal.org

Videos

Finding Modules

Chapter 11: Extending and Customizing Your Site

Enabling and Disabling Maintenance Mode

Goal

Put your site in maintenance mode to allow users with the right permissions to use the site while users without this permission are presented with a message that the site is under maintenance.

Prerequisite knowledge

Concept: Security and Regular Updates

Site prerequisites

If you want to use Drush to enable or disable maintenance mode, Drush must be installed. See Concept: Additional Tools.

Steps

You can use the administrative interface or Drush to enable or disable maintenance mode.

Enabling maintenance mode using the administrative interface

  1. In the Manage administrative menu, navigate to Configuration > Development > Maintenance mode (admin/config/development/maintenance). The Maintenance mode page appears.
  2. Fill in the fields as shown below.
    Field name Explanation Value
    Put site into maintenance mode Enable the maintenance mode
    Message to display when in maintenance mode The information that is shown to website visitors when the mode is enabled. Variables such as @site can be used in the message @site is currently under maintenance but should be back shortly. Thank you for your patience.
  3. Click Save configuration.
  4. Verify that the site is in maintenance mode by accessing it from another browser where you aren't logged in. If you are not able to verify, try clearing the cache. See Clearing the Cache. Maintenance mode enabled

Disabling maintenance mode using the administrative interface

  1. In the Manage administrative menu, navigate to Configuration > Development > Maintenance mode (admin/config/development/maintenance). The Maintenance mode page appears.
  2. Fill in the fields as shown below.
    Field name Explanation Value
    Put site into maintenance mode Disable the maintenance mode
    Message to display when in maintenance mode No message required while disabling. You can leave the field blank.
  3. Click Save configuration.
  4. Verify that the site is no longer in maintenance mode by accessing it from another browser where you aren't logged in. If you are not able to verify, try clearing the cache. See Clearing the Cache. Maintenance mode disabled

Enabling or disabling maintenance mode using Drush

  1. Follow the user interface steps above to edit the site maintenance message, if desired.
  2. Run the following Drush commands to enable maintenance mode and clear the cache:
    drush config:set system.maintenance message "Optional message" -y
    drush state:set system.maintenance_mode 1 --input-format=integer
    drush cache:rebuild
    
  3. Run the following Drush commands to disable maintenance mode and clear the cache:
    drush state:set system.maintenance_mode 0 --input-format=integer
    drush cache:rebuild
    
  4. After running either set of commands, verify that your site is either in or out of maintenance mode by visiting the site in a browser where you are not logged in.

Expand your understanding

Videos

Enabling and Disabling Maintenance Mode

Chapter 11: Extending and Customizing Your Site

Downloading and Installing a Module from _Drupal.org_

Goal

Download and install the contributed Admin Toolbar module, which allows you to easily browse through the administration section of the website.

Prerequisite knowledge

Site prerequisites

Composer must be installed to download modules. If you want to use Drush, Drush must be installed. See Concept: Additional Tools.

Steps

To install a contributed module, first download the module with Composer. Then install it using either the administrative interface or Drush. If you are installing a custom module rather than a contributed module that is not available via Composer, skip the steps for downloading the module, and refer to Manually Installing Module or Theme Files. Then return here and follow the steps for installing the module using either the administrative interface or Drush.

Download the contributed module with Composer

  1. On the Admin toolbar project page on drupal.org (https://www.drupal.org/project/admin_toolbar), scroll to the Releases section at the bottom of the page.
  2. Copy the provided Composer command for the version of the module you want to install. Finding a module's composer install command
  3. Alternatively, type the following command (substituting the short name of the module and desired version for admin_toolbar:^3.5):
    composer require 'drupal/admin_toolbar:^3.5'
    
  4. At the command line, change to the root directory of your project. Paste the Composer command and execute it.
  5. You should see a message about the module being successfully downloaded.

Install the module using the administrative interface

  1. In the Manage administrative menu, navigate to Extend (admin/modules). The Extend page appears.
  2. Locate the Admin toolbar module and check it. Installing Admin Toolbar module
  3. Click Install to turn on the new module.

Install the module using Drush

  1. Run the following Drush command, giving the project name (for example, admin_toolbar) as a parameter:
    drush pm:enable admin_toolbar
    
  2. Follow the instructions on the screen.

Expand your understanding

Videos

Downloading and Installing a Module from Drupal.org

Additional resources

Chapter 11: Extending and Customizing Your Site

Finding Themes

Goal

Find and evaluate themes on Drupal.org.

Prerequisite knowledge

Steps

  1. Go to https://www.drupal.org, and navigate to Download & Extend > Themes (https://www.drupal.org/project/project_theme).

  2. Filter your search using the categories on the theme search page. For example, you might use these filters:

    Field name Explanation Example value
    Maintenance status How actively is the theme maintained? If a theme is actively maintained, you can expect bug fixes and improvements on a regular basis. Actively maintained
    Development status What kind of development is the theme undergoing? If you select _Under active development_, you can expect new features to be added, and some aspects may still change. If you select _Maintenance fixes only_, it means that the theme is considered complete. Any Core compatibility The Drupal version the theme is compatible with. 9.x
    Status _Sandbox projects_ are experimental projects. _Full projects_ have already gone through an approval process, but they can still be in development. Full projects Stability Whether or not the project maintainer has created a production-ready
    Security advisory coverage Whether or not the project maintainer has agreed to follow Drupal Security Team procedures. Has security advisory coverage Search themes Search by search term in the theme's description. -
    Sort by Order your search results by criteria like _Most installed_ (popular themes that many sites use) or _Last release_ (date of latest version released). Most installed

    Filters on the theme search page on Drupal.org

  3. Click Search. Search results will appear. The search results page on Drupal.org

  4. To further evaluate a theme, click its title in the list of search results to visit its project page.

    Some aspects to pay attention to while evaluating themes:

    • Introduction: The description of the theme on its project page should be clear and useful. A screenshot of the theme helps your evaluation as well.
    • Project information: There may be warnings in this area of the page, such as if a theme is no longer being developed, or is not covered by the security advisory policy.
    • Project information > Reported installs, downloads: You can see how many people have downloaded and how many sites use the theme.
    • Issues: See if there are any open issues, potential problems with the theme. Check the Statistics to see how regularly issues are responded to.
    • Documentation, Resources: Check if the theme has documentation or a README file, that can help you install, configure, explore, and test it.

Expand your understanding

Videos

Finding Themes

Chapter 11: Extending and Customizing Your Site

Downloading and Installing a Theme from _Drupal.org_

Goal

Download and install a theme from Drupal.org.

Prerequisite knowledge

Site prerequisites

Composer must be installed to download themes. If you want to use Drush, Drush must be installed. See Concept: Additional Tools.

Steps

To install a contributed theme, first download the theme with Composer. Then install it using either the administrative interface or Drush. If you are installing a custom theme rather than a contributed theme that is not available via Composer, skip the steps for downloading the theme, and refer to Manually Installing Module or Theme Files. Then return here and follow the steps for installing the theme using either the administrative interface or Drush.

Download the contributed theme with Composer

  1. On the theme's project page on drupal.org (for example, https://www.drupal.org/project/honey), scroll to the Releases section at the bottom of the page.
  2. Copy the provided Composer command for the version of the theme you want to install. Finding the composer command for a theme
  3. Alternatively, type the following command (substituting the short name of the theme and desired version for honey:^1.0):
    composer require 'drupal/honey:^1.0'
    
  4. At the command line, change to the root directory or your project. Paste the Composer command and execute it.
  5. You should see a message about the theme being successfully downloaded.

Install the theme using the administrative interface

  1. In the Manage administrative menu, navigate to Appearance (admin/appearance). The Appearance page appears.
  2. Locate the new theme under Uninstalled themes and click Install and set as default to use it. All non-administrative pages on the site will now use this new theme. Uninstalled themes on Appearance page

Install the theme using Drush

  1. To install the theme, and set it as the default, run the following Drush
    commands, giving the project name (for example, honey) as a parameter:
    drush theme:enable honey
    drush config:set system.theme default honey
    
  2. Follow the instructions on the screen.

Expand your understanding

Videos

Downloading and Installing a Theme from Drupal.org

Chapter 11: Extending and Customizing Your Site

Manually Installing Module or Theme Files

Goal

Custom modules and themes may not be available via Composer and their files will need to be manually installed.

Prerequisite knowledge

Site prerequisites

Use this approach if you created a custom module/theme or received its files from someone.

When installing or updating the core software, contributed modules, and contributed themes you should use Composer. See Using Composer to Download and Update Files, Downloading and Installing a Module from Drupal.org, and Downloading and Installing a Theme from Drupal.org instead of this topic.

Steps

If you are installing a module or theme from Drupal.org, follow the downloading instructions, and then the uploading/unpacking instructions. If you created the module or theme, skip the downloading step. Instead, create an archive file (that you know how to extract on the server) and proceed with the steps in uploading/unpacking, using whatever method is appropriate for the way you initially created the archive file.

Uploading the files to your site and unpacking them

  1. If you are adding a new module or theme, create subdirectories in your top-level modules and themes directories (if they don't already exist). Typically, people make a contrib subdirectory for contributed modules and themes that are downloaded from Drupal.org, and a custom subdirectory for modules and themes that they created. Your modules directory might look like this: Suggested directory structure for modules
  2. If you are replacing an existing module or theme with an updated version, put the site into maintenance mode. See Enabling and Disabling Maintenance Mode.
  3. If you are replacing an existing module or theme with an updated version, find and delete all the existing files and directories for the existing module or theme. Modules are normally located in directories under the top-level modules directory, and themes are normally located in directories under the top-level themes directory.
  4. Upload the .tar.gz file (or whatever archive you created) to your site. Place it in either the same location from which you deleted the directory (if replacing an existing module or theme) or the appropriate subdirectory of modules or themes (if adding a new module or theme).
  5. Extract the files from the .tar.gz archive (or whatever archive you created), making a subdirectory in the same location as the archive file. If you do not have terminal access, or your hosting server is not running Linux, your hosting control panel's file manager should provide a way to extract the files. If you have terminal access to your hosting server (running Linux) and you are using a tar.gz file, you can use a command like:
    tar -xzf custom_toolbar-2.4.0.tar.gz
    
  6. Delete the compressed file from the server, unless your unpacking method already deleted it.
  7. Refer to Downloading and Installing a Module from Drupal.org, Downloading and Installing a Theme from Drupal.org, Updating a Module, or Updating a Theme to complete the installation or update of the module or theme. Start at the step after the automatic download has been completed.

Expand your understanding

Videos

Manually Downloading Module or Theme Files

Additional resources

Chapter 11: Extending and Customizing Your Site

Concept: Development Sites

What are Development Sites?

Development Sites are different copies of the same site used for developing, updating, and testing a site without risking the integrity of the live site.

An example deployment workflow for site building will usually include the sites mentioned below:

Based on the project's size, scope, requirements, or stakeholders, stages from the above workflow can be removed, or additional stages can be added. For example, a testing site before staging can be added to separate testing and user acceptance processes.

Chapter 11: Extending and Customizing Your Site

Making a Development Site

Goal

Make a copy of a site that you can use to develop new features and test updates on.

Prerequisite knowledge

Concept: Development Sites

Site prerequisites

Generic steps for making a development site

  1. Follow the steps in Preparing to Install, so that you have hosting set up for your development site, you know where the web root is for your development site, and you have an empty database and database user for your development site to use.

  2. The next step is to make a database dump file, containing the contents of your site's database. This file can be quite large, but there are two things you can do to reduce the size:

    • Compress the file, using gzip or another compression utility.
    • Exclude the contents of the database tables for the internal caching system, by truncating these tables. Their data is temporary, and you need only the table structure and not the table contents in order to make a copy of the site. To make the database dump, try one of the following methods:
    • If you use Drush, use this command, which will include only the structure and not the contents of the cache tables, and gzip-compress the output:
    drush sql:dump --gzip --structure-tables-list="cache,cache_*" \
      --result-file='PATH/TO/BACKUPFILE.sql'
    
    • If you are using MySQL and have access to the command line, use this command after truncating the cache tables (substituting in your site's database name, user name, and password):
    mysqldump -u'USERNAME' -p'PASSWORD' DATABASENAME | \
      gzip > PATH/TO/BACKUPFILE.sql.gz
    
    • If you are using MySQL as your database, and your live site's server has phpMyAdmin installed (it is available from many hosting control panels), you can truncate the cache tables by selecting them in the phpMyAdmin table structure list and choosing the Empty operation at the bottom of the page. Then use the Export tab in phpMyAdmin to export in SQL format, with gzip compression to reduce the file size.
    • Use the contributed Backup and Migrate module from within your live site. See Downloading and Installing a Module from Drupal.org for instructions on installing contributed modules. You now have a database dump stored in the file BACKUPFILE.sql.gz. For security reasons, avoid storing this file on your hosting server anywhere under the Drupal site root. This will prevent others from getting a copy of your database.
  3. Copy all of the files from the web root of your live site to the web root of your development site. You may wish to use Git to do this; if so, see Managing File and Configuration Revisions with Git.

  4. Edit the sites/default/settings.php file under your development site's top-level directory in a plain-text editor. Find the lines near the end that contain the database name, database username, and database password, and update them to the information about the development site database you set up. The lines look something like this (before editing):

    $databases['default']['default'] = [
      'database' => 'live_site_database_name',
      'username' => 'live_site_database_username',
      'password' => 'live_site_database_password',
      …
    
  5. Check whether your settings.php file has the following setting; if yes, then you will need to edit this to point to your development site URL instead of your production site URL:

    $settings['trusted_host_patterns']
    
  6. Check whether your settings.php file has the following setting, and has it set to a random string value. If it does not, then you will need to add or edit it in order to prevent fatal errors:

    $settings['hash_salt'] = 'any_string_value';
    

    One way to produce a random string for the hash salt is the following Drush command:

    drush php-eval 'echo
      \Drupal\Component\Utility\Crypt::randomBytesBase64(55) . "\n";'
    

    If you don't use Drush, there are numerous web sites and applications that provide random string generators; you'll want to generate a string that is about 74 characters long.

  7. Import the database dump file you created, into the development site's database. Try one of the following methods:

    • If you are using MySQL as your database, and your live site's server has phpMyAdmin installed (it is available from many hosting control panels), use the Import tab in phpMyAdmin. You may find that you have to restart the import a few times, if your database was large.
    • If you are using MySQL and have access to the command line, use this command (substituting in your site's database name, user name, and password; if you made a gzip-compressed backup file, you will also need to uncompress it first):
    gunzip < PATH/TO/BACKUPFILE.sql.gz | \
      mysql -u'USERNAME' -p'PASSWORD' DATABASENAME
    
    • If you prefer to use Drush, use this command:
    drush sql:query --file='PATH/TO/BACKUPFILE.sql.gz'
    
  8. If your development and live sites need to have different configuration, then you have to use configuration overrides in the settings.php file. The $config variable will help you maintain override values separately from the standard configuration data. For instance, you might want the site name to be "Anytown Farmers Market" on the production site, but "Development Site for Anytown Farmers Market" on the development site. To do that, you could have the production value in the site configuration (in the database), and on the development site, in the settings.php file, you would need to have:

    $config['system.site']['name'] =
      "Development Site for Anytown Farmers Market";
    

DDEV-specific steps for making a development site

  1. In the directory where you copied all of the files from your live site, run the following command to configure, and start, the DDEV environment:

    ddev config --project-type=drupal11 --docroot=web
    ddev start
    

    This assumes that you are using the recommended directory structure where the web root is in a subdirectory called web. If you are using a different directory structure, you will need to adjust the --docroot option accordingly.

  2. Use the following command to import the database dump file you created:

    ddev import-db --file=PATH/TO/BACKUPFILE.sql.gz
    

Expand your understanding

Videos

Making a Development Site

Additional resources

Chapter 11: Extending and Customizing Your Site

Deploying New Site Features

Goal

Copy a view that you have created in a local development site to the production site.

Prerequisite knowledge

Site prerequisites

Steps

  1. Open the local development site.
  2. In the Manage administrative menu, navigate to Configuration > Development > Configuration synchronization > Export > Single item (admin/config/development/configuration/single/export). The Single export page appears.
  3. Select View from the Configuration type list.
  4. Select Vendors from the Configuration name list. The configuration appears in the textarea.
  5. Copy the configuration from the textarea. Export a single item
  6. Open the production site.
  7. In the Manage administrative menu, navigate to Configuration > Development > Configuration synchronization > Import > Single item (admin/config/development/configuration). The Import page appears.
  8. Select View from the Configuration type list.
  9. Paste the configuration in the textarea.
  10. Click Import. The confirmation page appears.
  11. Click Confirm.
  12. Verify that the view was imported by navigating in the Manage administrative menu to Structure > Views.

Expand your understanding

The steps in this topic show how to export and import a single configuration item. However, often if you develop functionality on a development website and want to transfer it to your production site, you will need to transfer multiple configuration items. For instance, if you developed a new content type with fields, you would need to transfer several configuration items for each field, one for the content type itself, and possibly multiple view mode and form mode items, and they would have to be transferred in the right order. Getting this right can be both tedious and difficult.

As an alternative, you can export and import the complete configuration of the site. For this, you would need a local development site that is a clone of the production site (see Making a Development Site), and then you can follow the steps in Synchronizing Configuration Versions to synchronize configuration between development and production sites.

Another alternative is to use the contributed Features module, which allows exporting and importing bundled functionality (for example, all the configuration for a photo gallery).

Finally, if you do not see the effect of these changes in your site, you might need to clear the cache. See Clearing the Cache.

Videos

Deploying New Site Features

Chapter 11: Extending and Customizing Your Site

Synchronizing Configuration Versions

Goal

Synchronize the configuration between a development and live site.

Prerequisite knowledge

Site prerequisites

Steps

  1. In the source site, in the Manage administrative menu, navigate to Configuration > Development > Configuration synchronization > Export (admin/config/development/configuration/full/export).
  2. Click Export. Your site will generate an archive of the full site configuration. Save the file on your local computer.
  3. In the destination site, in the Manage administrative menu, navigate to Configuration > Development > Configuration synchronization > Import (admin/config/development/configuration/full/import).
  4. Browse to find the downloaded configuration archive, and click Upload. Your configuration archive will be uploaded to the destination site, and you will be redirected to the configuration Synchronize page (admin/config/development/configuration) with a message saying your files were uploaded.
  5. Verify that the differences shown on the page are what you expect. You may see configuration items that have been added, deleted, or changed; for changed items, you can click View differences to see what the changes are.
  6. When you are satisfied, click Import all to import the configuration changes.

Expand your understanding

Videos

Synchronizing Configuration Versions

Chapter 11: Extending and Customizing Your Site

Managing File and Configuration Revisions with Git

Goal

Use the Git revision control tool to manage revisions to files and configuration on your site.

Prerequisite knowledge

Site prerequisites

Steps

Initializing the repository

Do these steps once, after creating a Git repository, to connect your local directory to the repository and add the initial files to it.

  1. Open a command terminal window, and change to the directory where your site's files are located. This is your "top" directory.
  2. Determine where your web root is. If the core, modules, and themes directories are located directly in this directory, then you are in your web root. If you have used Composer to download the software, then these files are located inside the web subdirectory (which is your web root).
  3. In a plain text editor, create a new file called .gitignore in the top directory (or edit it if it already exists). This file contains a list of files and directories that Git should ignore (not add to the repository). For example, the settings.php file for your site should not be added to Git, because it contains your database account information, and the media files uploaded to your site (usually in sites/default/files) should not be in Git either -- the objective is to have the software in the repository, not the site content.
  4. Make sure the following lines are in the .gitignore file. If your web root is not your top directory, check each of these to see if they need a prefix. For example, sites may need to be replaced with web/sites.
    sites/*/settings*.php
    sites/*/files
    config
    
  5. Enter the following commands:
    git init
    git add -A
    
  6. Optionally, verify the list of files you will be adding to your Git repository by entering this command and scrolling through the (very long) list:
    git status
    
  7. Enter the following commands. You can substitute your own commit message for "Initial file add" if you wish, and you will need to substitute your own Git clone URL for the URL in the second command:
    git commit -m "Initial file add"
    git remote add origin https://gitlab.com/example-name/example-repo.git
    git push -u origin main
    
  8. If you are using GitLab, GitHub, or another host with online access, you can now go to your repository page and see that the files are there.

Updating files in the repository

Use these steps when you have updated, added, or deleted one or more files in your site, in order to send the changes (push) to your repository.

  1. Open a command terminal window, and change to the directory where your site's files are located.
  2. Check the list of files that have been added, changed, or deleted:
    git status
    
  3. Optionally, for text files that have been changed (not images), look at the differences between the new and old versions of the file:
    git diff path/to/file.txt
    
  4. Stage all the changes for the next commit, and verify that they are staged:
    git add -A
    git status
    
  5. You can omit a particular file from the commit that you have already staged, or add another file to the ones you have already staged. If a particular file or directory keeps getting added by mistake, consider adding it to the .gitignore file so that it will be ignored by Git. Omit/add commands:
    git reset HEAD path/to/file.txt
    git add path/to/file.txt
    
  6. Commit and push your changes. Substitute something meaningful for the commit message:
    git commit -m "commit message here"
    git push
    
  7. If you have other copies of your repository, update them by opening a command window in the directory of each copy and running the following command:
    git pull
    

Making a copy of the files in your repository

Follow these steps if you want to copy all the files in your repository to a new location. For example, you might have both a local development copy of your site and a production site, or several team members might all have local copies of the site.

  1. Open a command window in the location where you want the files to be.
  2. Enter the following command, substituting your repository clone URL for the URL, and the name of the subdirectory you want them in for dirname:
    git clone https://gitlab.com/example-name/example-repo.git dirname
    

Managing configuration in the repository

  1. Follow the instructions on Synchronizing Configuration Versions to export a complete archive of your site's configuration.
  2. If you have not already initialized configuration in the repository, unpack the configuration archive into a new directory, preferably above the web root directory, and follow the instructions above to add these files to your repository.
  3. After initializing, whenever your site configuration changes, export and unpack the configuration archive in the same location. Follow the instructions above to update these files in your repository.
  4. To import updated configuration to another site, make an archive of the configuration directory from your repository. Then follow the instructions on Synchronizing Configuration Versions to upload and import this archive into the site.

Concept: Development Sites

Chapter 12: Preventing and Fixing Problems

Chapter 12: Preventing and Fixing Problems

Concept: Cache

Prerequisite knowledge

Concept: Drupal as a Content Management System

What is the page cache?

The software that runs your site, on each page request, must perform calculations and retrieve data from the database, in order to compose the page that is sent to the web browser or other application that is accessing the site. These calculations take time, which can mean that your page load time is longer than would be desirable.

There are several ways that page load time can be sped up, including installing software on the server. The system includes the core Internal Page Cache and Dynamic Page Cache modules, which do not require any additional server software; they use a database cache mechanism to speed up your site. The way these modules work is that during page calculations, intermediate results and the final page output are stored in a special database area (known as the cache). Then the next time a compatible request is made, intermediate or final results, as appropriate, can be retrieved and used rather than redoing the entire calculation. In addition, when content or data that affects a particular calculation is updated, the affected cached data is removed from the cache, forcing that part of the calculation to be redone the next time it is needed.

These caching modules normally work reasonably well, and offer at least some speed-up for most sites. However, sometimes the page cache can have problems, such as:

What other data is cached?

Independent of whether the two page cache modules are installed on your site, the software that your site runs will still cache the output of many internal calculations. The core systems that cache data include:

If you have problems with your site, the first thing to try to fix it is usually to clear the cache. See Clearing the Cache for more information.

Additional resources

Learn about additional caching and performance optimization methods in the Drupal.org community documentation page "Caching overview".

Chapter 12: Preventing and Fixing Problems

Clearing the Cache

Goal

Clear or rebuild your site's internal caches to ensure they are up-to-date with the most recent data, using the user interface or Drush.

Prerequisite knowledge

Site prerequisites

If you want to use Drush to clear the cache, Drush must be installed. See Concept: Additional Tools.

Steps

You can use the administrative interface or Drush to clear the cache. You can also use the rebuild script or Drush to do a more complete cache rebuild.

Using the administrative interface to clear the cache

  1. In the Manage administrative menu, navigate to Configuration > Development > Performance (admin/config/development/performance). If you cannot access this page in the administrative interface, use one of the other methods to clear or rebuild the cache.
  2. Click Clear all caches.
  3. A message saying the cache has been cleared appears at the top of the page.
  4. If this doesn't resolve the problem that caused you to want to clear the cache, try a rebuild instead.

Using the rebuild script

  1. Open settings.php (/sites/default/settings.php) in any plain text editor. Add this line to the end of the file and save it:
    $settings['rebuild_access'] = TRUE;
    
  2. Visit http://www.example.com/core/rebuild.php in your browser (where www.example.com is your site's URL). After a short pause, you should be redirected to the home page of your site, and the cache should be rebuilt.
  3. Open settings.php (/sites/default/settings.php) in a text editor. Find the line you added with $settings['rebuild_access'], remove this line, and save the file.

Using Drush to rebuild or clear the cache

You can use one of two commands:

> drush cache:clear
Enter a number to choose which cache to clear.
 [0]  :  Cancel
 [1]  :  drush
 [2]  :  theme-registry
 [3]  :  menu
 [4]  :  css-js
 [5]  :  block
 [6]  :  module-list
 [7]  :  theme-list
 [8]  :  render
 [9]  :  views

Choose a cache to clear by entering the number associated with that cache. Press "Enter" to continue.

To clear a specific cache type, you can specify it in the cache:clear command. For example to clear the render cache:

drush cache:clear render

Videos

Clearing the Cache

Additional resources

Drupal.org community documentation page "Clearing or rebuilding Drupal's cache"

Chapter 12: Preventing and Fixing Problems

Concept: Data Backups

Prerequisite knowledge

What is a site backup?

If something happens to the computer (or computers) that your site and its database are running on, or if you lose access to this computer, you could lose some or all of your site's data. You could also lose data if your site is hacked, or if someone with administrative privileges on your site deletes or alters data mistakenly from the administrative interface. In order to prevent scenarios like this from being permanent, expensive data losses, it is important to make regular backups of your site's data, and to store them in a location that is separate from the computer where your site is running.

The frequency with which you should make data backups, and how many backups you should keep, depends on how frequently your site is changing. If you have a very large amount of content on your site that is being added to or updated many times per day, you would want to make more frequent backups than you would for a site that changes rarely. Also consider that some time could pass between when a data problem occurs and when you notice that it is a problem, so storing a sequence of backups (so that you can go back to the last known good data and retrieve that), rather than overwriting a single backup repeatedly, is a good practice.

Another consideration is that whatever format you store your backups in, it is a good idea to verify that you can actually retrieve lost data from your backups. You might want to test several possible data loss scenarios, and make sure that your data can be restored to the site in all cases.

In order to make a complete backup of your site, you will need to make copies of the following:

You can perform a test to confirm whether your backup has been done right by making a development copy of the site (see Making a Development Site).

Additional resources

Chapter 12: Preventing and Fixing Problems

Concept: Log

What is a Log?

Your site captures system events in a log to be reviewed by an authorized individual at a later time. The log is a list of recorded events containing usage data, performance data, errors, warnings, and operational information. It is vital to check the log on a regular basis as it is often the only way to tell what is going on.

You can find your site's recent log messages in the Manage administrative menu by navigating to Reports > Recent log messages (admin/reports/dblog). These logs may be cleared by administrators and automated cron tasks, so they should not be used for forensic logging. For forensic purposes, use the Syslog module.

Recent log messages of a basic site
Chapter 12: Preventing and Fixing Problems

Concept: Status Report

What is a Status Report?

The status report is a short overview of your site's parameters as well as any problems detected with your installation. It may be useful to copy and paste this information into support requests filed on Drupal.org's support forums and project issue queues or when asking for help on other channels.

You can find the status report in the Manage administrative menu by navigating to Reports > Status report (admin/reports/status).

Status report of a basic site

Getting Support

Additional resources

If you have an error about trusted host settings in your status report, see Drupal.org community documentation page "Trusted Host settings".

Chapter 13: Security and Maintenance

Chapter 13: Security and Maintenance

Concept: Cron

What are cron tasks?

To ensure that your site and its modules continue to function well, a group of administrative operations should be run periodically. These operations are called cron tasks. Examples of cron tasks are: checking for module and theme updates, indexing content for search, or cleaning up temporary files.

What is the relationship between the site's cron tasks and Unix cron?

Linux/Unix-based operating systems have a cron scheduler that can be used to run periodic tasks. You can use the server’s cron scheduler to schedule runs of the site’s cron tasks. Alternatively, you can use the core Automated Cron module to run tasks. You can check the site’s cron tasks' status in the status report.

Additional resources

Drupal.org community documentation page "Setting up cron"

Chapter 13: Security and Maintenance

Configuring Cron Maintenance Tasks

Goal

Check whether cron maintenance tasks are run regularly, and if not, either install the core Automated Cron module or run cron maintenance tasks from outside the website.

Prerequisite knowledge

Concept: Cron

Steps

  1. Review the Status report (see Concept: Status Report) to see when cron maintenance tasks were last run. If you installed the website using the core Standard installation profile (or similar), then cron maintenance tasks might already be running via the core Automated Cron module. By default, these tasks are run about every three hours.
  2. Choose whether to run cron maintenance tasks using the core Automated Cron module, or by other means. The core Automated Cron module might not be suitable for some websites because:
    • Each time someone accesses a page on the site, the module checks how long it has been since cron maintenance tasks have last run, and then runs them if necessary. If no one visits the website for a long time, cron maintenance tasks will not be run.
    • Cron maintenance tasks are run after the page has been generated. This means there is less time for the tasks to be run before various server timeouts are reached (for example, PHP execution timeout). If this happens, the logs (see Concept: Log) will show error messages that cron is unable to complete.
    • There is a small scalability cost associated with the core Automated Cron module. This is because one of the web server's processes is occupied (and can't serve other web pages) until the cron maintenance tasks are complete.
  3. If you want to use the core Automated Cron module, first make sure it is installed (it is installed with the core Standard install profile; see Installing a Module if it is not installed). Next, configure the module to control how frequently cron maintenance tasks are run. In the Manage administrative menu, navigate to Configuration > System > Cron (admin/config/system/cron). Select the desired interval from the Run cron every field under Cron settings, and click Save configuration. Configure the core Automated Cron module
  4. If you want to run cron maintenance tasks from outside the website, uninstall the core Automated Cron module (see Uninstalling Unused Modules). Next, find the cron URL. This URL is shown in the Status report (see Concept: Status Report), and in the Cron administration page (see previous step). The URL looks like this: http://www.example.com/cron/0MgWtfB33FYbbQ5UAC3L0LL3RC0PT3RNUBZILLA0Nf1Re Whenever this URL is visited, cron maintenance tasks will run. Set up one of the following schedulers to access this URL regularly:
    • The Cron daemon (Linux, OS X, Solaris, BSD)
    • Scheduled Tasks (Windows)
    • A cron SASS provider (software as a service)
    • A cron manager provided by your web hosting provider (see the documentation provided by your provider)

Concept: Security and Regular Updates

Videos

Configuring Cron Maintenance Tasks

Additional resources

Chapter 13: Security and Maintenance

Concept: Security and Regular Updates

Prerequisite knowledge

What are security updates?

Any software occasionally has bugs, and sometimes these bugs have security implications. When security bugs are fixed in the core software, modules, or themes that your site uses, they are released in a security update. When critical security updates are announced, they will be shown in the administration pages of your website. You will need to apply security updates in order to keep your site secure. See Keeping Track of Updates to learn how to be notified of security updates by email, and Updating the Core Software, Updating a Module, and Updating a Theme to learn how to make updates.

What is the security team?

The Drupal open-source project has a team of volunteers who track security-related bugs and release security updates. They also help other developers fix bugs, and maintain information for users on how to keep their websites secure. You can learn more about the security team and their practices and processes at the Drupal.org Security Team page.

How are security bugs reported?

It is important that security problems be kept confidential until they are fixed, so that sites are less likely to be compromised before they can be secured. If you find a potential security problem in any of the software you downloaded from the Drupal.org website, follow the procedures on the Drupal.org Security Team page to report it.

What are regular (non-security) updates?

The core software, modules, and themes also periodically have regular updates to add new features and fix bugs. These updates are less critical than security updates. As a general best practice, updates should be applied as long as they do not cause problems with your site. Testing on a development copy of your site is always a good idea before applying updates on a live site. This is because some updates may include changes that are not compatible with the modules or themes on your site, or that will break a particular functionality on your site.

Additional resources

Chapter 13: Security and Maintenance

Keeping Track of Updates

Goal

Keep your site safe and up-to-date by keeping up with the latest security updates.

Prerequisite knowledge

Concept: Security and Regular Updates

Steps

There are a few different ways to receive notifications of security releases:

Videos

Keeping Track of Updates

Additional resources

Chapter 13: Security and Maintenance

Updating the Core Software

Goal

Update the core software, either through the administrative interface or by using Drush.

Site prerequisites

Steps

  1. Make a complete backup of your site. Refer to Concept: Data Backups.
  2. Open settings.php (/sites/default/settings.php) in any plain text editor. Find the line with the $settings['update_free_access'] variable. By default, it is set to "FALSE" due to security reasons. Change the setting to "TRUE":
    $settings['update_free_access'] = TRUE;
    
  3. Disable any caching technique (memcache, varnish, and so on) your application might be using.
  4. Put your site in maintenance mode. See Enabling and Disabling Maintenance Mode.
  5. If you are using Composer to manage dependencies, skip the next six steps, and instead see Using Composer to Download and Update Files for instructions on downloading updated files. Continue with the update.php step.
  6. Download the tar.gz or zip file archive for the latest version of Drupal core for the branch you are currently using (such as 8.x or 9.x) from Drupal.org Drupal Core Downloads. See Preparing to Install for more details on how to find the latest version.
  7. Upload the archive file to your web hosting server.
  8. Extract the archive file to a temporary directory on your server (should be outside the directory where the site is hosted). Your hosting control panel's file manager should provide a way to extract the files. Or, if you have terminal access to your hosting server (running Linux), you can use a command like:
    tar -xzf drupal-8.3.2.tar.gz
    
  9. In your site hosting directory, delete the core and vendor directories, and all files that are not in a subdirectory, including .htaccess, composer.json, and autoload.php. Don't delete custom and customized files because you may end up losing the custom functionality stored in them.
  10. Copy the core and vendor directories and the non-custom/non-customized files that you deleted in the preceding step from the temporary directory to your site directory.
  11. Run the update.php script using either of the following:
    • Visit http://www.example.com/update.php in your browser (where www.example.com is your site's URL). Click Continue in the first screen to run the updates and successfully complete the script.
    • Run the following Drush command: drush updatedb
  12. If you get any error or warning, re-run the update.php script again till all the updates have been completed successfully.
  13. Open settings.php (/sites/default/settings.php) in a text editor. Find the line with the $settings['update_free_access'] variable and update it to "FALSE":
    $settings['update_free_access'] = FALSE;
    
  14. Click Administration pages to return to the administration section of your site.
  15. Take your site out of maintenance mode. See Enabling and Disabling Maintenance Mode.
  16. Clear the cache. See Clearing the Cache.
  17. Re-enable any caching technique you disabled at Step 3.
  18. You should have the updated version running. You can verify the current version of your software by checking the Status report (see Concept: Status Report).

Expand your understanding

Concept: Status Report

Videos

Updating the Core Software

Additional resources

Chapter 13: Security and Maintenance

Updating a Module

Goal

Update a contributed module and run the Database updates script.

Prerequisite knowledge

Site prerequisites

Steps

Before you start, check for module-specific update instructions. Read and understand all module-specific requirements before proceeding with the updates. To find instructions, check the module's project page Read Documentation link.

To view further instructions, after downloading the updated files, look for README.txt, INSTALL.txt, and UPGRADE.txt that come with the module. Also, review the release notes on the project page by clicking the version number you're downloading.

Release notes link

Updating a module requires first putting your site into maintenance mode, then obtaining the new code files and applying any required database updates, then finally taking the site out of maintenance mode.

You can update the code for a contributed module using Composer. If you are updating a custom module rather than a contributed module, obtain the new module files, then continue with instructions for running the database updates via the administrative interface below.

This assumes that you are using Composer to manage the files in your site; see Using Composer to Download and Update Files.

Update a contributed module with Composer

  1. Put your site in maintenance mode. See Enabling and Disabling Maintenance Mode.

  2. In the Manage administrative menu, navigate to Reports > Available updates > Update (admin/reports/updates).

  3. Find and check the module in the list. Click Download these updates for the module. Available updates

  4. Determine the short name of the project you want to update. For contributed modules and themes, it is the last part of the URL of the project page; for example, the Geofield module, at https://www.drupal.org/project/geofield, has short name geofield.

  5. If you want to update to the latest stable release, use the following command, substituting the short name of the project to be updated for geofield:

    composer update drupal/geofield --with-dependencies
    

    To learn how to download specific versions see Using Composer to Download and Update Files.

  6. After obtaining the new module files run any database updates page by typing the URL example.com/update.php in your browser.

  7. Click Continue to run the updates. The database update scripts will be executed.

  8. Click Administration pages to return to the administration section of your site.

  9. Take your site out of maintenance mode. See Enabling and Disabling Maintenance Mode.

  10. Clear the Drupal cache (refer to Clearing the Cache).

Expand your understanding

Videos

Updating a Module

Chapter 13: Security and Maintenance

Updating a Theme

Goal

Update a contributed theme on your site and run the Database Updates script.

Prerequisite knowledge

Site prerequisites

Steps

Updating a contributed theme requires first putting your site into maintenance mode, then obtaining the new code files and applying any required database updates, then finally taking the site out of maintenance mode.

You can update the code for a contributed theme using Composer. If you are updating a custom theme rather than a contributed theme, obtain the new theme files, then continue with instructions for running the database updates via the administrative interface below.

This assumes that you are using Composer to manage the files in your site; see Using Composer to Download and Update Files.

Update a contributed theme with Composer

  1. Put your site in maintenance mode. See Enabling and Disabling Maintenance Mode.

  2. In the Manage administrative menu, navigate to Reports > Available updates > Update (admin/reports/updates).

  3. Find any themes in the list that need updating. Available updates

  4. Determine the short name of the project you want to update. For contributed modules and themes, it is the last part of the URL of the project page; for example, the Honey theme, at https://www.drupal.org/project/honey, has short name honey.

  5. If you want to update to the latest stable release, use the following command, substituting the short name of the project to be updated for honey:

    composer update drupal/honey --with-dependencies
    

    To learn how to download specific versions see Using Composer to Download and Update Files.

  6. After obtaining the new theme files run any database updates page by typing the URL example.com/update.php in your browser.

  7. Click Continue to run the updates. The database update scripts will be executed.

  8. Click Administration pages to return to the administration section of your site.

  9. Take your site out of maintenance mode. See Enabling and Disabling Maintenance Mode.

  10. Clear the Drupal cache (refer to Clearing the Cache).

Expand your understanding

Videos

Updating a Theme

Chapter 14: Final Thoughts

Chapter 14: Final Thoughts

Connecting with the Community

Prerequisite knowledge

Concept: The Drupal Project

How can you connect with the community?

The Drupal project has a world-wide community of developers and users. One of the best ways to improve your knowledge of the platform is to connect with others that are using it, and get involved in the open-source community. There are many ways that you can get started:

How can you report a problem or suggest a feature?

Each project within the community (such as the Drupal Core project for the base software, and projects for each contributed theme and module) uses issues to keep track of software bugs and plans for new features. You can participate by creating a bug report when you find a problem, creating a feature request, or commenting on existing issues. Search before creating an issue, to make sure that the problem or feature has not already been reported or requested. See the Drupal.org page "Use the issue queue" and the Drupal.org page "Reporting a problem" for more information.

If you find a problem that you believe is related to security, such as a cross-site scripting vulnerability, do not report it in the standard issue queue. Instead, report it to the security team. See the Drupal.org page "How to report a security issue" for details.

Getting Support

Additional resources

Chapter 14: Final Thoughts

Getting Support

Prerequisite knowledge

Where can you find support?

The Drupal project is open-source, so if you have questions about or problems with the software, your options for finding answers and fixes are somewhat different from what they would be for commercial software.

There are several options for free support provided by community volunteers. First, some Slack channels, DrupalChat channels, local groups, and language communities encourage support questions, through on-line chat, in-person meetings, or websites (find out more about these on Connecting with the Community).

Second, some (but not all) contributed module, distribution, and theme projects encourage you to post support requests in issues. Generally, projects that have a very large number of users do not allow support requests in their issues (Drupal Core is in that category), while projects with a smaller number of users welcome the occasional support question. Be respectful of developer time and read the documentation for the project before posting a question in an issue. On the other hand, all projects encourage you to use issues to report problems and bugs; see Connecting with the Community to learn more about that.

In addition to those resources, the following sites provide free forums where volunteers answer support questions about Drupal:

If you prefer to pay for support (presumably in exchange for more extensive service or better availability), you can find service providers in the "Drupal Marketplace" on Drupal.org.

Additional resources

Chapter 14: Final Thoughts

Learning More

Prerequisite knowledge

Where can you go to learn more?

The following resources should prove useful to you, as you continue to advance your skills:

Glossary

Ajax

A web technology used to exchange data with a server to dynamically update parts of a web page (for example, forms) without needing entire page reloads.

Alias

A user-friendly name to replace the internal path that the system assigns to a URL on the site. For example, you might assign an alias of /about to the About page on your site, to replace the internal path /node/5. This would give the page a URL of http://example.com/about instead of http://example.com/node/5. See Concept: Paths, Aliases, and URLs for more information.

Anonymous

A person (user) interacting with the site who is not logged in. See Concept: Users, Roles, and Permissions for more information.

Authenticated

A person (user) interacting with the site who is logged in. See Concept: Users, Roles, and Permissions for more information.

Block

A chunk of content (text, images, links, etc.) that can be displayed on a page of a site. Blocks are displayed in regions. See Concept: Blocks for more information.

Breakpoint

Breakpoints are used to separate the height or width of browser screens, printers, and other media output types into steps. A responsive site adjusts its presentation at these breakpoints. See Concept: Responsive Image Styles for more information.

Bundle

Synonym for Entity subtype.

Cache

The site's internal cache stores the output of time-consuming calculations, such as computing output for an HTML page request, and then retrieves them instead of recalculating the next time they are needed. External caching systems can also be used on the web server to speed up a site's response. See Concept: Cache for more information on the internal cache.

Coding standards

Coding standards are the rules for programmers that define best practices, formatting, and various other rules, so that everyone uses the same conventions and has the same expectations when they see code. See Concept: Additional Tools for more information.

Composer

The PHP dependency manager used by Drupal, Drush, the Symfony framework and others. It is the preferred means of installing Drupal projects. See Using Composer to Download and Update Files for more information.

CMS

Acronym for Content Management System.

Configuration

Information about your site that is not content, and is meant to be more permanent than state information, such as the name of your site, the content types and views you have defined, etc. See Concept: Types of Data for more information.

Content

Information meant to be displayed on your site, such as text, images, downloads, etc. See also Configuration and State. See Concept: Types of Data for more information.

Content item

An item of content that is typically meant to be displayed as the main content of a page on your site. This is an entity type. See Concept: Content Entities and Fields for more information.

Content Management System (CMS)

A collection of tools designed to allow the creation, modification, organization, search, retrieval and removal of information on a website. See Concept: Drupal as a Content Management System for more information.

Content type

An entity subtype for the content item entity type. Each content type is used for some particular purpose on the site, and each has its own fields. For example, a site for a farmers market might have a content type for simple pages, and another for a vendor listing page. See Concept: Content Entities and Fields for more information.

Contextual Filter (in a View)

Limits the data to be output in a view, based on the context of the view display, such as the full URL of the page. See Concept: The Parts of a View for more information.

Contributed

Modules, themes, and distributions that are not part of the Drupal core download, and that can be downloaded separately from the Drupal.org website.

Cron

On some operating systems, cron is a command scheduler application that executes commands or scripts periodically. Your site defines periodic tasks, also known as cron tasks, that need to be triggered either by an operating system cron scheduler, or internally. See Concept: Cron for more information.

Cross Site Scripting

Security vulnerability typically found in websites. In a site that is not well protected, malicious users can enter script into web pages that are viewed by other users. See Concept: Text Formats and Editors for more information.

Devel

Module that helps with development tasks such as debugging and inspecting code, analyzing database queries, and generating dummy content. See Concept: Additional Tools for more information.

Development site

Copy of the live website that is used for developing, updating, and testing the website. See Concept: Development Sites for more information.

Display (in a View)

Type of output of a view, for example a page, a block or a feed. See Concept: The Parts of a View for more information.

Distribution

A single download that provides a shortcut for setting up a specific type of site, such as a website for a club or for e-commerce. A distribution contains Drupal core, along with contributed modules and/or themes; many distributions also pre-configure the site or even create sample content upon installation. See Concept: Distributions for more information.

Drupal Association

Non-profit organization dedicated to supporting the Drupal project and community. See Concept: The Drupal Project for more information.

Drupal core

The files, themes, profiles, and modules included with the standard project software download. See Concept: Drupal as a Content Management System for more information.

Drush

Command line shell and scripting interface for Drupal. See Concept: Additional Tools for more information.

Editorial Workflow

Process to create, review, edit, and publish content. Multiple people in different roles (for example content creators and editors) can be part of the process. See Concept: Editorial Workflow for more information.

Entity

An item of either content or configuration data, although in common usage, the term often refers to content entities. Examples include content items, custom blocks, taxonomy terms, and definitions of content types; the first three are content entities, and the last is a configuration entity. See also Entity type, Entity subtype, and Field. See Concept: Content Entities and Fields for more information.

Entity subtype

Within a content entity type, a grouping of entities that share the same fields. For example, within the content item entity type, a farmers market site might have subtypes (known as content types) for static pages and vendor pages, each with its own group of fields. You may also see the term bundle used (especially in programmer documentation) as a synonym of entity subtype. See Concept: Content Entities and Fields for more information.

Entity type

The overall type of an entity; in common usage, it is only applied to a content entity. Examples include content types, taxonomy terms, and custom blocks. See Concept: Content Entities and Fields for more information.

Field

Data of a certain type that is attached to a content entity. For instance, on a farmers market site's vendor content type, you might have fields for an image, the vendor description, and a taxonomy term. See Concept: Content Entities and Fields for more information.

Field bundle

Synonym for Entity subtype.

Field formatter

Configuration that defines how the data in a field is displayed. For example, a text field could be displayed with a prefix and/or suffix, and it could have its HTML tags stripped out or limited. See also View mode and Field widget. See Concept: View Modes and Formatters for more information.

Field widget

Configuration that defines how someone can enter or edit data for a field on a data entry form. For example, a text field could use a single-line or multi-line entry box, and there could be a setting for the size of the box. See also Field formatter. See Concept: Forms and Widgets for more information.

Filter (in a View)

Limits the data to be output in a view, based on criteria such as publication status, type of content, or field value. See Concept: The Parts of a View for more information.

Formatter

See Field formatter.

FOSS

Acronym for Free and Open Source Software, meaning software that is developed by a community of people and released under a non-commercial license. See also GPL. See Concept: The Drupal Project for more information.

Git

Version control system used by Drupal developers to coordinate their individual code changes. Git records everyone’s changes to a given project in a directory tree called a git repository. See Concept: Additional Tools for more information.

GPL

Acronym for the GNU General Public License, a non-commercial software license. All software downloaded from the Drupal.org website is licensed under the "GNU General Public License, version 2". See also FOSS. See Concept: Drupal Licensing for more information.

Image style

A set of processing steps that transform a base image into a new image; typical processing includes scaling and cropping. See Concept: Image Styles for more information.

Installing

Preparing Drupal core or any contributed theme or module for usage. In the case of Drupal core this means downloading the necessary files, creating the database, configuring and running the installation script. See Concept: Methods for Downloading and Installing the Core Software for more information.

LAMP

Acronym for Linux, Apache, MySQL, and PHP: the software on the web server that the scripts commonly run on (although it can use other operating systems, web servers, and databases). See Concept: Server Requirements for more information.

Log

A list of recorded events on the site, such as usage data, performance data, errors, warnings, and operational information. See Concept: Log for more information.

Menu

Module

Software (usually PHP, JavaScript, and/or CSS) that extends site features and adds functionality. The Drupal project distinguishes between core and contributed modules. See Concept: Modules for more information.

Path

The unique, last part of the internal URL that the system assigns to a page on the site, which can be a visitor-facing page or an administrative page. For example, the internal URL for the About page on your site might be http://example.com/node/5, and in this case, the path is node/5. See also Alias. See Concept: Paths, Aliases, and URLs for more information.

Permission

The ability to perform some action on the site, such as editing a particular type of content, or viewing user profiles. See also Role. See Concept: Users, Roles, and Permissions for more information.

Reference field

A field that represents a relationship between an entity and one or more other entities, which may be the same entity type or a different type. For example, on a farmers market site, a recipe content item might have a reference field to the vendor (also a content item) that posted the recipe. Taxonomy term fields are also reference fields. See Concept: Reference Fields for more information.

Region

A defined area of a page where content can be placed, such as the header, footer, main content area, left sidebar, etc. Regions are defined by themes, and the content displayed in each region is contained in blocks. See Concept: Regions in a Theme for more information.

Relationship (in a View)

Expansion of the data that is displayed in a view, by relating the base content to other content entities. See Concept: The Parts of a View for more information.

Repository

Location where a version control system stores all the files and directories for a project. See Concept: Additional Tools for more information.

Responsive

A site or theme is said to be responsive if it adjusts its presentation in response to the size of the browser screen, printer, or other media output type. See also Breakpoint. See Concept: Responsive Image Styles for more information.

Revision

A record of the past or present state of a content entity, as it is edited over time. See Concept: Editorial Workflow for more information.

Role

A named set of permissions that can be applied to a user account. See Concept: Users, Roles, and Permissions for more information.

Security update

An update that fixes a security-related bug, such as a hacking vulnerability. See Concept: Security and Regular Updates for more information.

Session

Information about individual site visitors' interactions with the site, such as whether they are logged in and their cookies. See Concept: Types of Data for more information.

Staging site

Copy of the live website that can be used for testing, or presenting the changes to the client for approval. See Concept: Development Sites for more information.

State

Information of a temporary nature about the current state of your site, such as the time when cron was last run, etc. See also Content and Configuration. See Concept: Types of Data for more information.

Taxonomy

The process of classifying content. See Concept: Taxonomy for more information.

Taxonomy term

A term used to classify content, such as a tag or a category. See also Vocabulary. See Concept: Taxonomy for more information.

Text format

Configuration that defines the processing that happens to user-entered text before it is shown in the browser. This might include stripping or limiting HTML tags, or turning URLs into links. See Concept: Text Formats and Editors for more information.

Theme

Software and asset files (images, CSS, PHP code, and/or templates) that determine the style and layout of the site. The Drupal project distinguishes between core and contributed themes. See Concept: Themes for more information.

UI

Acronym for User Interface.

Update

A newer version of your site's software, either Drupal core or a module or theme. See also Security update. See Concept: Security and Regular Updates for more information.

URL

A web page's unique address on the web. For example https://example.com/node/7. See Concept: Paths, Aliases, and URLs for more information.

User

A person interacting with the site, either logged-in or anonymous. See Concept: Users, Roles, and Permissions for more information.

User interface

The text, styles, and images that are visible on a site, separated logically into the user interface for site visitors and the administrative user interface.

User one (User 1)

The initial user account that is created when you install the site (whose ID number is 1). It automatically has all permissions, even if it is not assigned an administrative role. See Concept: The User 1 Account for more information.

Version Control System

Software that keeps copies of files and revision history in a repository, and allows you to add, delete, and update files. See Concept: Additional Tools for more information.

View

A formatted listing of data; typically, the data comes from content entities. For example, on a farmers market site, you might create a content item for each vendor. You could then make view that generates a listing page that shows a thumbnail image and short description of each vendor, linking to the full-page content item. Using the same data, you could also make a view that generates a new vendors block, which would show information from the most recently added vendors. See Concept: Modular Content for more information.

View mode

A set of field formatter configuration for all of the fields of a content entity, some of which may be hidden. Each entity subtype can have one or more view modes defined; for example, content types typically have Full and Teaser view modes, where the Teaser view mode displays fewer or trimmed-down fields. See Concept: View Modes and Formatters for more information.

Vocabulary

A group of taxonomy terms to choose from when classifying content in a particular way, such as the list of all of the vendor categories on a farmers market site. Technically, vocabularies are the entity subtype for the taxonomy term entity type. See Concept: Taxonomy for more information.

Widget

See Field widget.

Wizard

A web form that allows you to fill in a few values, and creates something with sensible defaults based on the values you chose. For example, there are wizards for creating views of different types. See Creating a Content List View for more information.

WYSIWYG

Acronym for What You See is What You Get, meaning a method for editing content where what you see on the editing screen closely resembles the final product. See Configuring Text Formats and Editors for more information.

Workflow

See Editorial Workflow.

XSS

Acronym for Cross Site Scripting.