Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Mastering Drupal 8
Mastering Drupal 8

Mastering Drupal 8: An advanced guide to building and maintaining Drupal websites

Arrow left icon
Profile Icon Sean Montague Profile Icon Chaz Chumley Profile Icon William Hurley
Arrow right icon
€18.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.2 (5 Ratings)
Paperback Jul 2017 456 pages 1st Edition
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Sean Montague Profile Icon Chaz Chumley Profile Icon William Hurley
Arrow right icon
€18.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.2 (5 Ratings)
Paperback Jul 2017 456 pages 1st Edition
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€20.98 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. €18.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Mastering Drupal 8

Site Configuration

Site configuration is probably one of the most important tasks any developer will need to perform when first creating a Drupal project. Establishing a baseline configuration for Drupal projects ensures that, as we begin to further develop our website, we have accounted for how users will be able to upload files, how dates will be displayed, and even how content will be cached.

However, sometimes site configuration can be overlooked as a few items get configured for us during the installation process; for example, Basic site settings such as the Site name, email address, and Regional settings. Depending on the size of your Drupal project, you may think why bother with any additional site configuration?

In this chapter, we will be exploring Drupal 8 from an administrator or site builder's point of view and explain why it is important to configure your site...

Assumptions

Mastering Drupal 8 assumes that you are already running a local AMP stack and are familiar with installing Drupal using the standard means of downloading, setting up a database, configuring a local host, and completing the browser-based install. In Chapter 1, Developer Workflow, we walked through quickly installing Drupal using Composer, Drush, and Drupal Console. Ensure that you have a working AMP stack and are comfortable working within the command-line interface using a Terminal window before continuing.

Exploring Drupal's interface

By default, Drupal has two interfaces we can work with. The first is what any visitor to our site will see, consisting of content and blocks displayed in various regions on the page. This is often referred to as the anonymous user's view:

The second interface, known as the administrator interface, requires us to be logged in to a Drupal instance. We can log in by clicking on the login link or by navigating to /user/login and entering the user credentials that were created when Drupal was first installed:

Once logged in we are considered to be authenticated and, since we are logged in as User one, which is the Super User, we are also considered to be an administrator and are presented with an Admin toolbar.

The Admin toolbar itself is separated into three different functional areas: Manage, Shortcuts, and admin. Each of these sections organize...

Basic site settings

Changes to the Site name, Email address, default front page, and error pages can all be configured under the Basic site settings of Drupal. This section of Drupal can often be overlooked since both the Site name and Email address fields are configured for us during installation. However, the Basic site settings control more than just these two fields, and it is important to know where they are located and how to modify these values using all the tools made available to us.

We can navigate to the Basic site settings by directly entering the URL of /admin/config/system/site-information, or by using the Admin toolbar and clicking on Manage | Configuration | Basic site settings:

The Basic site settings for Drupal contain three subsections:

  • SITE DETAILS
  • FRONT PAGE
  • ERROR PAGES
...

Configuration overrides

Managing configuration within Drupal does not always involve changing settings within the administrative panels of a specific section. In fact, Drupal also allows various settings to be configured within the settings.php file. Configuration settings within the settings.php file act as global overrides to those in the database. Some settings, as we will see, can only be set or modified from the settings.php file.

The settings.php file can be located within the /sites/default folder of a Drupal installation.

Keep in mind that the file permissions are set to read only; so, it is important to temporarily modify the permissions to be writeable before making any changes.

Once we have made the settings.php file writeable, we can open it within our favorite editor and locate the Configuration overrides section:

­

Reading through the Configuration overrides...

Using Drush to manage configuration

Drush allows us to perform a multitude of tasks using the command line to interact with Drupal. A handful of commands that allow us to manage configuration include drush config-list, drush config-get, and drush config-set. Let's look at how we would use each of these to manage Basic site settings.

Listing configuration variables

If we open a Terminal window and navigate to our Drupal instance, we can enter the following command to see a list of variables:

    drush config-list

Retrieving specific variables

We can also retrieve...

Assumptions


Mastering Drupal 8 assumes that you are already running a local AMP stack and are familiar with installing Drupal using the standard means of downloading, setting up a database, configuring a local host, and completing the browser-based install. In Chapter 1, Developer Workflow, we walked through quickly installing Drupal using Composer, Drush, and Drupal Console. Ensure that you have a working AMP stack and are comfortable working within the command-line interface using a Terminal window before continuing.

Exploring Drupal's interface


By default, Drupal has two interfaces we can work with. The first is what any visitor to our site will see, consisting of content and blocks displayed in various regions on the page. This is often referred to as the anonymous user's view:

The second interface, known as the administrator interface, requires us to be logged in to a Drupal instance. We can log in by clicking on the login link or by navigating to /user/login and entering the user credentials that were created when Drupal was first installed:

Once logged in we are considered to be authenticated and, since we are logged in as User one, which is the Super User, we are also considered to be an administrator and are presented with an Admin toolbar.

The Admin toolbar itself is separated into three different functional areas: Manage, Shortcuts, and admin. Each of these sections organize the functionality based on the tasks that need to be performed, which include everything from managing content, providing...

Basic site settings


Changes to the Site name, Email address, default front page, and error pages can all be configured under the Basic site settings of Drupal. This section of Drupal can often be overlooked since both the Site name and Email address fields are configured for us during installation. However, the Basic site settings control more than just these two fields, and it is important to know where they are located and how to modify these values using all the tools made available to us.

