It has always bothered me that the theming of blocks for the page template occurred "inside" theme_page() and its overrides. It's quite unclean, and binds the two together too tightly. However, thanks to the new theme system, we don't need to do it there anymore.
The attached patch is largely just a cut/paste from template_page() to a new block_preprocess_page(), so that block creation happens there instead of in the page template itself where it doesn't belong. It's mostly just a cleanup, but it also means that there's technically no theme-level dependency on the block module anymore.
There should be no functionality changes from this patch.
Comment | File | Size | Author |
---|---|---|---|
block_preprocess.patch | 4.15 KB | Crell | |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedI tested and all is well. This does clean up the page building nicely.
When testing, I recommend changing themes in order to rebuild the theme cache so the blocks will show.
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commented1 hunk failed. sigh.
Comment #3
Crell CreditAttribution: Crell commentedI'm not going to bother rerolling this until a D7 maintainer is named. It's not worth the effort.
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedI think this was adequately cleaned up in the hook_page_alter() issue which was committed.