DrQuincy Posted July 2 Posted July 2 From a database perspective page reference fields should scale quite well and there's always the option to build a custom table managed with hooks if you need something ultra fast so you have control of the indexes. But, in the admin, is there any field type that scales well? I've tried them all out and from what I can see, all page reference field types and input types, do not have the option to show your page references in a searchable, paginated lit loaded by AJAX; they all go in a single list. I can imagine this getting problematic once the number of page references gets moderately big. Is there such a thing? What do you do if you have 100s of references, 1000s of references or more? At what point are the standard page reference fields no longer an option? 1
virtualgadjo Posted July 2 Posted July 2 Hi, if your page reference field is used for a single page selection, you may choose "page auto complete" in the input->input field type select, it is ajax powered and works very well 🙂 the only big difference is that you have o know at least 2 or three letters of the page title you're looking for it works great too with a hook (custom php code) allowing you to select several parents, templates and so on if needed have a nice day 1
DrQuincy Posted July 2 Author Posted July 2 Yes, that's great, I have used that, thanks. I'm particularly interested in managing 100s to 100s of references.
Jonathan Lahijani Posted July 2 Posted July 2 I agree with this. A new type of multi-select inputfield for page references for advanced use cases would definitely help. I know Shopify has some unique, purpose-built multi-select fields (like when choosing products/variations). But it doesn't let you search options that have been specifically selected. I didn't see anything generic from CMSes like Payload, Statamic, CraftCMS, Kirby or Laravel Filament. Have you seen anything in any other systems that solves this well?
Jonathan Lahijani Posted July 2 Posted July 2 @DrQuincy Here's a video of a concept field I made called InputfieldPageModalSelect. Let me know your thoughts and suggestions! 1
Jonathan Lahijani Posted July 2 Posted July 2 Another verge large update with all the UX stuff: https://youtu.be/Xu6O84oUQKU 1
Jonathan Lahijani Posted July 2 Posted July 2 I made a few LOT more updates and I think it's ready to share for testing. I'm attaching it here as a zip for now (v88), but will publish to GitHub when I think it's ready. Edit: I have not really tested this as far as the configuration options go. My focus was mainly on functionality and UX. Obviously, don't use this on a production site, only test sites for now. Edit: it now works well in both Konkat (aka Default) and Core (aka Original) admin theme. Edit: file has been removed; see forum post / GitHub / PW modules 1
Jonathan Lahijani Posted July 2 Posted July 2 I must say, I really like this field. Wow... I'm impressed with GPT 5.5 and Codex CLI. 5
virtualgadjo Posted July 3 Posted July 3 hi, wow, being french, a night later, i was about to say well the solution would be to create a custom field relying on pw getSelectablePages and something like tom select that allows lazy loading in the select but what @Jonathan Lahijani made is simply awesome!!! have a nice day 1
DrQuincy Posted July 6 Author Posted July 6 @Jonathan Lahijani Fantastic work, that's exactly the solution to the problem! Do you this it will be production ready and added to the modules database any time soon? 1
Jonathan Lahijani Posted July 6 Posted July 6 @DrQuincy Awesome. Glad to hear it's working well for you. I tested it further and it seems to be working well. I'd say you can use the module I posted here on the forum without issues. I will put it on GitHub and the PW Modules directory perhaps this week but there are a few other features I want to add which include: lazy loading images pagination on the list of selected items (right now only the search results on the search tab is paginated) not loading the modal contents until it's been clicked initially (right now it loads it behind the scenes when you load a page editor) maybe some sort of filtering capability (other than just search) for both tabs; for example in my screenshot, I have "Product Category" which is a reference field; it would be nice to filter based on that. further testing for when the field is loaded via ajax or within a repeater confirmation alert when using the Remove all functionality advancements to auto-thumbnailing (right now it's cutting my images off) maybe table column sorting (and building the table with PW AdminTable APIs directly?) some additional UI updates and improvements 1
DrQuincy Posted July 7 Author Posted July 7 That's great, this really would be of great benefit to the modules directory as it fills a gap that nothing else does. 🙂 1
Jonathan Lahijani Posted July 8 Posted July 8 Much of the updates I mentioned have been made and it's now on GitHub. Any questions about this module should be posted on the official thread: 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