Jump to content

Selector for Pagetable or. Filter Pagetable ?


Orkun
 Share

Recommended Posts

Is there a way to filter a pagearray you get from the pagetable?

As I know something like this wouldn't work because you can't filter pagetable i think?

Is there probably an alternative how i coud get this to work:

//get all dates of the current acitivty Page from the pagetable where date_from is bigger or equal to today.
$filteredPagetable = $page->activity_create_date($selector[e.g "date_from>=today, sort=date_from"]); 

//check filtered pagetable array & get the latest date from the first item in array.
$dateFrom = (count($filteredPagetable)) ? $filteredPagetable->first->date_from : "";

Link to comment
Share on other sites

You can use all the api function, which you can use on other pageArrays as well, just keep in mind that it's using the runtime selector engine, which isn't as powerful as the db selection. E.g. there's no automatic replacement for the today keyword.

$today = time();
$filtered  =$page->activity_create_date->find("date_from>=$today, sort=date_from");
  • Like 1
Link to comment
Share on other sites

You can use all the api function, which you can use on other pageArrays as well, just keep in mind that it's using the runtime selector engine, which isn't as powerful as the db selection. E.g. there's no automatic replacement for the today keyword.

$today = time();
$filtered  =$page->activity_create_date->find("date_from>=$today, sort=date_from");

Thank you very much!

Regarding to the today keyword. Ryan mentioned in this thread that it could also be used.

For now I used your option with $today = time(); but I had also examples on my side where I used 'today' keyword and it worked.

Something like that:

    ...
    $lastmonth_end = _data_last_month_day(); 
    $dateString = "date_from>=today, date_from<=$lastmonth_end";

    $limit = 10; // the "limit"-setting used on this page

    //get all dates from the current month
    $dates = $pages->find("template=date, $dateString, sort=date_from, sort=start_time, limit=$limit");
    
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...