Book Image

Learning Drupal 8

By : Nick Abbott
Book Image

Learning Drupal 8

By: Nick Abbott

Overview of this book

Drupal 8 sets a new standard for ease of use, while offering countless new ways to tailor and deploy your content to the Web. Drupal 8 allows user to easily customize data structures, listings, and pages, and take advantage of new capabilities for displaying data on mobile devices, building APIs, and adapting to multilingual needs. The book takes you step by step through building a Drupal 8 website. Start with the basics, such as setting up a local “stack” development environment and installing your first Drupal 8 site, then move on to image and media handling, and extending Drupal modules. Push your knowledge by getting to grips with the modular nature of Drupal, and learning to extend it by adding new functionalities to create your new modules. By the end of the book, you will be able to develop and manage a modern and responsive website using Drupal.
Table of Contents (21 chapters)
Learning Drupal 8
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Blocks


If you have a layout that contains sidebars, headers, or footers, you will most likely have content that is repeated between pages. If you edit this content in one place, you would expect it to be updated on every page.

This is where blocks come in.

In Drupal 8, there is another entity type called a block.

A block is a piece of content that can be placed in a specific region of a page, and you can set rules that determine when (on which actual pages) the block appears, depending on various conditions such as the page URL or the currently logged in user's role(s).

An example of a block is the Main menu.

A typical simple website page template will often have a header, footer, and perhaps, left and right sidebar regions as shown in the following diagram:

Within these page template regions, you can add repeating content such as the site logo, a menu, shopping cart, terms and conditions, or other items of content.

Because Drupal is a modular framework, modules can define a block that you can...