I couldn't find this so will ask. Hav eput it as a feature request for 7 as i suspect thats where it will need to go if not already there

For most things in life we have Who, What, Where, and When

For blocks we have

"Who" -Role specific visibility settings
"What" - Block Body
"Where" - Page specific visibility settings

But what about "When"?

At present we can add some php to "Page specific visibility settings" to handle the dates, but for many users php, may be a little too much when they are starting out, and this then adds extra complexity when only specific nodes are needed, which can easily be handled with :-

Show on every page except the listed pages.
Show on only the listed pages.

What about the a "Date specific visibility setting", "Start date", "End date" and always if empty?

Comments

stevector’s picture

Version: 7.x-dev » 8.x-dev
Status: Active » Postponed

My understanding of the Blocks Everywhere initiative is that it will allow for pluggable visibility rules. These will function in a fashion very similar to pane visibility rules in Panels. It'd be easy enough to make a date range access plugin. Marking as postponed because that won't be possible until the Blocks Everywhere initiative is farther along.

http://drupal.org/sandbox/eclipsegc/1441840

David_Rothstein’s picture

This seems like the kind of thing that can already be done by contrib modules, using hook_block_list_alter().

Does it really make sense to add it as a specific feature to core? I'm not sure it's a common enough use case.

damiankloip’s picture

I think I would agree with #2. The use case isn't common enough, should be easy enough for a contrib module to do.

Anonymous’s picture

I can accept it may be considered a low usage issue as it has taken 3 years for anyone to even respond!. But I have been using this since before raising the issue, by using PHP in the Page Specific Visibility settings. Which is I guess how most people achieve the goal.

The point of the request is to make it simpler for the average user and therefore increase the usability and market penetration of Drupal.

It would also reduce the need to update yet another module

Simple use scenario. You need a block, displayed between certain dates. Maybe 'Happy New Year' etc. You know when these blocks need to be displayed, but at present you have to enable the block and disable the block. By having the dates, you can set it and get on with your life.

You may say a "contrib module" can do this, but there has to be one that 'does' do this, which means you need someone with enough knowledge to create one. The administartive costs of an additional module must be far greater than adding what I would assume is 2 extra fields and a small amount of code to core to include validation and implementation of the data.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

longwave’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

I don't think this is a common enough feature request to include in core but this is solved in contrib: https://www.drupal.org/project/block_date