gornycreative Posted August 4, 2023 Share Posted August 4, 2023 I noticed the search template and search page do not seem to be alterable by defining a custom page class. If I try creating a page class file where class SearchPage extends Page { it does not appear to effect the Search page class at all - the page still appears as ProcessWire/Page and none of the public functions I define can be used. Is this a feature of having a page that uses a Process or is it because it is a system file, or is there a different class it should extend? 1 Link to comment Share on other sites More sharing options...
gornycreative Posted August 5, 2023 Author Share Posted August 5, 2023 Looking into it more, I have come to the conclusion that the Search page uses the admin template and as a result falls outside the public facing page class framework. Even though the output from the controller/view is a ProcessWire/Page class, there is no way to extend the pageclass because it is the Process that dominates the function of the page. If I wanted to modify the Search workflow I could hook into it, but because I actually want to grab url segments and run some query magic to convert them into a complex query to pass to search, I think I will need to set up a unique page and pageclass to do that. Hopefully someone with more knowledge of the admin side can chime in. 1 Link to comment Share on other sites More sharing options...
gornycreative Posted August 5, 2023 Author Share Posted August 5, 2023 Funny thing is, the migrate function will still run and if I set it up as a magicpage for rockmigrations it still functions in that capacity. It's just the page class itself that does not get recognized when loading the search page. Link to comment Share on other sites More sharing options...
gornycreative Posted August 5, 2023 Author Share Posted August 5, 2023 I didn't realize there are technically two pages created in the back end for search and both of them are hidden and have system ids - 300 and 1000, There's a search page under root '/' that's id 1000 and a search page under /*adminhome*/page/ that is id 300 - for admin search. When I used the name selector by itself in the Tracy console before it grabbed the admin search page but later when I used the template selector it grabbed the public search page. The public facing search page applied the custom SearchPage page class. I'm in business. id=300, name=search, template=admin, = the backend search page/process id=1000, name=search, template=search = the frontend search page/process - and the custom page class gets applied to this page. 1 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