Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll

Articles

13/04/2025, by Ivan

This documentation is for modules. For information about themes, see Adding stylesheets (CSS) and JavaScript (JS) to a Drupal 8 theme.

In Drupal 8, stylesheets (CSS) and JavaScript (JS) are loaded using the same system for both modules (code) and themes: the asset library. Asset libraries can include one or more CSS resources, one or more JS resources, and one or more JS settings.

13/04/2025, by Ivan

API Features

Organized by the least frequently used APIs:

Authentication Provider Services
Implement \Drupal\Core\Authentication\AuthenticationProviderInterface and use the service tag 'authentication_provider'.

_auth Option on Routes
The default authentication manager (see below) allows developers to restrict the set of allowed authentication mechanisms to a specified subset by defining _auth in the route options.
Example: _auth: ['basic_auth', 'cookie']

13/04/2025, by Ivan

Overview

Blocks in Drupal 8 actually consist of two separate API structures to create a user interface similar to previous iterations of Drupal. These two APIs are the Block Plugin API, which is a reusable standalone API, and the Block Entity API, which is a Drupal 8-specific implementation for placing blocks and controlling their visibility.

13/04/2025, by Ivan

The Cache API has been significantly improved in Drupal 8. The following sections explore each feature in more detail.

For a quick overview, see the Cache API documentation page.

Cacheability Metadata

Everything that is rendered directly or used to determine what to render provides cacheability metadata — from access results to entities and URLs.

Cacheability metadata consists of three properties:

13/04/2025, by Ivan

Cache contexts = (request) contextual dependencies

Cache contexts are similar to the HTTP Vary header.

Why?

Cache contexts provide a way to create context-dependent variants of something that needs to be cached. It makes caching logic easier to read and avoids repeating the same conditional logic wherever context-based variation is needed.

Examples:

13/04/2025, by Ivan

Cache max-age = time-based dependencies

Cache max-age is similar to the HTTP max-age directive in the Cache-Control header.

Why?

Cache max-age provides a declarative way to create time-based cache dependencies.

13/04/2025, by Ivan

Varnish Cache is a web application accelerator, also known as a caching HTTP reverse proxy. Varnish is used on thousands of Drupal sites to increase page load performance by 10-1000x, and it can be used with cache tags to simplify cache invalidation.

For basic cache tag integration, you need to do three things to ensure Varnish works well with the cache tags generated by Drupal: