By default, all blocks come with some template suggestions (See http://api.drupal.org/api/function/template_preprocess_block/6). This module calls theme('block', $b), with $b missing all the data necessary to generate these template suggestions (region, module, delta). template_preprocess_block() expects this information to be there. This makes it impossible to override the default block template for blocks contained in a blockqueue using the core template suggestions.

Also, this module provides no template suggestions of its own, making it impossible to use a different block template for blocks that are in a blockqueue. Obviously, it is also impossible to use different block template for blocks that are in two different blockqueues.

The attached patch fixes these problems.

Comments

jtsnow’s picture

StatusFileSize
new1.46 KB

This patch is even better... :)

jtsnow’s picture

StatusFileSize
new1.49 KB

Another tweak to avoid some collisions with core template suggestions.

sethcohn’s picture

Title: Not themer friendly » Not passing enough block info to preprocess and theming
Status: Needs review » Reviewed & tested by the community

Huge +1. This is important not only for general theming, but anything else that relies on having accurate module and delta info.

Before this patch, a module I'm working on was completely confused by the blocks generated within a blockqueue. they ended up with missing/incorrect class/id info as a result, so javascript later also failed due to missing info.
After this patch, everything works as expected, just as if the blocks were normally created.

The only change I might make (and this would be a local theme change) would be to slightly adjust things. As it stands now, if you have a block inside the queue, and the same block _outside_ the queue (or in a different queue?), on the same page, they can end up with identical information (class/id wise) since nothing distinguishes the blockqueue called one. If we added blockqueue-bqid to 'module' (for example), it might help with that. But that's doable, since it's a theme call: theme_blockqueue_queue

Really, without some other code refactoring (which is needed module-wide and I'll open a fresh ticket for that), this is quite a good solution for now.

sethcohn’s picture

Status: Reviewed & tested by the community » Needs work

Minor problem (easy to fix though):
The variables used in this function aren't reset during the loop, meaning that some info ends up passed onto the next block in the queue, under some cases. (Try a mix of titles and no titles, with module blocks and custom added blocks... and the unintended cascade in the loop will give some blocks the title of the block on top of it)

I'll submit an improved patch shortly.

sebastien m.’s picture

Version: 6.x-1.8 » 6.x-1.9
Issue summary: View changes
Status: Needs work » Closed (won't fix)

This module is no more maintained on it's 6.x branch.
The new release under Drupal 7.x uses the common mecanism to render blocks.
So classic variables should be populated. Some optimisations need to be done about suggestions.

So I'll close this issue because won't be fixed under 6.x branch.