Pagination in main template page