I’ve been playing for a few weeks tweaking the forum. The doc for themes and components has definitely been very helpful!
Lately I’ve added custom user fields at signup that can be edited after signup.
My current challenge is to autocomplete one of these user inputs and connect it to an API.
Right now I’m asking the user to fill the text and store it as a value which is not satisfying.
Besides I have an API that returns a JSON when POSTing the search.
The goal here is to search the input value though the API and autocomplete the values to the user.
I couldn’t find a way to create a new type of custom user field and make it an autocompletion field.
I also got lost trying to create a widget or component and add it to the signup form and saving it’s value to the database.
If you have some clue of a better approach I’ll very much appreciate your help on this one!
You’d need a plugin to do that. And you could look at some other code that does completion like category for examples of how that works. I’m still bad at that stuff and think it would take me 3-10 hours. I think maybe someone who’s done it before might do it in 1-2.
But maybe if you are getting your data for the search externally you could do it all in a theme component. Again, my best advice is to look at places on the discourse core that do the kind of search that you’re talking about, like the category and tag elements.