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

Working with templates

Templates help provide variables inside of HTML markup to define the rendering of content in Drupal. The following sections outline how to work with templates.

How to find and create templates

One of the first things you’ll need to do is figure out what template to use and create. You can find current templates that enable Twig Debug (which we talked about earlier) at /admin/config/development/settings.

Doing so will tell Drupal to output HTML comments in the markup that indicate what templates are in use, and what templates are available. Note that your theme’s templates (except Single Directory Components) will reside in the theme’s /templates directory.

Figure 19.4 – Template suggestions in rendered HTML comments

Figure 19.4 – Template suggestions in rendered HTML comments

In the preceding example, you can see under FILE NAME SUGGESTIONS: that six items are listed, with X next to the last (node.html.twig). This means that node.html.twig is in use, and...

lock icon The rest of the chapter is locked
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}