Ajax Page List

Permalink
hi all,
can we make ajax page list?

the current(default) page list is load all page.

thanks!

fastcrash
 
jordanlev replied on at Permalink Reply
jordanlev
If the page list is too long, you can turn on Pagination to make it load faster.

If you wanted to make it via an ajax call, you will have to build your own block that implements its own ajax methods (the block would have javascript in its view.php file that calls another file in your "tools" directory -- that "tools" file would use the PageList class to retrieve the pages you want and return the results).
fastcrash replied on at Permalink Reply
fastcrash
thanks jordan for the hint,
so there is no one have done this.

ok i will just pending it for now. stick on this default page list.

thanks.
grorog replied on at Permalink Reply
Hi, I'm looking for the same thing.

I'm looking for a block / page list template that shows 1 random post excerpt at the time and displays another after 10s.
Like the early news ticker..

Nobody implemented that? I'm happy with a hardcoded script..
RadiantWeb replied on at Permalink Reply
RadiantWeb
ProNews has a scrolling page view.

Chad
grorog replied on at Permalink Best Answer Reply 2 Attachments
Thanks Chad,
but I almost figured it out. I have made two pages:

1. a "page list" custom template in /blocks/page_list/templates/mytemplate.php

2. the "ajax page" in /tools/myajaxpage.php

=========
1. The first page loads the ajax page with a cID get parameter every X seconds

2. Now, I can not display/output the Area content of the posts 'Main' area. I get the error: Fatal error: Call to a member function getAreaCustomStyleRule() on a non-object in..

The problem is here:
$a = new Area('Main');
$a->disableControls();
this throws the error $a->display($cobj);

I can get all the other collection "attributes"

Is there another way to output a collection area by name?
jordanlev replied on at Permalink Reply
jordanlev
The core code is unfortunately not as modular as it should be. When displaying an area's content from an ajax tool you need to set the global $c variable yourself.
This is some code I've used in a project that does what you want:
<?php defined('C5_EXECUTE') or die(_("Access Denied."));
$cID = empty($_GET['cID']) ? 0 : $_GET['cID'];
global $c;
$c = Page::getByID($cID);
if (empty($c) || $c->error) {
   echo 'Page not found';
} else {
   $a = new Area('Main');
   $a->disableControls();
   $a->display($c);
}
exit;

(this is the code for the ajax "tool" file)
grorog replied on at Permalink Reply
hmm, I think this is what I did. Could you please check the file attachments from my post? thanks
jordanlev replied on at Permalink Reply
jordanlev
I'd kindly ask that you check your own code -- I'm happy to help but can't do all the work for you :)