I have created a submodule trying to solve the blocks ordering problem when multiple contexts placed blocks i the same region. Our company has been running a version of this module in production for the d6-version of context for over a year without issues. I have now cleaned it up a bit and ported to d7.

Thes d6-version works without significant changes in the context-module itself, but since d7-version is using hook_page_build for building the blocks, not the theme registry, I could think of no good way of overriding this except making some small changes. Because of this it was also possible to minimize and simplify the code base compared to the d6-version.

I have not tested the patch all that exhaustively yet, but so far I can tell it's working good. The block placement concept of the module is probably not obvious, so could need some UI-improvements to make things clearer. The plugin looks just like the blocks-reaction, but does not place any blocks. Instead it uses it's block's weights as a template when more than one block-reaction tries to occupy the same region with blocks. Also, not really happy with the name as it is not very descriptive. Perhaps "Context block weight manager", or "Context block layout" is better? I'm not sure.

If you want a more elaborate explanation concerning motivations behind the changes, or how the module works in general, just ask away.

CommentFileSizeAuthor
#1 context-block-weights-1668580-1.patch18.91 KBgnucifer
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gnucifer’s picture

Status: Active » Needs review
FileSize
18.91 KB
shunting’s picture

Version: 7.x-3.x-dev » 6.x-3.0-rc2

Would it be possible to release the d6 version?

duellj’s picture

Version: 6.x-3.0-rc2 » 7.x-3.x-dev

The patch is for 7.x and hasn't been reviewed/committed. Once that happens a backport can be discussed

prabhatjn’s picture

I have got the following error:

patching file context.core.inc
Hunk #1 succeeded at 260 (offset 16 lines).
patching file context_block_weights/README.txt
patching file context_block_weights/context_block_weights.info
patching file context_block_weights/context_block_weights.module
patching file context_block_weights/plugins/context_block_weights_reaction.inc
patching file plugins/context_reaction_block.css
Hunk #1 succeeded at 167 (offset 31 lines).
Hunk #2 succeeded at 206 with fuzz 1 (offset 31 lines).
patching file plugins/context_reaction_block.inc
Hunk #1 succeeded at 157 (offset 1 line).
Hunk #2 succeeded at 366 (offset 16 lines).
patching file plugins/context_reaction_block.js
Hunk #3 FAILED at 48.
Hunk #4 succeeded at 84 (offset 4 lines).
Hunk #5 FAILED at 89.
Hunk #6 FAILED at 111.
3 out of 6 hunks FAILED -- saving rejects to file plugins/context_reaction_block.js.rej
patching file theme/context_reaction_block.theme.inc

This is an important work, can you please comment...

Thanks,
P.

gnucifer’s picture

The patch is quite old. You will probably need to review the failed chunks and merge them manually. Right now I don't have time to do this myself, but if a project comes along where I need this again I will of course create and share a new patch. You could also try to apply the patch to an older release.

gnucifer’s picture

Issue summary: View changes

spelling etc