Skip to content

Instantly share code, notes, and snippets.

@hissy hissy/view.php
Created Mar 18, 2014

Embed
What would you like to do?
#concrete5 #PageList Force sort option from Page List Block template
<?php
defined('C5_EXECUTE') or die("Access Denied.");
$rssUrl = $showRss ? $controller->getRssUrl($b) : '';
$th = Loader::helper('text');
// Get PageList again
$pl = $controller->getPageList();
// Set sortby
$pl->sortBy('ak_example_attribute_handle','asc');
// Get pages again
if ($pl->getItemsPerPage() > 0) {
$pages = $pl->getPage();
} else {
$pages = $pl->get();
}
?>
<div class="ccm-page-list">
<?php foreach ($pages as $page):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.