Concrete5 Hard-Coded Page List

If you ever need to get a page list in Concrete5, this bit of code will get the first 3 pages of a certain page type (in this case, "article"). There's a ton more you can do with the page list object. I recommend digging into the on_start function within /concrete/blocks/page_list/controller for more.


<?php

$pt 
= \PageType::getByHandle('article');
$list = new \PageList();
$list->filterByPageTypeID($pt->getPageTypeID());
$list->setItemsPerPage(3);
$pagination $list->getPagination();
$articles $pagination->getCurrentPageResults();
$this->set('articles',$articles);