Hey guys - i’m stuck right now and need some of the communities wisdom.
All i want is to enable a field in my Strapi CMS such that a user can:
- Start typing an address
- Google shows some options to select from as they type
- Select from that list of options
Just like a normal field in the google maps function. I am completely lost in terms of whether it can or can’t be done (and how?).
It can be done be defining a custom field renderes. Strapi 4 does not support it well but there are workarounds for it
Your field will be a string field
You define your react component as a google geocoding field. I guess you can find a lot of examples there.
Register your field in your plugin bootstrap.
Inside your field component you can check if your field is for address return google geocoding component otherwise return regular text field component.
I might develop similar thing for a plugin I am currently working on. But I am not sure my timing will allow me to do it soon.
Ok - but does the work with Strapi v3 then.
I’ve read that adding a custom field will cause errors in the content type builder model. How are you getting around this?
I’m looking basically implement this: react-google-autocomplete - npm
Into a field on my existing content model. Any thoughts?
It ahould not cause issue with original content manager since it is just a text field so strapi handels it as a text.
I am not sure about strapi 3. I guess it should work well. There is a tutorial for using add color selecting field to the strapi. It should be the same. I will try to add some sketches and will share it with you soon yo get an idea how it should work
This is an example how to do it.
It is still under development but gives you some ideas