We can navigate to the Basic site settings by directly entering the URL of /admin/config/system/site-information, or by using the Admin toolbar and clicking on Manage | Configuration | Basic site settings:

The Basic site settings for Drupal contain three subsections:

  • SITE DETAILS
  • FRONT PAGE
  • ERROR PAGES

SITE DETAILS

The SITE DETAILS section contains the Site name, Slogan, and Email address fields. Depending on how an installation is completed, there will always be values for both Site name and Email address...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • The most up-to-date advanced practical guide on Drupal 8 with an in-depth look at all the advanced new features such as authoring, HTML markup, built-in web services, and more
  • If you are looking to dive deep into Drupal 8 and create industry-standard web apps, then this is the ideal book for you
  • All the code and examples are explained in great detail to help you in the development process

Description

Drupal is an open source content management system trusted by governments and organizations around the globe to run their websites. It brings with it extensive content authoring tools, reliable performance, and a proven track record of security. The community of more than 1,000,000 developers, designers, editors, and others have developed and maintained a wealth of modules, themes, and other add-ons to help you build a dynamic web experience. Drupal 8 is the latest release of the Drupal built on the Symfony2 framework. This is the largest change to the Drupal project in its history. The entire API of Drupal has been rebuilt using Symfony and everything from the administrative UI to themes to custom module development has been affected. This book will cover everything you need to plan and build a complete website using Drupal 8. It will provide a clear and concise walkthrough of the more than 200 new features and improvements introduced in Drupal core. In this book, you will learn advanced site building techniques, create and modify themes using Twig, create custom modules using the new Drupal API, explore the new REST and Multilingual functionality, import, and export Configuration, and learn how to migrate from earlier versions of Drupal.

Who is this book for?

This book is ideally suited to web developers, designers, and web administrators who want to dive deep into Drupal. Previous experience with Drupal is a must to unleash the full potential of this book.

What you will learn

  • Discover how to better manage content using custom blocks and views
  • Display content in multiple ways, taking advantage of display modes
  • Create custom modules with YAML and Symfony 2
  • Easily translate content using the new multilingual capabilities
  • Use RESTful services and JavaScript frameworks to build headless websites
  • Manage Drupal configuration from one server to another easily

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jul 27, 2017
Length: 456 pages
Edition : 1st
Language : English
ISBN-13 : 9781785885976
Languages :
Concepts :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. €18.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Jul 27, 2017
Length: 456 pages
Edition : 1st
Language : English
ISBN-13 : 9781785885976
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 106.97
Mastering Drupal 8
€36.99
Drupal 8 Blueprints
€32.99
Drupal 8 Development Cookbook
€36.99
Total 106.97 Stars icon

Table of Contents

16 Chapters
Developer Workflow Chevron down icon Chevron up icon
Site Configuration Chevron down icon Chevron up icon
Managing Users, Roles, and Permissions Chevron down icon Chevron up icon
Content Types, Taxonomy, and Comment Types Chevron down icon Chevron up icon
Working with Blocks Chevron down icon Chevron up icon
Content Authoring, HTML5, and Media Chevron down icon Chevron up icon
Understanding Views Chevron down icon Chevron up icon
Theming Essentials Chevron down icon Chevron up icon
Working with Twig Chevron down icon Chevron up icon
Extending Drupal Chevron down icon Chevron up icon
Working with Forms and the Form API Chevron down icon Chevron up icon
RESTful Services Chevron down icon Chevron up icon
Multilingual Capabilities Chevron down icon Chevron up icon
Configuration Management Chevron down icon Chevron up icon
Site Migration Chevron down icon Chevron up icon
Debugging and Profiling Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.2
(5 Ratings)
5 star 80%
4 star 0%
3 star 0%
2 star 0%
1 star 20%
D. Gutierrez Sep 28, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I was struggling to figure out what I needed to know first. I was coming from maintaining a Drpual 7 site to working on Drupal 8. However the environment was new to me. I had to understand Git, Composer, and the order of doing things.I love this book because it starts at the beginning and takes you through the steps to build the working environment. And from there it gets better and better. Perfect book to get you into the new environment, and easy to read. I would think it would be great for anyone new to Drupal as well. You can do a lot with Drupal, and quickly too. Great book.
Amazon Verified review Amazon
Sock Fight All Star May 29, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
If you're an experienced Drupal 7 developer or you just still feel clumsy in Drupal 8/9 because you keep forgetting some of the fundamentals even if you're already doing very advanced things elsewhere, this is a great book. It's about three years old at the time of this review, but this is still an excellent book. It's aged well.Drupal builders of all levels should find something useful in this book, but I think the people who would benefit the most from it are experienced developers who know how things work, but are just forgetful and need something to jog their memories. It's not a book that goes in depth about anything. It's an inch deep and a mile wide, which is exactly the kind of book I was hoping it would be.
Amazon Verified review Amazon
Stonewall Thomas Aug 05, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book has been great for going from Drupal 7 to Drupal 8. I must say that the first 2/3 of it isn't all that mind-blowing if you're already a Drupal 7 dev, but it does get to the good stuff later on.
Amazon Verified review Amazon
Cliente Amazon Apr 10, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great book with good dynamics and great content. I understand that more detail about creating modules would make content much more efficient.
Amazon Verified review Amazon
Tom Judge May 09, 2021
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
The first chapter is outdated and instructions given do not work properly
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.