Seeing as so many modules and widgets need visibility settings, I think Drupal core should include something similar to project/visibility_api allowing for a centralized API for WYSIWYG's to use, blocks, etc

Comments

greenskin’s picture

+1

I would love to see something like this implemented in core. A basic API of sorts to check common interests like node type, category terms, and or paths that modules can utilize would be fantastic. Many a module utilizes the same code that the block module implements for checking visibility based on the path, with the API modules won't have to duplicate code. The visibility API could also provide a hook for contrib modules to extend visibility for their own needs or make other features available for other modules.

tjholowaychuk’s picture

I dont work with Drupal anymore, and the module needs much more love haha but yeah it belongs in core for sure

thedavidmeister’s picture

Version: 7.x-dev » 8.x-dev
Issue summary: View changes
Status: Active » Closed (won't fix)

I don't think Visibility API is on the level needed for D8, and is no longer maintained. It appears to only have role/path checking and then relies on PHP-in-the-database for everything else.

Panels and Context are much more powerful examples of this kind of idea and D8 has made many improvements to the block system.