adrianmak Posted January 21, 2016 Posted January 21, 2016 My pw website has few templates home.php basic-page article-page photo-page picture-page The site has a search with few option provided. When a user search by all, the search will filter only artilce-page, photo-page and picture-page instead of building selector with hard-code template i.e. $pages->find("template=article-page|photo-page|picture-page") could selector be more dynamic ? let say, get all site templates and excluded those templates, in this case, home.php and basic-page will be excluded in the selector
Macrura Posted January 21, 2016 Posted January 21, 2016 you could build your selector with some variables/arrays then you could set those in your init and be able to use them in multiple places,... $excludeArr = array( "template!=home", "template!=basic-page" ); $exsel = implode(',', $excludeArr); $pages->find($exclude);
Recommended Posts