Field as Block

Allows displaying individual fields from content entities as independent blocks that can be placed in any region of your theme.

fieldblock
7,936 sites
48
drupal.org

Install

Drupal 11, 10, 9 v8.x-2.3
composer require 'drupal/fieldblock:8.x-2.3'
Drupal 8 v8.x-2.2
composer require 'drupal/fieldblock:8.x-2.2'

Overview

The Field as Block module provides the ability to display any field from the current entity (node, user, taxonomy term, etc.) as an individual block. This is particularly useful when you want to separate field display from the main content area and place specific fields in different regions of your page layout.

Rather than having all fields rendered together within the entity view, this module creates derivative block plugins for each enabled entity type, allowing site builders to select a specific field and its formatter, then place that field's output anywhere on the page using the standard block layout system.

The module automatically detects the current entity being viewed from the route and renders the selected field with the configured formatter. It includes proper cache handling, translation support, and access control to ensure fields are only displayed when appropriate.

Features

  • Create blocks from any field of content entities (nodes, users, taxonomy terms, and other content entity types)
  • Select which entity types should have field blocks available through the admin configuration
  • Choose any available field from the selected entity type to display as a block
  • Configure the field formatter and its settings directly in the block configuration
  • Option to use the field's label as the block title automatically
  • Automatic detection of the current entity from the route context
  • Proper cache invalidation tied to the displayed entity
  • Full translation support - displays field values in the current language
  • Access control that checks both field access permissions and empty field status
  • Clean up utility for removing orphaned field blocks when entity types are disabled
  • Works with base fields and configurable fields alike

Use Cases

Display author information in sidebar

Create a User field block to display the author's profile picture or bio in a sidebar region on node pages, separate from the main content area.

Featured image in header region

Use a Content field block to display the node's featured image field in a header region above the main content, creating a hero image effect.

Taxonomy tags in footer

Place a Content field block configured to show the Tags field in a footer region, separating the taxonomy display from the main article body.

Custom field layouts without Layout Builder

For sites not using Layout Builder, Field as Block provides a way to break apart the entity display and place individual fields in different theme regions using standard block placement.

Reuse field display across entity types

When multiple entity types share a field (e.g., a 'Summary' field on both nodes and taxonomy terms), you can place field blocks for each type in the same region with appropriate visibility conditions.

Tips

  • Enable only the entity types you actually need to reduce clutter in the block library
  • Use the 'Use field label as block title' option to automatically generate meaningful block titles
  • Remember that field blocks are cached per route, so they automatically update when viewing different entities
  • Consider block visibility settings to show field blocks only on appropriate pages
  • Field blocks work with both base fields (like title, created date) and configurable fields (like custom text fields)

Technical Details

Admin Pages 1
Field as Block settings /admin/config/fieldblock/fieldblockconfig

Configure which entity types should have their fields available as blocks, and clean up orphaned field blocks from entity types that have been disabled or removed.

Permissions 1
Administer Field as Block settings

Allows users to access the Field as Block configuration page to enable/disable entity types and clean up orphaned blocks.

Troubleshooting 5
Block shows 'No block content' or doesn't appear

The block only displays when: 1) The current page is viewing an entity of the configured type, 2) The entity has the configured field, 3) The field is not empty, and 4) The current user has permission to view the field. Check all these conditions.

Field block not available for my custom entity type

Navigate to Administration > Configuration > System > Field as Block settings and enable your custom entity type. Only content entity types (not configuration entities) are compatible.

Orphaned blocks after disabling an entity type

Use the cleanup section on the Field as Block settings page to remove blocks that belong to disabled or removed entity types.

Block shows field in wrong language

The module includes translation support and should display the field in the current language. Ensure your entity has a translation for the current language.

Formatter settings not saving

Ensure you click 'Save block' after changing formatter settings. The formatter settings form uses AJAX to update when you change the field or formatter selection.

Security Notes 3
  • The module respects Drupal's field access system - fields are only displayed if the current user has view permission
  • Empty fields are automatically hidden, preventing display of placeholder content
  • The 'administer fieldblock' permission should be granted only to trusted administrators as it controls which entity types expose their fields