Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
block.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Apr 2009 at 13:51 UTC
Updated:
4 Nov 2009 at 15:40 UTC
Drupal's caching system is powerful and great. But, there are times where we want to make alterations at the point where something is viewed. For the node system we use hook_node_view (used to be hook_nodeapi with view $op). With this we can add stylesheets, JavaScript, and do other things at the point it's viewed.
We can't do that with blocks. If JavaScript is added in the body of a block and that block is cached we can't add css or JS there. The common way to get around it is to add that to every page.
So, let's add a hook_block_view_alter and/or a hook_block_view_MODULE_DELTA_alter to _block_render_blocks(). We could make these alterations and let other modules act on the blocks as well.
Comments
Comment #1
David_Rothstein commentedNote that the latest patch at #473268-152: D7UX: Put edit links on everything would add these hooks as a side effect.
Comment #2
David_Rothstein commented#473268: D7UX: Put edit links on everything was committed, so those hooks are now added.