froot Posted June 29, 2020 Posted June 29, 2020 hi all, is there a way to select pages by the first letter of their title? I'm trying to use that for an advanced search page. so on the frontend I put links for each of the 26 letters and one for numbers. When you click on one it sends this letter via AJAX to the server. Then I need to select the pages somehow of which the title starts with that letter. something like… if($_GET['letter'] != '') {$letter = $_GET['letter'];} else $letter = ''; … if (isset($letter)) { $matches = $pages->find("limit=0, title[0] == $letter"); } thanks for help!
Jan Romero Posted June 30, 2020 Posted June 30, 2020 The ^= operator should do it: $matches = $pages->find("limit=0, title ^= '$letter'"); Quote ^= Contains the exact word or phrase at the beginning of the field 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now