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.

CommentFileSizeAuthor
#1 block-2272801-1.patch751 bytestim.plunkett

Comments

tim.plunkett’s picture

Status: Active » Needs review
StatusFileSize
new751 bytes
benjy’s picture

Status: Needs review » Reviewed & tested by the community

Hard to believe it was so simple, I really like this idea.

tim.plunkett’s picture

Also I should mention that I ran this by @EclipseGc before posting the issue, and he was +1.

berdir’s picture

This just makes the default implementation implement those methods, shouldn't BlockPluginInterface also extend ContextAwarePluginInterface?

eclipsegc’s picture

No, 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

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed da13333 and pushed to 8.x. Thanks!

  • Commit da13333 on 8.x by alexpott:
    Issue #2272801 by tim.plunkett: Allow blocks to be context aware.
    
tim.plunkett’s picture

Assigned: tim.plunkett » Unassigned

Thanks. Opened #2273381: Convert ContextAwarePluginBase to traits for a future generic solution.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.