Active
Project:
Ajaxify Regions
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Jun 2010 at 20:44 UTC
Updated:
12 Jun 2010 at 00:14 UTC
Does anyone have a method to get Ajaxify to work with a block within a panel?
I figured it would be fairly simple...when blocks are embedded in panels they lose their standard ID scheme #block-module-delta, which is why I thought I was having problems.
Using Authcache and Ajaxify I can confirm that the ajax response is returning correctly (currently testing with the core poll module). I get something like this as the ajax response:
poll: {"nid":"24147","block":"0","html":"
\u000a \u000a
Achieve What You Never Thought Possible
\u000a
\u000a
\u000a
\u000a
\u000a 0% (0 votes)\u000a
\u000a\u000a
The Unfair Advantage
\u000a
\u000a
\u000a
\u000a
\u000a 75% (3 votes)\u000a
\u000a\u000a
Speed Kills
\u000a
\u000a
\u000a
\u000a
\u000a 25% (1 vote)\u000a
\u000a
\u000a Total votes: 4
\u000a
\u000a"}
I attempted to manually apply a CSS ID to the block through panels. Applying both "block-poll-0" as the ID and "block-poll-0-ajax-content" didn't work...Any input as to how I might be able to get this to work would be appreciated.
Comments
Comment #1
csevb10 commentedI'll do a test of this in the near future. I'm sure there are multiple things that might cause issues with this, but I'll give you a couple of the aspects of the module to see if they help you discover the issue before I have a chance to resolve it.
1. The blocks to replace are in the header of the page with the id in the var blocks = line. Adding "block-" in front of the name there would give you the expected id for the block. (in the standard scenario, it would be poll-0 on the var blocks line, and the expected id would be block-poll-0)
2. That id is utilized to replace content inside of that block in a div identified by -ajax-content.
The expected html, then, in the given area would be (this is simplified by gives the idea):
If it has something different than that, it won't function as expected. I'm very interested in this, though, so I'll do my best to try and make some time to test. If you're able to get to this before me, please let me know.
Thank you!
Comment #2
arielkung commentedHello, I'm trying to ajaxify also a poll block (advpoll latest poll) inside a panel and it doesn't work. I've tried some workarounds (changing CSS ID) but nothing happened.
Comment #3
csevb10 commentedOk. I actually played around with this a bit, and it's going to be harder than it first looks.
1) I can't even get the blocks to ajax-enable by default. This is because, instead of blocks, they register as panel_panes. The result of this is that the preprocess functions aren't called in the traditional sense and I can't as easily manipulate the content of the block.
2) I _CAN_ access the element as a panel_pane - and I might still do this - but because of the panels custom handling, not all of the necessary values are passed along. Most importantly, panels doesn't send along any information about caching in the traditional block sense, so I don't know if this sort of block should even be handled. There are some potential workaround for this, but none I'm completely enamored with at the moment.
3) Naming convention changes for things, so handling for blocks in panes will need to occur in an entirely different context than everything else. I'll need to duplicate handling of things or build a new pathway for panels panes. This is, again, doable, but requires a bunch of additional work.
From a logical perspective, I sorta feel like this is a panels issue: Panels has broken the traditional block pathways and removed preprocess manipulation of those blocks. I can do a bunch of additional work to get it to work with panels, but - and this is just a personal thing - I don't really use panels a lot. I prefer blocks/regions for almost all of my site buildouts. I'm not saying I _won't_ build this feature, but the problem could be solved more easily if panels passed the information down the traditional pathways and I could hook into it as normal; as is, I'm going to need to do a lot of additional work, so it's just not as high on my priority list. If anyone wants to help put together this patch - even with the code bloat it'll create to some degree - I'm willing to push it in, but it'll probably be a bit before I get time to do this myself.
(If there's an uproar from the community, I'll see what I can do)
--
William O'Connor
Achieve Internet + CTO
Comment #4
vood002 commentedThanks for looking into this William...I certainly see your point that this is more of a panels issue than an ajaxify issue. I might be wrong about this, but I believe that if you set a panel pane to display as a system block then it gets the full treatment.
Unless I'm wrong about this, it should be a little simpler right? Nonethless I've been poking around some and have yet to get ajaxify+panels to work together...I've just moved some blocks around and am using ajaxify nonetheless.
Comment #5
mikeytown2 commenteddoes the block go through some sort of block theme function when displayed in a panel?