sjelfull / craft3-templateselect

A fieldtype that allows you to select a template from the site templates folder.
https://superbig.co
MIT License
18 stars 9 forks source link

FR: Use autosuggest component for template selection #14

Open tomkiss opened 10 months ago

tomkiss commented 10 months ago

Hi there,

Craft has a nice built-in autosuggest component which works great for template selection. I'm familiar with it because the Vizy field uses it to great effect.

image

My feature request/suggestion is to follow this same approach and use Craft's built in autosuggest component, to provide an improved UI for template selection.

I've added this in a Pull Request for you to consider. It needs testing and I've only checked it on Craft 4, but please let me know what you think.

sjelfull commented 2 months ago

@tomkiss Thanks for this, appreciate it!

Already commented on your PR, but: I do like this suggestion. I just added an option to have "friendly" template names where the path segments are capitalized and slashes replaced with a >.

Do you know if there is a way to control the rendering of the value with this field?

I might have to revert that change in favour of this, since this might be more valuable. I'll give it some thought.