[fixed] Filter by path and name
Permalink
I want to do a search with multiple filters.
First the path and then the name.
But if I do:
It only applies a filterByPath and not the filterByName. so I get all pages below products no matter what the search value for name is after that.
I only want to have search results from within /products, but also being able to search on any keywords after that.
Is it possible ?
edit:
nvm. This is already working. My ajax call was wrong so it didnt send the $_GET['q'] part
First the path and then the name.
But if I do:
$pl = new PageList(); $pl->filterByPath('/products'); $pl->filterByName($_GET['q']); $pages = $pl->get(10);
It only applies a filterByPath and not the filterByName. so I get all pages below products no matter what the search value for name is after that.
I only want to have search results from within /products, but also being able to search on any keywords after that.
Is it possible ?
edit:
nvm. This is already working. My ajax call was wrong so it didnt send the $_GET['q'] part