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
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Drupal 8

You're reading from   Mastering Drupal 8 An advanced guide to building and maintaining Drupal websites

Arrow left icon
Product type Paperback
Published in Jul 2017
Publisher Packt
ISBN-13 9781785885976
Length 456 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Chaz Chumley Chaz Chumley
Author Profile Icon Chaz Chumley
Chaz Chumley
William Hurley William Hurley
Author Profile Icon William Hurley
William Hurley
Sean Montague Sean Montague
Author Profile Icon Sean Montague
Sean Montague
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Developer Workflow FREE CHAPTER 2. Site Configuration 3. Managing Users, Roles, and Permissions 4. Content Types, Taxonomy, and Comment Types 5. Working with Blocks 6. Content Authoring, HTML5, and Media 7. Understanding Views 8. Theming Essentials 9. Working with Twig 10. Extending Drupal 11. Working with Forms and the Form API 12. RESTful Services 13. Multilingual Capabilities 14. Configuration Management 15. Site Migration 16. Debugging and Profiling

Creating a custom block


So far, we have been working with system-generated blocks. However, with the introduction of fieldable blocks in Drupal 8, we can create custom blocks. Custom blocks are quite powerful and will be used to display content in ways not possible previously without a contributed module.

Begin by navigating to the Block layout page by directly entering /admin/structure/block, or by using the Admin toolbar and clicking on Structure | Block layout.

We can create a custom block by following these steps:

  1. Locate the Sidebar second region.
  2. Click on the Place block button.
  3. Click on the Add custom block button.

We are now presented with the Add custom block screen that will allow us to create a default custom block that includes a Block description and a Body field.

We can continue filling out our custom block by entering the following values:

  1. Block description is our custom block.
  2. Body is some basic content.
  3. Click on the Save button.

Our custom block has been created, but we still need to...

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 $19.99/month. Cancel anytime
Banner background image