Can't get this to work in a Panels Page...

tflmike - October 13, 2008 - 18:26
Project:AJAX Views
Version:5.x-1.5
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi there! I am really hoping to use this module for my site, but I'm having a bit of trouble implementing this with a panels page. In panels, I am using the following code to embed the views block:

<?php
$block
=(object) module_invoke('views', 'block', 'view', 'myblock');
$block->module = 'views';
$block->delta = 'myblock';
$panelblock = theme('block', $block);
print
$panelblock;
?>

*I have to embed the block this way so I can theme the output, but what's happening is that it just shows "Loading...".

I've looked to make sure I have all the scripts loading and everything seems to be fine. I'm not using moostools... so I'm not really sure why it's not working.

Thanks for your thoughts!

#1

jstirnaman - February 3, 2009 - 17:25

I had exactly the same problem when using a View Pane to produce the block. I launched Firebug to troubleshoot and found that the AJAX calls were returning 404 errors. The cause was that I was unnecessarily overriding the View URL so instead of something like "taxonomy/term/470/ajax", it was trying to go to "taxonomy/term/%24arg%2C%24arg/1%21feed/470/818/ajax?page=0". I disabled the URL override in the View Pane and the paging works as expected.

#2

corona ronin - February 5, 2009 - 22:36

I am also having trouble implementing this in panels. I create a block and page view as per the documentation instructions, I set the view type for the page as bonus: grid view, and for the block: Ajax Views pager, with the proper argument, but when I load the block into my panels interface the site returns my top menu and my menubar and it's all distorted - it doesen't return what my view is supposed to return.

The documentation said something about embedding, and gave me these instructions:

"Finally, either embed your view in a page via views_build_view('block', $view) or put your block in a region"

Since I'm using panels, I don't put my blocks in regions, and where do I embed my view in a page via views_build_view('block', $view). I don't know what that is or how to implement that. I can tell its a php function but where do I put it and what do I do with it?

Thank you very much.

 
 

Drupal is a registered trademark of Dries Buytaert.