Problem/Motivation
The Context API is not used in HEAD. However, if blocks were able to receive context, they'd finally be a full replacement for CTools "content types", which are used for panes in Panels.
Proposed resolution
All that is needed is to change BlockBase to be ContextAware, and then blocks can begin to define their own contexts.
Remaining tasks
User interface changes
API changes
This is an API addition, not an API change. And it's useless until something starts *setting* context on blocks. See http://drupal.org/project/page_manager.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | block-2272801-1.patch | 751 bytes | tim.plunkett |
Comments
Comment #1
tim.plunkettComment #2
benjy commentedHard to believe it was so simple, I really like this idea.
Comment #3
tim.plunkettAlso I should mention that I ran this by @EclipseGc before posting the issue, and he was +1.
Comment #4
berdirThis just makes the default implementation implement those methods, shouldn't BlockPluginInterface also extend ContextAwarePluginInterface?
Comment #5
eclipsegc commentedNo, I don't think so. There are changes coming to the BlockInterface (hopefully) but I don't think this needs to be amongst them. I'm ++ to this change, but I don't think the interface needs any updating. Blocks can be context aware w/o forcing all blocks to be context aware.
Eclipse
Comment #6
alexpottCommitted da13333 and pushed to 8.x. Thanks!
Comment #8
tim.plunkettThanks. Opened #2273381: Convert ContextAwarePluginBase to traits for a future generic solution.