Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Drupal 10 Masterclass

You're reading from  Drupal 10 Masterclass

Product type Book
Published in Dec 2023
Publisher Packt
ISBN-13 9781837633104
Pages 310 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Adam Bergstein Adam Bergstein
Profile icon Adam Bergstein

Table of Contents (31) Chapters

Preface 1. Part 1:Foundational Concepts
2. Chapter 1: What is Drupal? 3. Chapter 2: Drupal Core, Modules, and Themes 4. Chapter 3: Infrastructure and Overview of Technical Architecture 5. Chapter 4: Drupal Community 6. Chapter 5: What’s New in Drupal 10 7. Part 2:Setting up - Installing and Maintaining
8. Chapter 6: Bootstrapping, Installing, and Configuring a New Drupal Project 9. Chapter 7: Maintaining Drupal 10. Part 3:Building - Features and Configuration
11. Chapter 8: Content Structures and Multilingual 12. Chapter 9: Users, Roles, and Permissions 13. Chapter 10: Drupal Views and Display Modes 14. Chapter 11: Files, Images, and Media 15. Chapter 12: Search 16. Chapter 13: Contact Forms 17. Part 4:Using - Content Management
18. Chapter 14: Basic Content Authoring Experience 19. Chapter 15: Visual Content Management 20. Chapter 16: Content Workflows 21. Part 5:Advanced Topics
22. Chapter 17: Git, Drush, Composer, and DevOps 23. Chapter 18: Module Development 24. Chapter 19: Theme Development 25. Chapter 20: Delivering Drupal Content through APIs 26. Chapter 21: Migrating Content into Drupal 27. Chapter 22: Multisite Management 28. Index 29. Other Books You May Enjoy Appendix A - Drupal Terminology

Bootstrapping, Installing,
and Configuring a New
Drupal Project

All Drupal developers must have the fundamental skills to create Drupal applications, install them, and perform configuration. This would be considered all of the best practices to getting started with building Drupal. Drupal 10 has various practices to start new projects. A new codebase must be established, which requires understanding the basics of Composer, starting a Drupal project, and a series of commands frequently used to manage code. Next will be reviewing Drupal’s installation options, including use of Drush and recipes which are new in Drupal 10. The results of the installer will be reviewed that includes settings.php, a sites directory, a writable files directory, and more. The reader will then learn about how to change out-of-the-box Drupal settings like site, notification, caching, logging, regional, cron, and filesystem. Finally, the user will be introduced to the help section and status pages.

...

Establishing a new codebase

The first step of creating a new Drupal application is creating the codebase. And, Drupal leverages Composer to manage its code, including provisioning a new codebase.

What is Composer?

Composer is a command-line tool used to manage code in a Drupal application. Composer is not just for Drupal. Drupal adopted Composer because it is used to manage code across many PHP-based projects. This is especially helpful to manage Drupal dependencies, like Symfony projects. And, it works natively with projects hosted on Drupal.org and thus can readily manage core and community projects.

Composer requires two primary constructs to function, a “composer.json” file and a “composer.lock” file. Applications are composed of various projects and those projects are, typically, managed by Git. A built application is basically a series of projects cloned at a specific commit. The project and commit-level metadata is stored in the composer...

Installing Drupal

Once the codebase exists, it is time to install Drupal. Drupal is installed on every environment, including local systems. Drupal has two primary means of installation: through the UI, and through the command-line with Drush. Installation requires a few key requirements. And, after installation, the Drupal application can effectively bootstrap. It is only then can the application be configured.

Installation preparation

An environment should be prepared to install Drupal. It requires a database and a web server that has the proper platform requirements loaded.

Users have the option to specify which installation profile or distribution is loaded. By default, the “standard” installation profile is used that is delivered with core. This installs the most set of common features and themes. Developers commonly leverage the “testing” installation profile for a more minimal, but refined set of features aimed at creating an ideal testing...

Out-of-the-box Drupal Building

Drupal gained popularity as a low/no-code tool given its backend could readily be configured to meet a large number of common cases. A third persona of Drupal developer, beyond a backend or frontend developer, is known as a site builder. The site building activity is the combination of Drupal configuration and selection of community-provided modules to achieve the goals of an application. Modules often come with their own configuration as well. This is not an exercise of developing code but assembling existing capabilities that have been built by the community culminating in the desired intent of the Drupal application.

Developer Classification

Drupal system concepts of front-end and backend have corresponding development practices. Front-end development is considered working on Drupal themes (CSS, Twig templates, lightweight PHP) or building JavaScript-based integrations. Backend development typically refers to PHP and harnessing Drupal’...

Basic configuration

Site builders are often afforded robust configuration options that allow Drupal to be extensible while not having to get into code.

Post-installation configuration

During Drupal’s installation, the administrator is asked to select an installation profile during one of the steps. This profile enables a pre-defined set of modules and loads a default configuration. It is common to change the default configuration, especially for common use cases, like:

  • Application notifications email address, like who gets notified when updates exist
  • Enabling caching of pages
  • User registration settings, like open registration, invite-only, and closed
  • Updating the default logging mechanism
  • Enabling or disabling of core modules, like translation, web services, or various field types for your content structures
  • Enabling or disabling of comments on out-of-the-box content types

Another useful starting point is the module listing page found...

Help, logs, and reporting

Drupal core natively offers inline documentation to help guide users and features to report system logs and insights.

Help

Authenticated users can be granted access to Drupal’s native documentation found at admin/help. This is designed for multiple audiences. Help defined as a “tour” is designed to help with using Drupal. This can be as simple as editing page content or managing Drupal blocks. It also offers overviews for Drupal modules to help provide site builders more context about a module. All projects, even custom ones, are able to furnish their own documentation through Drupal’s help feature.

Logs and Reporting

Drupal maintains a robust logging and reporting system that can be helpful for administrators. All logging and reporting capabilities are found at admin/reports. This can be specific to projects, like reporting on the frequency of search terms or Views-specific usage. Or, it can be helpful in getting insights...

Summary

This chapter covered how to leverage Composer to create a new Drupal application and build its code. Setting this up properly ensures Drupal can be installed and maintained effectively. Installing Drupal through the UI or through Drush happens after the codebase is built to provide a functional Drupal application. Finally, a review of help pages, common post-install Drupal configuration, and system reporting capabilities were presented. Next chapter, readers will gain more knowledge on how to maintain Drupal.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Drupal 10 Masterclass
Published in: Dec 2023 Publisher: Packt ISBN-13: 9781837633104
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}