Jump to content

Select Once Per Table: store extra information for selected pages


Robin S
 Share

Recommended Posts

Select Once Per Table

Adds a setting to "Select", "Page (Select)" and "Page (Autocomplete Single)" columns in a ProFields Table field so that each option can only be selected once per table. Requires the ProFields Table module.

There could be a number of situations where this module might be useful, but perhaps the primary situation is when you want to store extra information for pages that are selected in a Page Reference field.

So instead of using a Page Reference field like this...

Without SelectOncePerTable

...you could use a ProFields Table field together with Select Once Per Table to store extra information for each selected page like this...

With SelectOncePerTable

The module ensures that pages/options that are already selected in the Table field are disabled as you add new rows or edit existing rows.

Configuration

To enable the module for any "Select", "Page (Select)" or "Page (Autocomplete Single)" column in your Table field, edit the column settings and add selectOnce=1.

SelectOncePerTable configuration

 

https://github.com/Toutouwai/SelectOncePerTable
https://processwire.com/modules/select-once-per-table/

  • Like 9
  • Thanks 2
Link to comment
Share on other sites

great idea. I could really use it. In my case I have an Autocomplete instead of a Select for the page reference (too many targets) and unfortunately, there double entries are still selectable. But intercepting here, might be another level of complexity. But I might soon find a use case where this fits in well. Thanks for the module!

  • Like 1
Link to comment
Share on other sites

4 hours ago, ceberlin said:

In my case I have an Autocomplete instead of a Select for the page reference (too many targets) and unfortunately, there double entries are still selectable.

I've added support for "Page (Autocomplete Single)" columns in v0.2.0.

  • Like 3
Link to comment
Share on other sites

That's a little bit like Christmas for me. So useful!

An additional reminder under the PW hints for the field might guarantee that this handy option is remembered when the module is active?

• validate: Validates that Pages in value matches your selector on page save.
• selectOnce=1: Each option can only be selected once per table

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...