Reader small image

You're reading from  Drupal 10 Masterclass

Product typeBook
Published inDec 2023
PublisherPackt
ISBN-139781837633104
Edition1st Edition
Tools
Concepts
Right arrow
Author (1)
Adam Bergstein
Adam Bergstein
author image
Adam Bergstein

Adam Bergstein is a product engineering leader and an architect. He has been a long-time Drupal community member, a routine speaker at Drupal community events around the globe, and provided keynotes for several events. He has maintained and contributed to many Drupal projects, including Password Policy, Taxonomy Menu, and more. Adam is the lead of Simplytest, a free service, and a project that offers Drupal community members testing sandboxes. He has also worked for both agencies building Drupal applications and Drupal service providers building Drupal-related products. He has led the Drupal Community Governance Task Force and is serving a term as a community board member of the Drupal Association.
Read more about Adam Bergstein

Right arrow

Drupal Core,
Modules, and Themes

Drupal starts with a powerful, foundational core that all Drupal applications build from. This chapter describes what core is, how it was conceptually created, how to harness it to create a Drupal application, and how an application can be extended beyond just core. Learning how to create Drupal applications starts with enabling and configuring Drupal core features. It is only after leveraging core that the application should be extended through contributed and/or custom projects. This chapter serves as the foundation for configuring applications, understanding high-level architecture, and then solving additional problems through extended projects.

In this chapter, we’re going to cover the following main topics:

  • Drupal core
  • Overview of Drupal projects
  • Drupal modules
  • Drupal themes
  • Contribution

Drupal core

Drupal core is the foundation of every Drupal application. It represents all out-of-the-box Drupal features and contains the framework every Drupal application is built on. It has the most rigorous contribution process while having the largest amount of contribution activity.

While Drupal itself, as an open source project, is free, it should be viewed more through the perspective of “free like a puppy.” Drupal code is freely available, and there is a vast community helping to maintain and support it. However, Drupal applications require ongoing maintenance. Major and minor upgrades need to be performed to update the code. The underlying servers and platform need to be maintained as core evolves its platform dependencies. The community helps promote efforts to more seamlessly and automatically perform code updates, but adopters are still largely responsible for running their own platforms or picking a commercial PaaS offering. This takes ongoing work and...

Overview of Drupal projects

Drupal core leverages projects as the construct for its modularity. Projects are built with code and harness Drupal core’s framework to customize Drupal. Community members have contributed their projects on drupal.org. Projects created for the specific needs of a Drupal application are known as custom. Custom projects are intended to add specific business logic that may be unique to an organization, integrate internal enterprise systems, or add specific company branding.

Important note

Before creating custom projects, evaluate the contributed projects on drupal.org. Given the maturity of the Drupal project and the vast number of contributions, it is common to find a contributed project that can help address the desired use case. This all assumes the feature is not provided by the core itself.

Projects are managed by Drupal core for the application. Core can install, enable, and disable projects. Each version of the project is managed so that...

Drupal modules

The first type of project is known as a module.

What is a module?

A module is a code that leverages Drupal’s framework for backend customization. This often modifies the Drupal application and is processed within the server. The core itself organizes its features by leveraging modules. This way, each application can control which core modules are installed based on the desired needs of the application.

Modules have compatibility with the core. Every major version of the core modifies its framework. Given the framework changes, modules must provide metadata that defines their compatibility with major core versions. It should not be assumed that every module found on drupal.org is compatible with the version of Drupal on the application. In fact, given that Drupal now has 10 major versions, basic searches for modules can find modules dating back to early versions of Drupal. Popular modules from earlier versions may have even been moved into core in later...

Drupal themes

The second type of project is a theme.

What is a theme?

Drupal themes are front-end development projects that leverage the core’s visual system to control the look and feel of the Drupal application. A theme can be the visual presentation of content for end users. It can also be the theme used for the administrative experience of the Drupal application, known as an admin theme.

Themes control the HTML, CSS, and JavaScript used for the Drupal application. HTML is created through the use of templates. Based on the enabled features, content-related features define expected templates that map variables provided by the backend to the corresponding HTML. Templates leverage the Twig framework for functionality and syntax. A theme registers the templates, CSS, and JavaScript, which can then be subsequently enabled in Drupal.

Core themes

The most well-known themes are provided by Core. Core themes provide useful examples for integrating with all core-related...

Contribution

Drupal core, modules, and themes are not even possible without developers contributing their efforts. As an open-source project, Drupal has managed to attract a large number of contributors throughout the globe. These community members provide complementary ideas, build new Drupal projects, create bugs, submit fixes, write documentation, give talks at events, and more. These contributions have helped Drupal become one of the most established open-source projects—a project with longevity and one that continues to be relevant. Without the community, there would be no Drupal. It also emphasizes the importance of Drupal adopters finding ways to give back.

Community contributions will be covered in much greater detail in Chapter 4.

Summary

Drupal core provides both foundational features and an extensible framework that can be used for building the application and customization. Projects provide modularity built into Drupal core. Drupal has projects for both frontend and backend development through its themes and modules. The community and contributions to Drupal core help to continually evolve and improve this foundation, and extending Drupal can often yield useful community contributions and address the needs of enterprise integrations. The next chapter covers the infrastructure needed to run Drupal and more about Drupal’s technical architecture.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Drupal 10 Masterclass
Published in: Dec 2023Publisher: PacktISBN-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.
undefined
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

Author (1)

author image
Adam Bergstein

Adam Bergstein is a product engineering leader and an architect. He has been a long-time Drupal community member, a routine speaker at Drupal community events around the globe, and provided keynotes for several events. He has maintained and contributed to many Drupal projects, including Password Policy, Taxonomy Menu, and more. Adam is the lead of Simplytest, a free service, and a project that offers Drupal community members testing sandboxes. He has also worked for both agencies building Drupal applications and Drupal service providers building Drupal-related products. He has led the Drupal Community Governance Task Force and is serving a term as a community board member of the Drupal Association.
Read more about Adam Bergstein