If the page that is loaded through pjax is a drupal "main-content" block, no content seems to be loading. Other pages' content works.

Update: To be more specific, no blocks at all are loaded, even if they are part of $page['content'] (placed in that region)

Comments

zoo33’s picture

Interesting. I would love some input on how to best deal with this issue.

zoo33’s picture

Status: Active » Closed (duplicate)
jonhattan’s picture

I think the OP refers to the fact that pjax only delivers the «Main page content» "block", and not every block in the content region.

jonhattan’s picture

Category: bug » feature
Status: Closed (duplicate) » Needs review
StatusFileSize
new990 bytes

Indeed I have the same problem / feature request.

I'm using context + empty_page. Rendering the whole content region is a must for this setup. The patch attached seems to be working in my setup but frankly I can't put hands in the fire for it. I just follow the code from drupal_render_page() and pick a few lines to make it work.

If you think this is too specific or don't want to incorporate a solution like this, I'd be happy if you at least open the door to implement this in contrib/custom modules by adding a drupal_alter as drupal_alter('pjax', $page_callback_result) before rendering the output.

zoo33’s picture

Title: Doesn't seem to be working for "main-content" block » Deliver the whole 'content' region

OK. I think it would be reasonable to render the whole content region rather than just the main content block – or to make that an optional setup. One potential problem is that that region may not always be called 'content', so maybe there would have to be a setting for that.

I really like the simplicity of the current delivery mechanism, so I would like to be able to keep using that for those who just want to fetch the essential parts as quickly as possible.

zoo33’s picture

Status: Needs review » Needs work
jonhattan’s picture

My previous patch didn't work as expected. This one is more elaborated. Still needs testing on my part, and work per #5.

btw I'm working with a subtheme of omega.

jonhattan’s picture

StatusFileSize
new2.67 KB
poorva’s picture

patch #8 not working for me.
I am using adaptive theme and blank page render.

jonhattan’s picture

Sorry, I'm not going to work on this in the short term. The requirement I needed this module was discarded happily (play a song continuously).

zoo33’s picture

This looks pretty complex. I'd like to make this a 2.x issue, if someone wants to step up and become a maintainer for that. I really like the simplicity of the current approach, and I'm not sure I agree with the use case of delivering multiple "blocks" through pjax. I would consider hooking into pjax in JS instead, and update other content as required.

zoo33’s picture

Issue summary: View changes

added more info

burgs’s picture

Issue summary: View changes
StatusFileSize
new2.89 KB

I managed to have a quick crack at this, and seem to have it working reasonably well. The main issue is whether to include the html.tpl.php wrapper, or just print the title tag. I opted to just print the entire html. It's easy enough to change though. The other bit to get it working was to set the pjax fragment to be the content selector from the Drupal settings.
My path also has changes in it from the patch to work with the latest jquery.