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

David_Rothstein’s picture

Note that the latest patch at #473268-152: D7UX: Put edit links on everything would add these hooks as a side effect.

David_Rothstein’s picture

Status: Active » Fixed

#473268: D7UX: Put edit links on everything was committed, so those hooks are now added.

Status: Fixed » Closed (fixed)

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