Add classes to blocks

Created on 10 July 2019, over 5 years ago
Updated 24 July 2024, 4 months ago

Problem/Motivation

Currently, no classes are added to block markup to indicate which block type template is being rendered.

Proposed resolution

Add classes to block markup using template_preprocess_block().

Remaining tasks

  • Community review

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

Beginning in [release version], classes are now added to markup for block content blocks (those placed with block layout) and inline blocks (those placed with Layout Builder).

For example, for a block of type 'accordion' rendered as an inline block, the following classes are now added: inline-block block-type--accordion. If the block is rendered as block content, then the following classes are now added: block-content block-type--accordion.

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Chris Burge

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024