Drupal is a registered trademark of Dries Buytaert
Release: Drupal 10.3.6 Update released for Drupal core (10.3.6)! Release: Drupal 11.0.5 Update released for Drupal core (11.0.5)! Release: Drupal 10.2.9 Update released for Drupal core (10.2.9)! Release: Drupal 10.2.10 Update released for Drupal core (10.2.10)! Release: Drupal 10.3.7 Update released for Drupal core (10.3.7)! Release: Drupal 11.0.6 Update released for Drupal core (11.0.6)! Release: Drupal 10.3.8 Update released for Drupal core (10.3.8)! Release: Drupal 11.0.7 Update released for Drupal core (11.0.7)! Module Revived: Translation Management Tool 8.x-1.19 Module tmgmt updated after 7 months of inactivity (8.x-1.19). Usage Milestone: Account field split Module account_field_split crossed 10,000 active installs.

The Sensitive Content Warning module is a custom Drupal module designed to protect users from viewing sensitive or objectionable content. It provides a flexible and user-friendly configuration to define elements (by CSS class or ID) that should be obscured with an overlay until the user explicitly chooses to view them.

Features

It allows administrators to define specific elements, identified by CSS classes or IDs, that should be obscured with an overlay until the user explicitly chooses to view them. The module includes a customizable overlay design, featuring a warning header, description text, and a "See Content" button, providing a user-friendly way to manage sensitive content visibility.

The module’s frontend functionality dynamically identifies and overlays targeted elements using JavaScript, ensuring seamless interaction. Users can dismiss the overlay with a simple click to access the content. Administrators can configure these settings through an intuitive form in the admin interface, making adding or updating the list of blocked classes or IDs easy. Additionally, the module integrates with the Drupal Context module, enabling advanced conditional logic such as blocking content based on user roles, specific pages, or other criteria.

Designed for flexibility and scalability, the module works across various content types and layouts, ensuring compatibility with complex Drupal themes. It also prioritizes accessibility, with high-contrast text and semantic HTML to meet modern web standards. With its blend of functionality and usability, the Sensitive Content Warning module provides a comprehensive solution for managing sensitive content on Drupal sites.

Additional Requirements

Additional Requirements for Sensitive Content Warning Module
  1. Drupal Core (Version 9.x or 10.x): The module is built to work with Drupal core versions 9.x and 10.x, so you need one of these versions installed and running.
  2. Taxonomy Module (Core Module): The Taxonomy module, which is part of Drupal's core, is required for creating and managing the "Sensitive Content" taxonomy term used to mark content that should be blocked or obscured.
  3. Context Module (Optional, for automated placement): If you wish to use the Context module to automatically display the Sensitive Content Block when a node with the "Sensitive Content" taxonomy term is viewed, you must have the Context module installed and configured. This module allows for easy management of visibility conditions and actions based on specific contexts.
  4. Viewer Override (Custom Field): This field must be added to content types to indicate which content should be blocked by the module. Users will need to ensure that the "Sensitive Content" term is applied within this field for the content that needs to be obscured.
  5. JavaScript and CSS Support: The module includes custom JavaScript and CSS files to display the sensitive content overlay. Ensure that JavaScript and CSS are enabled in your Drupal setup and that there are no conflicting scripts or styles on your site that may interfere with the module's functionality.
  6. Block Module (Core Module): The Block module, which is also part of Drupal core, is required to render the Sensitive Content Block that overlays the content. It is used to place the block within a region of the site.
  7. Permissions (for Admin and Content Editors): Ensure that administrators and content editors have the necessary permissions to create and manage taxonomy terms, configure the module settings, and add the "Sensitive Content" taxonomy term to the content.

Post-Installation

  1. Enable the Module:

    Navigate to the Extend page in your Drupal admin interface (admin/modules) and enable the Sensitive Content Warning module.

  2. Create a Taxonomy Term for Sensitive Content:

    Go to Admin > Structure > Taxonomy and either create a new vocabulary or use an existing one. Within the vocabulary, create a term such as "Sensitive Content" (or another name of your choice) to represent content that should trigger the sensitive content overlay.

  3. Configure Targeted Elements:

    Navigate to the configuration page for the module, located at Admin > Configuration > Media >Sensitive Content Warning. Enter the CSS classes or IDs of the elements you want to block into the "Blocked Classes" field on the form.

  4. Set Up a Context:

    In the Context module, create a new context (admin/structure/context/add). Add a condition to activate when a node has the taxonomy term "Sensitive Content" or the term you created in Step 2. Add a reaction and assign the Sensitive Content Block to the region where your targeted content is displayed.

  5. Add Sensitive Content in the Viewer Override:

    When creating content that needs to be obscured, ensure that the term "Sensitive Content" is added in the Viewer Override field. This field ensures that the module identifies the content to obscure, applying the sensitive content overlay dynamically.

  6. Verify Content Blocking:

    Visit the node’s page to confirm that the sensitive content overlay appears, obscuring the content until the user interacts with it.

  7. Customize the Overlay (Optional):

    To match your site’s branding, you can modify the appearance of the overlay in the CSS file located in css/sensitive-content.css. For behaviour changes, adjust the JavaScript in js/sensitive-content.js.

  8. Clear Cache:

    Clear Drupal’s cache after making changes to the module configuration, taxonomy terms, or file settings to ensure that all updates are reflected on your site.

The Sensitive Content Warning module provides the core functionality for blocking and obscuring sensitive content on Drupal sites, allowing administrators to define and manage taxonomy terms. However, it is still in development, and there is room for improvement. The module’s features are functional, but enhancements are needed, including better customization options, improved user interface, and performance optimizations. Users are encouraged to provide feedback and contribute to its improvement as it evolves into a more robust tool for managing sensitive content.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Jan 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core Release date
1.0.x-dev Dev Jan 8, 2025