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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | blockqueue_theme_help-3.patch | 1.49 KB | jtsnow |
| #1 | blockqueue_theme_help-2.patch | 1.46 KB | jtsnow |
| blockqueue_theme_help.patch | 1.32 KB | jtsnow |
Comments
Comment #1
jtsnow commentedThis patch is even better... :)
Comment #2
jtsnow commentedAnother tweak to avoid some collisions with core template suggestions.
Comment #3
sethcohn commentedHuge +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.
Comment #4
sethcohn commentedMinor 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.
Comment #5
sebastien m. commentedThis 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.