Limit PageList Results

Permalink 1 user found helpful

I try to find out how to limit the number of results returned by :

$list = new PageList();
$pages = $list->getResults();

I don't want a pagination just get, e.g, the latest page with 'news' template !

Any idea ?

thank you,

View Replies:
moosh replied on at Permalink Reply
I find a solution :

But don't understand why Concrete5 don't interface it directly!
We MUST getQueryObject() to solve this issue.

Another thing I saw, we can't sortByPublicDate in descending mode!
So, a little bit boring when we want e.g the 10 latest news with the latest in first position.

Parasek replied on at Permalink Reply
1. To get only some of pages, you need to use pagination.
scroll down to "Pagination"

2. You can sort pages in ascending mode
moosh replied on at Permalink Reply
1. yes but it's not what I expected..
With this method you get ALL matching results from database then split results in multiple pages.
This is a leak of performance when want to retrieve only one result (when having 150 pages e.g).

2. ahhhh yes! haven't seen it!