grimezy Posted November 24, 2023 Share Posted November 24, 2023 Hey everyone, Wasn't sure if this is possible but am wondering if anyone had a solution to this. Perhaps with a hook or something? A client has many parent pages to select from when creating a new page and they are then asked which parent page should this new page be created. A select field is then used to populate the list but this is a very big list. 500+ and growing which isn't that bad, but their employees are using iPads and I don't think the on-screen keyboard opens when targeting a select field and I don't think there is a way to force open the on-screen keyboard to search easier on the list... they have to scroll continuously and this is becoming an issue. It would be a lot more efficient for them to search for the parent page using a auto-complete/search select field if there are many items to list. Is there any way this can be achieved? Thanks! Link to comment Share on other sites More sharing options...
bernhard Posted November 24, 2023 Share Posted November 24, 2023 Sure. Here's a mini-Tutorial how you can find what you need yourself: Whenever you add a page you view the page /processwire/page/add. That's the page with ID #6 and it lives in your page tree in Admin > Pages > Add Page. If you edit this page you see that this page uses the process "ProcessPageAdd". So you can inspect that file in your IDE by opening wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module There you see the ___execute() method which is the method that renders your page. There you see that at the very end it renders the form and that form is built some lines above by calling buildForm(). If you have a look at that method you see that it is hookable, so you can modify that form by hooking into "ProcessPageAdd::buildForm" <?php // in site/ready.php $wire->addHookAfter("ProcessPageAdd::buildForm", function($event) { $form = $event->return; $form->add([ 'type' => 'markup', 'label' => 'foo', 'value' => 'bar', ]); }); Hope that helps. 1 Link to comment Share on other sites More sharing options...
grimezy Posted November 27, 2023 Author Share Posted November 27, 2023 Hey @bernhard, Thanks so much for this mini tutorial, when I get time I'll attempt to test it out and see how I go. ? 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