Skip to content

Instantly share code, notes, and snippets.

@hissy
Created March 18, 2014 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hissy/9632532 to your computer and use it in GitHub Desktop.
Save hissy/9632532 to your computer and use it in GitHub Desktop.
#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