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)
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | pjax-1563742.patch | 2.89 KB | burgs |
| #8 | pjax-1563742.patch | 2.67 KB | jonhattan |
| #4 | pjax-1563742.patch | 990 bytes | jonhattan |
Comments
Comment #1
zoo33 commentedInteresting. I would love some input on how to best deal with this issue.
Comment #2
zoo33 commentedMarking as duplicate of #1570920: Content not being rendered on tabbed pages
Comment #3
jonhattanI think the OP refers to the fact that pjax only delivers the «Main page content» "block", and not every block in the content region.
Comment #4
jonhattanIndeed 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.Comment #5
zoo33 commentedOK. 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.
Comment #6
zoo33 commentedComment #7
jonhattanMy 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.
Comment #8
jonhattanComment #9
poorva commentedpatch #8 not working for me.
I am using adaptive theme and blank page render.
Comment #10
jonhattanSorry, 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).
Comment #11
zoo33 commentedThis 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.
Comment #11.0
zoo33 commentedadded more info
Comment #12
burgs commentedI 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.