Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

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.

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 Release date
1.x-dev Dev Dec 10, 2023
1.0.0-beta3 Pre-release Dec 10, 2023
1.0.0-beta2 Pre-release Dec 10, 2023
1.0.0-beta1 Pre-release Dec 10, 2023