Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Release: Change Requests 2.1.9 Minor update available for module change_requests (2.1.9). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Block Content Type Visibility

18 sites No security coverage Drupal 11 · not 10
View on drupal.org

This module improves how you control block visibility based on content type. It offers a clearer interface to easily select whether a block should show or hide on specific content types, replacing Drupal core's confusing "negate" option. This makes it simpler for site builders to manage block placement.

Overview

The Block Content Type Visibility module enhances Drupal's block visibility system by providing an improved user interface for content type-based visibility conditions. It replaces the confusing "Negate the condition" checkbox with intuitive "Show/Hide" radio buttons, making it easier for site builders to control where blocks appear.

Key Features

  • User-Friendly Interface: Clear "Show for selected content types" or "Hide for selected content types" options replace the technical "negate" checkbox
  • Enhanced Core Functionality: Extends Drupal's native content type visibility condition without replacing it
  • Modern Architecture: Uses OOP Hook classes (Drupal 11.1+) for better maintainability
  • Backward Compatible: Works with both Drupal 10 and Drupal 11
  • Performance Optimized: Properly implements cache contexts for optimal performance
  • Standards Compliant: Follows Drupal coding standards and best practices

Use Cases

  • Display promotional blocks only on Article pages
  • Hide sidebar navigation on Landing Page content types
  • Show related content blocks only for specific content types
  • Control block visibility across different content types without custom code
  • Simplify block configuration for non-technical site builders

How It Works

The module provides a custom condition plugin that extends Drupal core's NodeType condition. When you configure a block's visibility settings:

  1. Navigate to Structure → Block Layout
  2. Configure any block's visibility settings
  3. Under the "Visibility" section, expand Content type
  4. Choose your visibility mode with clear radio buttons:
    • Show for the selected content types - Block appears only on selected content types
    • Hide for the selected content types - Block appears everywhere except selected content types
  5. Select one or more content types
  6. Save the block configuration

Installation

Install as you would normally install a contributed Drupal module. See the Installing Drupal Modules documentation for further information.

Via Composer (recommended)

composer require drupal/block_content_type_visibility
drush en block_content_type_visibility

Manual Installation

  1. Download and extract the module to your /modules/contrib directory
  2. Enable the module at /admin/modules or via Drush: drush en block_content_type_visibility

Why This Module?

While Drupal core provides content type visibility conditions for blocks, the "Negate the condition" checkbox can be confusing for site builders. This module improves the user experience by presenting the same functionality in a more intuitive way, making it immediately clear whether blocks will be shown or hidden for selected content types.

Depends on

Dependencies of the latest stable release

  • block Drupal core
  • node Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Nov 2025
Latest release
8 months ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Slowing

Release Timeline

Releases

Version Type Core Release date
1.0.1 Stable 11 Dec 1, 2025
1.0.x-dev Dev 11 Dec 1, 2025
1.0.0 Stable 11 Nov 28, 2025