Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there an Integration for Panels? Or better: can i Load an configured ajaxblock into a pane?
Comment | File | Size | Author |
---|---|---|---|
#12 | ajaxblocks-panels_pane_integration-1549736-12.patch | 860 bytes | MikeActually |
Comments
Comment #1
maximpodorov CreditAttribution: maximpodorov commentedI didn't try it with Panels. Could you try and share your results?
Comment #2
patrickroma CreditAttribution: patrickroma commentedActually it does not work... The ajaxblock does not load at all... I think it is because panels is creating different classes CSS and does not render the usual regions...
There is at this point no module for D6 that does a similar feature...
There is Block Refresh in D7 implementing it => http://drupal.org/node/1272556
Could this also be achieved with Ajax Blocks?
EDIT: Maybe also related: http://drupal.org/node/443208#comment-5415010
Comment #3
maximpodorov CreditAttribution: maximpodorov commentedWhen using as panes, blocks are not processed by hook_preprocess_block() hooks, so Ajaxblocks module can't see them. Could someone familiar with Panels internals suggest the alternative way to process blocks through Ajaxblocks module during panel rendering stage?
Comment #4
beanluc CreditAttribution: beanluc commentedI found something in the Panels issue queue to suggest that hook_preprocess_HOOK(&$vars) might not work reliably through panels, but that hook_preprocess(&$vars, $HOOK) should work.
Consider http://drupal.org/node/334209#comment-3321442, where HOOK is "page" but I've generalized the discussion to include the "block" theme implementation or whatever else.
Comment #5
patrickroma CreditAttribution: patrickroma commentedInteresting point... Still I am not sure how to implement it to ajax blocks...
Comment #6
beanluc CreditAttribution: beanluc commentedTry, instead of
ajaxblocks_preprocess_block(&$vars)
, this wayajaxblocks_preprocess(&$vars, 'block')
I haven't tried it, I'm just saying that this is what the Panels discussion indicates.
I hope it helps.
Comment #7
maximpodorov CreditAttribution: maximpodorov commentedAjax blocks does work with panels. For the required blocks you have to change the style to "System block" in pane context menu, so the standard block theming will be used.
The solution was found here: #258377: BlockTheme not working.
Maybe module documentation should be updated.
Comment #8
loparr CreditAttribution: loparr commentedThis solution works.
In a case that you have one ajax block displayed as normal block in theme and the same block displayed by panels even with system block style - block displayed by panels doesn't load.
Comment #9
maximpodorov CreditAttribution: maximpodorov commented@loparr, how is it possible to show two blocks with the same ID?
Comment #10
loparr CreditAttribution: loparr commentedIn my case it is a combination of panels and theme blocks on one page.
Comment #11
maximpodorov CreditAttribution: maximpodorov commentedComment #12
MikeActually CreditAttribution: MikeActually commentedThis definitely needs work, but this patch will at least render a block that is inside of a panel.
Where it falls short is that it isn't actually rendering the pane, but the block itself; with that it is also not passing arguments to the block that might normally be set within the panel pane. Visibility rules should still be recognized.
To get this to work, you'll need to configure the ajax settings for the block in the block admin, once set, this will show up in the ajaxpagers database table, and then when the panel is preprocessed, it will render the block as if it is an ajaxblock.
The final solution to this should do the following:
I needed this patch to solve a caching issue for a poll inside of a pane. I will revisit it in a few weeks to try and flesh out the above.
If anyone has anything to add to this to help get this closer to a real feature, I'd really appreciate it.