matjazp Posted May 7, 2020 Share Posted May 7, 2020 Is it possible to search for page ID in the search field (top right)? It looks like it only search for title (and other fields if configured) but not by ID... Link to comment Share on other sites More sharing options...
Robin S Posted May 7, 2020 Share Posted May 7, 2020 3 hours ago, matjazp said: Is it possible to search for page ID in the search field (top right)? You asked about this once before... ? But "pages.id==1234" is a pretty naff syntax, so here's a hook that lets you match pages just by typing an ID into the admin search: $wire->addHookAfter('ProcessPageSearch::findReady', function(HookEvent $event) { $selector = $event->return; $q = $event->wire('input')->get('q'); // If the admin search query is a number if(is_numeric($q)) { // Get the individual pieces of the selector $selector_pieces = explode(', ', $selector); // Modify the first piece so that it includes an ID clause in an OR-group $selector_pieces[0] = "({$selector_pieces[0]}), (id=$q)"; // Replace the original selector $event->return = implode(', ', $selector_pieces); } }); 8 Link to comment Share on other sites More sharing options...
adrian Posted May 8, 2020 Share Posted May 8, 2020 7 hours ago, matjazp said: Is it possible to search for page ID in the search field What about Tracy's PW Info panel - finds the page and provides edit, view, and open links. Maybe you want for site editors, in which case this obviously isn't very useful, but I use this many times a day during development. 2 Link to comment Share on other sites More sharing options...
matjazp Posted May 8, 2020 Author Share Posted May 8, 2020 @Robin S thank you for this hook, it works like a charm. Its clear I'm in a hurry and don't have time to search the forum. It's also clear that you have much better memory than I do :-) @adrian thank you for the hint, currently I'm not using Tracy on this particular site and also users are editors. Link to comment Share on other sites More sharing options...
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