Pagelist filtering


In a page type I have hardcoded a page list. When I activated the caching in Concrete5 the filtering I created is not working anymore. I wonder why this is the case and how it should have been done so it would work properly. The variables are still available in the url but the filter is not applied.

To clarify what I have done I will show some code snippets. In the "real versions" I have 3 filter drop downs.

Hardcoded pagelist
$pl =  new pageList(); //create a new instance
$pl->setItemsPerPage(9); //total of items per page

The page list makes use of filter that can be selected via a dropdown. When selected the variable of the location is available via de url. The variable is used to filter the pages on the page attribute.

 * Filter by attribute
 * @orderBy get value via post or 
 * example : /news?location=amstedam
$location = $_REQUEST['location'];
if( !empty($location) ){ 
   if($location != 'all'){
         $pl->filterBySelectAttribute('location', $location );
 * Get pages

Filter example (html)
 * Get the location values
$akLocation = CollectionAttributeKey::getByHandle('location');
$satcLocation = new SelectAttributeTypeController(AttributeType::getByHandle('select'));
$valuesLocation = $satcLocation->getOptions();
 * Create the dropdown
<ul class="dropdown-menu vac-location-dropdown" role="menu" aria-labelledby="d-location">
   <li><a href="<?php echo $uh->setVariable('location', 'all'); ?>">Toon alles</a></li>
   foreach ($valuesLocation as $key => $v):
      $lv = str_replace(' ', '+', $v);

Thanks for the help,


View Replies: View Best Answer
rge replied on at Permalink Reply
I guess I wil just have make a new block for this functionality. Any advice, examples and tips are welcome.
rge replied on at Permalink Best Answer Reply

I have created a custom block based on the pagelist block in the core. The caching problem does not exist anymore.

Create page list (controller)
$bID = $this->bID;
$pl = new pageList();
$pl->setNameSpace('b' . $this->bID);

Filter the pagelist
 * Filter by attribute
 * @orderBy get value via post or 
 * example : /blog?categorie=php
$categorie = $_REQUEST['categorie']; 
if( !empty($categorie) ){ 
   if($categorie != 'all'){
      $pl->filterBySelectAttribute('categorie', $categorie );

In the view.php I have created the filter dropdown with the url helper
<li role="presentation"><a role="menuitem" href="<?php echo $uh->setVariable('categorie', $lv); ?>"><?php echo $v; ?> </a></li>