Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Context allows you to manage contextual conditions and reactions for different portions of your site. You can define rules that trigger specific actions, such as displaying certain blocks when a particular content type is viewed. It provides an administrative interface to create and manage these contexts and their associated conditions and reactions.

Context

Context allows you to manage contextual conditions and reactions for different portions of your site. You can think of each context as representing a "section" of your site. For each context, you can choose the conditions that trigger this context to be active and choose different aspects of Drupal that should react to this active context.

Think of conditions as a set of rules that are checked during page load to see what context is active. Any reactions that are associated with active contexts are then fired.

An example of a condition could be when viewing a certain node type and blocks should be placed as a reaction when viewing a page with this node type.

Included modules

  • Context UI provides an administrative interface for managing and editing Contexts. It is not necessary for the proper functioning of contexts once they are built and can be turned off on most production sites.

Drupal 8

The Drupal 8 version is a port of the Drupal 7 version.

Drupal 8 version of this module uses the built in condition plugins supplied by Drupal through the Plugin API. So any conditional plugins supplied by other modules can also be used with Context.

Reactions are also defined through the new Drupal 8 Plugin API. The context module defines a plugin type named ContextReaction that you can extend when creating your own plugins.

Modules which extend functionality of Context:

Drupal 7

The inline editor

Drupal 7 version of module includes inline editor which is activated via a "Configure Layout" contextual link on blocks that appear on the page. Note that the inline editor must be enabled in the main context settings for this link to appear.

Other included modules

  • Context layouts provides a formalized way for themes to declare and switch between page templates using Context. It is a continuation of an old Drupal themer's trick to switch to something besides the standard page.tpl.php file for a variety of special case pages like the site frontpage, login page, admin section, etc.

Dependencies

Thanks

  • Contributors: dmitrig01 (Dmitri Gaskin), Pasqualle (Bálint Csuthy), alex_b (Alex Barth), yhahn (Young Hahn), jmiccolis (Jeff Miccolis)
  • Maintainers: febbraro (Frank Febbraro), Steven Jones, tekante (Chris Johnson), boshtian (Bostjan Kovac)
  • Sponsored by Phase2 Technology & Development Seed

Activity

Total releases
1
First release
Mar 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Release date
5.0.0-rc2 Pre-release Mar 6, 2025