Jump to content

Recommended Posts

Posted

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?

  • Like 1
Posted

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  

  • Like 1
Posted

Yes, that's great, I have used that, thanks. I'm particularly interested in managing 100s to 100s of references.

Posted

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?

Posted

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

 

  • Like 1
Posted

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

  • Like 1
Posted

@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
  • Like 1
Posted

That's great, this really would be of great benefit to the modules directory as it fills a gap that nothing else does. 🙂 

  • Like 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...