Tuesday 13 May 2014

Multiple List Paginations in a one page - concrete5 0

If you want to put two or more paginated list using concrete5 pagination (item list) class, You need to set name space for each instance of a class.

for example, I am taking two various instance for a single class.
$pageList1 =  new productList();
$pageList2 =  new productList(); 

Here I'm separate resultant list using different filter queries like below,
 Concrete5 pagination class is working based on url. So, if we click on next page of pagination button, query string will be change like ?ccm_paging_p_2.

So, it will became a common paging for both paginated result. So, it will show the second page result in both lists.

To avoid this, we can use separate name space for those two instances like below,
 
So, if you click on paginate button of pageList1, query string will be ?ccm_paging_p_pl1=

So, it will paginate only one list which one you clicked.
setNameSpace() is a function of pagination helper in concrete5. 

Have any doubt, feel free to comment here!

 

0 comments:

Post a Comment