Drupal is a registered trademark of Dries Buytaert
Release: Drupal 11.4.5 Update released for Drupal core (11.4.5)! Release: Drupal 10.6.15 Update released for Drupal core (10.6.15)! Release: Superfish Dropdown Menu 8.x-1.15 Minor update available for module superfish (8.x-1.15). Release: Leaflet 10.4.10 Minor update available for module leaflet (10.4.10). Release: Raven: Sentry Integration 7.5.1 Minor update available for module raven (7.5.1). Release: htmLawed 8.x-3.8 Minor update available for module htmlawed (8.x-3.8). Release: Raven: Sentry Integration 7.5.0 Minor update available for module raven (7.5.0). Module Revived: Media Library Form API Element 2.1.5 Module media_library_form_element updated after 10 months of inactivity (2.1.5). Release: Acquia Content Optimization 2.1.0-alpha1 First alpha version released for module conductor (2.1.0-alpha1). Usage Milestone: Manage display Module manage_display crossed 1,000 active installs.

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.

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 Release date
1.0.1 Stable Dec 1, 2025
1.0.x-dev Dev Dec 1, 2025
1.0.0 Stable Nov 28, 2025