Book Image

Drupal 8 Development Cookbook - Second Edition

By : Matt Glaman
Book Image

Drupal 8 Development Cookbook - Second Edition

By: Matt Glaman

Overview of this book

Began as a message board, Drupal today is open source software maintained and developed by a community of over 1,000,000 users and developers. Drupal is used by numerous local businesses to global corporations and diverse organizations all across the globe. With Drupal 8’s exciting features it brings, this book will be your go-to guide to experimenting with all of these features through helpful recipes. We’ll start by showing you how to customize and configure the Drupal environment as per your requirements, as well as how to install third-party libraries and then use them in the Drupal environment. Then we will move on to creating blocks and custom modules with the help of libraries. We will show you how to use the latest mobile-first feature of Drupal 8, which will help you make your apps responsive across all the major platforms. This book will also show you how to incorporate multilingual facilities in your sites, use web services and third-party plugins with your applications from inside Drupal 8, and test and deploy your apps.
Table of Contents (20 chapters)
Title Page
About the Author
About the Reviewer
Customer Feedback

Using the Responsive Image module

The Responsive Image module provides a field formatter for image fields that use the HTML5 picture tag and source sets. Utilizing the Breakpoint module, mappings to breakpoints are made to denote an image style to be used at each breakpoint.

The responsive image field formatter works with using a defined responsive image style. Responsive image styles are configurations that map image formats to specific breakpoints and modifiers. First, you will need to define a responsive image style, and then you can apply it to an image field.

In this recipe, we will create a responsive image style set called Article image and apply it to the Article content type's image field.

Getting ready

You will need to enable the Responsive Image module, as it is not automatically enabled with the standard installation.

How to do it...

  1. Go to Configuration and then to Responsive image styles under the MEDIA section. Click on Add responsive image style to create a new style set.
  2. Provide...