Page list with sort by attributes like a form with search button

Permalink
Hello everyone,
I'd like to build a page list with sort by attributes with form with select inputs, and search button.
When i click search page list show me only page with selected attributes, and when don't click show me all pages...

Could you help me, and write any ideas?

CreativeSight
 
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
In your pagelist controller you need to write something like below:
$attrName    = $_REQUEST['attrName'];
$submit_form    = $_REQUEST['submit_form'];
if($submit_form == "Search"){
   if($attrName != ""){
      $pageList->filter('attrName', '%'.$attrName.'%', $comparison = 'LIKE');
   }
}


If you need any professional help, then I'll be able to make one for you with a very reasonable price.

Rony
CreativeSight replied on at Permalink Reply
CreativeSight
Sorry for my stupid question but in my controller.php in page_list folder is only
" defined('C5_EXECUTE') or die("Access Denied.");
class PageListBlockController extends Concrete5_Controller_Block_PageList {

}
"

Where can i find it?
CreativeSight replied on at Permalink Reply
CreativeSight
Ok i found it :)
CreativeSight replied on at Permalink Reply
CreativeSight
Hi again,
i have another question, because the option in standard page list " the newewst on the top " doesn't work and when I create new page it doesn't show the newest article but random.
Maybe is a fix on this problem?
Thanks for reply...
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
Add this:
$pagelist->sortByPublicDateDescending();
CreativeSight replied on at Permalink Reply
CreativeSight
I tried this but C5 sort by the last date to new date of public...
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
$pagelist->sort('cID', 'DESC');
CreativeSight replied on at Permalink Reply
CreativeSight
In controller I write like that and it works:

<code>
$cArray = array();

switch($row['orderBy']) {
case 'display_asc':
$pl->sortByDisplayOrder();
break;
case 'display_desc':
$pl->sortByDisplayOrderDescending();
break;
case 'chrono_asc':
//$pl->sortByPublicDate();
$pl->sortByPublicDateDescending();
break;
case 'alpha_asc':
$pl->sortByName();
break;
case 'alpha_desc':
$pl->sortByNameDescending();
break;
default:
$pl->sortByPublicDateDescending();
break;
}
</code>
JohntheFish replied on at Permalink Reply
JohntheFish
There are several page list addons in the marketplace that provide the functionality you describe.
CreativeSight replied on at Permalink Reply
CreativeSight
Yes i know, but i can't buy form marketplace, it'll be a dedicate block and my boss said " Write it, it's simple ;) "
CreativeSight replied on at Permalink Reply
CreativeSight
Sorry Rony I can't pay for this because my boss said you must create this, it will use in feature.
So I need help, but I must write myself...