Book description
Master Drupal 8’s new Twig templating engine to create fun and fast websites with simple steps to help you move from concept to completion
About This Book
- Create beautiful responsive Drupal 8 websites using Twig
- Quickly master theme administration, custom block layouts, views, and the Twig template structure
- A step-by-step guide to the most common approaches in web design
Who This Book Is For
This book is intended for front-end developers, designers, and anyone who is generally interested in learning all the new features of Drupal 8 theming. Discover what has changed from Drupal 7 to Drupal 8 and immerse yourself in the new Twig PHP templating engine. Familiarity with HTML5, CSS3, JavaScript, and the Drupal Admin interface would be helpful. Prior experience with setting up and configuring a standalone development environment is required as we will be working with PHP and MySQL.
What You Will Learn
- Navigate the Drupal 8 Admin interface
- Build custom block layouts with reusable and fieldable blocks
- Create subthemes based on the Bartik and Classy base themes
- Construct a responsive theme with Twitter Bootstrap
- Work with the new Twig PHP templating engine
- Configure Drupal for Twig debugging
- Enable preprocessing of Twig variables
- Develop a theme from scratch following a step-by-step project outline
In Detail
Drupal 8 is an open source content management system and powerful framework that helps deliver great websites to individuals and organizations, including non-profits, commercial, and government around the globe. This new release has been built on top of object-oriented PHP and includes more than a handful of improvements such as a better user experience, cleaner HTML5 markup, a new templating engine called Twig, multilingual capabilities, new configuration management, and effortless content authoring. Drupal 8 will quickly become the new standard for deploying content to both the web and mobile applications. However, with so many new changes, it can quickly become overwhelming knowing where to start and how to quickly.
Starting from the bottom up, we will install, set up, and configure Drupal 8. We’ll navigate the Admin interface so you can learn how to work with core themes and create new custom block layouts. Walk through a real-world project to create a Twig theme from concept to completion while adopting best practices to implement CSS frameworks and JavaScript libraries. We will see just how quick and easy it is to create beautiful, responsive Drupal 8 websites while avoiding the common mistakes that many front-end developers make.
Style and approach
Drupal 8 Theming with Twig is intended for front-end developers, designers, and anyone who is generally interested in learning all the new features of Drupal 8 theming. Discover what has changed from Drupal 7 to Drupal 8 and immerse yourself in the new Twig PHP templating engine. Familiarity with HTML5, CSS3, JavaScript, and the Drupal Admin interface would be helpful. Prior experience with setting up and configuring a standalone development environment is required as we will be working with PHP and MySQL.
Table of contents
-
Drupal 8 Theming with Twig
- Table of Contents
- Drupal 8 Theming with Twig
- Credits
- About the Author
- Acknowledgments
- About the Reviewer
- www.PacktPub.com
- Preface
- 1. Setting Up Our Development Environment
- 2. Theme Administration
-
3. Dissecting a Theme
- Setting up a local development environment
- Default themes versus custom themes
- Folder structure and naming conventions
- Managing configuration in Drupal 8
- Reviewing the new info.yml file
- The role of templates in Drupal
- Creating our first basic theme
- Introducing Twig
- Template variables
- The role of the theme file in Drupal
- Summary
- 4. Getting Started – Creating Themes
- 5. Prepping Our Project
-
6. Theming Our Homepage
- Creating our HTML wrapper
- Creating our homepage
- Implementing our Header Top region
-
Implementing our Header region
- Adding a logo
- Enabling Site branding
- Printing our Header region
- Creating Block templates
- Implementing our search form block
- Placing our search form block
- Creating a search form block template
- Adding custom JavaScript
- Creating an input element template
- Working with menus
- Creating a menu template
- Creating System Menu block template
- Creating a sticky header
- Implementing our Headline Region
- Implementing our Before Content region
- Implementing the footer
- Summary
- 7. Theming Our Interior Page
-
8. Theming Our Blog Listing Page
- Reviewing the Blog Listing mockup
- Creating our blog listing
- Creating a Post Listing view
- Managing our Post Listing block
-
Implementing our Node template
- Adding CSS classes to Twig
- Working with content variables
- Using the without filter
- Creating our post image slider
- Working with field templates
- Adding the Owl Carousel library
- Using Twig filters for dates
- Printing title and teaser
- Creating our post metadata
- Field templates and taxonomy
- Handling comments in Drupal 8
- Creating a theme file
- Creating a Categories block
- Managing our Categories block
- Implementing responsive sidebars
- Theming a Block template
- Drupal Views and Twig templates
- Managing popular versus recent content
- Adding the About Us block
- Summary
-
9. Theming Our Blog Detail Page
- Reviewing the Blog detail mockup
- Previewing our Blog detail page
- Creating a Post Full template
- Working with comments
- Implementing social sharing capabilities
- Summary
- 10. Theming Our Contact Page
- 11. Theming Our Search Results
- 12. Tips, Tricks, and Where to Go from Here
- Index
Product information
- Title: Drupal 8 Theming with Twig
- Author(s):
- Release date: March 2016
- Publisher(s): Packt Publishing
- ISBN: 9781782168737
You might also like
book
Drupal 8 Module Development
Learn to create and customize impressive Drupal 8 modules to extend your website's functionalities About This …
book
Mastering Drupal 8 Views
Accelerate your development process using Drupal 8 Views with this advanced, practical guide About This Book …
book
Drupal 8: Enterprise Web Development
Harness the power of Drupal 8 to create enterprise-grade, highly scalable websites About This Book Build …
video
Learning Drupal 8
In this Learning Drupal 8 training course, expert author Rain Michaels teaches you the basic building …