processwire / processwire-requests

ProcessWire feature requests.
40 stars 0 forks source link

For FieldtypePage, add an option to the Page Label dropdown to use getPageListLabel from the custom page class #494

Open solonmedia opened 1 year ago

solonmedia commented 1 year ago

Add a third option for the Page Label format for FieldtypePage to use the getPageListLabel function from a page's corresponding custom page class.

Right now there are two options for selecting the formatting of a page name in the selection list.

  1. Select a field from the dropdown to display in the page selection.
  2. Select custom from the dropdown and provide a custom labelFieldFormat.

I'd like to suggest a third option - use the getPageListLabel from the custom page class. if the generic page class is not being used.

Current vs. suggested behavior

This could either be an additional select dropdown option (which would make sense since there really should be nothing left to define if this selection is made.

Alternatively when Custom is selected perhaps there could be a checkbox in the custom textbox fieldset to use getPageListLabel from the custom page class and use the default custom label in the box if no page class exists for a given page.

Why would the enhancement be useful to users?

It would be nice to have some consistency in the autocomplete and page list setups, although I recognize that due to the complexity of the different classes of pages that could be included in a single dropdown this may be complicated.

On the other hand, it could also end up enhancing the quality of the Page Inputfield because instead of being stuck with a set of common denominators for the custom page label or worse just a single field...

I suppose the workaround might be a concat field that exists across all of the different page classes - but I feel like if the page class function could be used and just fallback maybe to the custom format if the function returns void - well it would provide some consistency from the UX side of things to see the same page list formats in the selection areas as they do in the main page list.