arteria / cmsplugin-contact-plus

With cmsplugin-contact-plus building custom forms for your django-cms project is a breeze. Now it's so easy to build the forms with exactly the fields you want in the order you want - with a minimal effort.
https://github.com/arteria/cmsplugin-contact-plus
BSD 3-Clause "New" or "Revised" License
30 stars 33 forks source link

Feature request: add location field #64

Open emibcn opened 5 years ago

emibcn commented 5 years ago

Hello, I use this module in some projects and, in one of them, I need to collect user's location. I use (django-map-widgets)[https://github.com/erdem/django-map-widgets] and would like to use it here, but looks a little difficukt to add plugins/widgets to cmsplugin-contact-plus. Being able to use extra Django fields would be very nice.

A possible solution would be to add it to settings.py something like:

def getFormMap(extraField):
   return gismodels.PointField(
      label=extraField.label,
      initial=extraField.initial,
      help_text=extraField.placeholder,
      required=extraField.required)

CMS_PLUGIN_CONTACT_PLUS_WIDGETS = [
   {
      'fieldType': 'LocationMapField',
      'getter': getFormMap
   }
]