I have Formalicious installed and working well, but would like to adjust a few things. Any way?
1. Change the default CSV divider to a comma instead of a semicolon.
2. For forms that get sent by email, checkbox fields list all the selected items separated by commas with no spaces after them. That doesn’t look or read very well. I’d to change that to add space after every comma in the list.
I tried editing this section of the file “components > formalicious > src > Formalicious > Snippets > RenderForm.php”, adding spaces after the commas in the “implode” lines, but that didn’t make any difference.
you can add the parameter &emailMultiSeparator=`, ` to the FormIt Call – via Formalicious for each form or in your form chunk (see docs). Then it get saved right in the database.
The default delimiter is hardcoded:
Maybe we can add a Pull Request: Set the delimiter in ExtJS empty and add an default System Setting delimiter via PHP in the processor
In the Formalicious form → tab “Advanced Settings”, there is a section where you can add parameters (“Here you can add FormIt parameters. These parameters will be added to the FormIt snippet call…”).
Try adding it there.
The part of the code that @jenswittmann linked was from the FormIt extra and not from Formalicious. So I guess you created the issue in the wrong repository.
Did you submit a new form? It should be work for new submissions. Can you post a screenshot?
Doesn’t line 516 of forms.grid.js need to replace the value with a call to the new system setting, not a blank value?
That would be nice. However, if it’s empty, the default value from the system settings is used. Unfortunately, I don’t know ExtJS well enough to retrieve system settings inside ExtJS. So I’ll keep it simple
Not for me. The field is blank in the popup. Maybe because you are changing the build script to add the new system setting. I added that by hand, and whatever is put in there is not being imported into the popup field. Maybe the build process does something additional to set up the system setting?
There exists a global object MODx that you can access in JS. MODx.config contains the system settings (e.g. MODx.config.base_url etc.). This has nothing to do with ExtJS.
Yeah, it looks like the way Formalicious works, the values already get concatenated with commas, before the FormIt email-hook has a chance to apply the emailMultiSeparator property.
I guess this is the part in the code, where the comma (for the separator) is hard-coded:
I think the best code fix would probably be, to replace this line in the code
Cannot read properties of undefined (reading ‘export_csv_delimiter’)
If I change the name of the system setting to just “export_csv_delimiter” without “formit.” on the front of it, then it works. How can we access system settings that have periods in them?
_________________________________
OK, answered my own question. This works (line 516 of forms.grid.js):
value : MODx.config['formit.export_csv_delimiter']