adrianmak Posted January 21, 2016 Share 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 Link to comment Share on other sites More sharing options...
Macrura Posted January 21, 2016 Share 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); Link to comment Share on other sites More sharing options...
Recommended Posts