Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Drupal 10 Masterclass
  • Table Of Contents Toc
  • Feedback & Rating feedback
Drupal 10 Masterclass

Drupal 10 Masterclass

By : Adam Bergstein
4.8 (12)
close
close
Drupal 10 Masterclass

Drupal 10 Masterclass

4.8 (12)
By: Adam Bergstein

Overview of this book

Learning Drupal can be challenging because of its robust, extensible, and powerful capability for digital experiences, making it difficult for beginners to grasp and use it for application development. If you’re looking to break into Drupal with hands-on knowledge, this Drupal 10 Masterclass is for you. With this book, you’ll gain a thorough knowledge of Drupal by understanding its core concepts, including its technical architecture, frontend, backend, framework, and latest features. Equipped with foundational knowledge, you’ll bootstrap and install your first project with expert guidance on maintaining Drupal applications. Progressively, you’ll build applications using Drupal’s core features such as content structures, multilingual support, users, roles, Views, search, and digital assets. You’ll discover techniques for developing modules and themes and harness Drupal’s robust content management through layout builder, blocks, and content workflows. The book familiarizes you with prominent tools such as Git, Drush, and Composer for code deployments and DevOps practices for Drupal application management. You’ll also explore advanced use cases for content migration and multisite implementation, extending your application’s capabilities. By the end of this book, you’ll not only have learned how to build a successful Drupal application but may also find yourself contributing to the Drupal community.
Table of Contents (31 chapters)
close
close
1
Part 1:Foundational Concepts
7
Part 2:Setting up - Installing and Maintaining
10
Part 3:Building - Features and Configuration
12
Chapter 9: Users, Roles, and Permissions
17
Part 4:Using - Content Management
21
Part 5:Advanced Topics
1
Appendix A - Drupal Terminology

Preprocessing data and PHP

Frequently, you want to modify or create variables before they reach the template. You can do this within the theme’s themename.theme file. This is a pure PHP file in which you can use hooks to do so.

To find the hook that you’re looking for, enable theme debugging at /admin/config/development/settings. When you inspect the markup for the template, you’ll see THEME HOOK.

Figure 19.6 – An example of a theme hook in the rendered markup

Figure 19.6 – An example of a theme hook in the rendered markup

In the preceding screenshot, the hook is node.

To make use of this, you can create a function called themename_preprocess_node within your theme’s themename.theme file. It takes an array as a parameter, $variables. This array contains all the variables that are available in the template:

/**
 * Implements hook_preprocess_HOOK() for node.html.twig.
 */
function themename_preprocess_node(&$variables) {
  // Create an additional variable for...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Drupal 10 Masterclass
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon