Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Conditional Features

No security coverage Under active development

This module allows site administrators to enable or disable other modules based on predefined conditions. It leverages Drupal's Condition Plugin API to manage these dependencies, offering flexibility in controlling which features are active.

Conditional Features provides the ability to enable or disable modules based on conditions set by the site administrator.

Features

It utilises Condition Plugin API in the same manner as Drupal entities such as Blocks are able to do.

It also provides its own Condition plugin which enables Blocks and other entities that take advantage of the Condition Plugin API to be enabled or disabled based on Conditional Features.

Installation

Install using composer in the usual fashion:

composer require drupal/conditional_features

Post-Installation

After installation, visit /admin/structure/conditional-features to create and manage conditional features.

A Conditional Features Manager service is provided to allow developers to interact with conditional features that have been created.

Get instance of the Conditional Features Manager:

$conditional_features_manager = \Drupal::service('conditional_features.manager');

Get an array of all conditional features:

$features = $conditional_features_manager->getFeatures();

Get an array of only enabled conditional features:

$features = $conditional_features_manager->getEnabledFeatures();

Get the state of a conditional feature (by ID);

$state = $conditional_features_manager->isEnabled('disabled_feature');
$state = $conditional_features_manager->isEnabled('enabled_feature');

Similar projects

Feature Flags: Possibly feature complete but doesn't appear to be supported any longer (over a year since last update).

Feature Toggle: Doesn't appear to be supported/maintained any longer (over a year since last updates, lots of open tickets that haven't had any attention)

Switches: Maintainer has suggested this project is abandoned and to use one of the alternatives.

Ask your assistant about Conditional Features

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

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
4
Tracked since
Dec 2023
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
1.x-dev Dev 9–10 Dec 10, 2023
1.0.0-beta3 Pre-release 9–10 Dec 10, 2023
1.0.0-beta2 Pre-release 9–10 Dec 10, 2023
1.0.0-beta1 Pre-release 9–10 Dec 10, 2023