Published on

Display a Drupal Block on every page except for a content type

Drupal

By default, the visibility conditions of Drupal blocks on Content Types allow you to choose on which content types a block is displayed, and therefore reciprocally those on which they are not displayed.

Even though this behavior seems quite logical at first glance, it only allows you to filter content types and not pages generated from programmatic routes (those from views for example). It then becomes complicated to create a condition like "Display the block on all pages of the site except on the Article content type".

Fortunately, the Block Visibility Conditions module has been created to meet this need.

Once installed and configured, a new Not Node Type visibility tab appears when configuring a block, allowing you to reverse the condition and exclude only the Article content type for example. The block will now be displayed on all pages of the site, even those generated programmatically, except on the selected content type(s).