Exclude pages in one page list from pages in another page list
Permalink
I have a page list with 4 featured pages ("Top News") and another page list with more non-featured pages ("Latest News").
The "Top News" page list has no pagination. Therefore, I need to display top news which are not currently visible, in the "Latest News" page list.
My "Top News" page list looks like this:
My "Latest News" page list looks like this:
The "Top News" page list has no pagination. Therefore, I need to display top news which are not currently visible, in the "Latest News" page list.
My "Top News" page list looks like this:
$pn = $c->getCollectionHandle(); $home_featured = new \Concrete\Core\Page\PageList(); $home_featured->setItemsPerPage(4); $home_featured->sortByPublicDateDescending(); $home_featured->filterByAttribute("is_featured",1); if ($pn != 'home') $home_featured->filterByParentID($c->getCollectionID()); $pages = $home_featured->getPagination(); if ($pages->getTotalResults() <= 4 || $pn != home) $pages->setCurrentPage(1); else $pages->setCurrentPage(2); $pages = $pages->getCurrentPageResults();
My "Latest News" page list looks like this:
$pn = $c->getCollectionHandle(); $news_list = new \Concrete\Core\Page\PageList(); $news_list->setItemsPerPage(6); $news_list->sortByPublicDateDescending(); $news_list->filterByCollectionTypeHandle(array("article")); if ($pn != 'home') $news_list->filterByParentID($c->getCollectionID()); else $news_list->filterByAttribute("is_featured",0); $pagination = $news_list->getPagination(); $current_page_num = $this->controller->get('ccm_paging_p',1); $pagination->setMaxPerPage(6)->setCurrentPage($current_page_num); $pages = $pagination->getCurrentPageResults(); $totalPages = $pagination->getTotalPages();