Allow for block visibility rules

Created on 8 March 2017, over 7 years ago
Updated 25 June 2024, 5 months ago

Problem/Motivation

It would be nice if we had block visibility conditions, like Drupal 7 (eg. to allow for conditionally displaying blocks based on language). This can already be done when placing blocks with core block.module in Drupal 8.

Proposed resolution

  1. Factor out the core block visibility UI and condition resolution code.
  2. Integrate with page manager, including its contexts.

Remaining tasks

  1. Diagnose the intermittently failing JS functional tests: eg. see failures from
    1. #52 PHP 7 (2 runs, 1 fail)
    2. #52 PHP 5.5 (2 runs, 1 fail)
    3. #40 PHP 7 (3 runs, 3 fails, 2 different failures)
    4. #38 PHP 5.5
    5. #38 PHP 7 (2 runs, 1 pass, 1 fail)
    6. #37 (3 runs, 3 different failures)
  2. Make it possible for other modules to reuse the functionality: see for example 📌 Block visibility conditions Needs work (Panels). Possible solutions:
    • Factor the visibility/condition form functionality into core.
    • Factor the visibility/condition form functionality into ctools.
    • Any other ideas...?!
  3. Allow the same condition to be added more than once (which the core UI we're copying doesn't). For example if there are two term contexts, you should be able to add a condition on both of them. Should this be extracted to another issue? Will it be covered by #2284687: Redesign UI for better management of block visibility ?
Feature request
Status

Needs work

Version

4.0

Component

Code

Created by

🇳🇱Netherlands stefan.r

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024