My idea is:
In the Mautic UI Contact page, Fields and Custom Fields are currently sorted into 4 tabs: Core, Personal, Professional, Social
When integrating Mautic with other systems it is common to have dozens or even hundreds of Custom Fields that:
a) Don’t really fit with any of those 4 group names
b) Clutter up those groups/tabs such that data is harder to find in the UI.
So the idea is to add the ability to customise Field Groups.
Not really an original idea - there have been requests going back to 2016 in the forum and github to add the ability to Add/Edit/Remove field groups (see below).
I think these groups of people would benefit from this idea:
Anybody that:
Uses custom fields with business purposes that don’t fit intuitively with the 4 named groups
Uses many custom fields and finds that the UI becomes harder to navigate with long lists of fields in one or more group tabs
Uses integrations that rely upon custom fields which the user would like to keep separately organised from these 4 groups.
Why I think they would benefit from this idea:
Manageable field list lengths in UI tabs, separation of domains, more intuitive partitioning of fields for a specific organisation’s needs.
Any code or resources to support this idea:
Requests in github and the forum: here, here, here, here, here and here.
This is already possible by extending the form: Mautic\LeadBundle\Form\Type\FieldType. You need to extend the form and redifine group field in buildForm method.
I might not have made this clear (apologies if so), but the feature request is for:
A user to be able to Add/Remove/Edit the Groups via the UI
Not make custom edits to mautic that will be wiped out by the next update (I can see 16 files in the mautic code base that mention the “professional” group, for example).
well I had in mind that you change that via code but your approach could certainly be implemented via the plugin - its just that because you want the GUI for adding / removing the groups this adds a bit more work for the developer.
And about number two - if plugin is implemented properly after the mautic update nothing should get overwritten. There is a case where major update could potentially render plugin useless because of some braking change in the core but that is beside the point here :). For most of the time you would update mautic instance and plugin would just work.
Regardless of adding / editing field groups being a core functionality or provided via plugin I think default groups should stay as they are now - as there is a lot of core that actually assumes these 4 groups.
If you would really benefit from this I can probably make a plugin that does what you are describing in a couple of days (using GUI to add / edit the field groups).
a) Yes, you are likely correct that this is best done as an enhancement to the Core rather than as a plugin, due to the 16 (or more?) points of dependency I mentioned above. In fact, one of the forum moderators even suggested that this might not be possible with a plugin here.
b) I agree that a developer could create and maintain a plugin for most of the ideas in this “Ideas and Feature Requests” forum area. However I am posting to give the core maintainers a single place to refer to and debate this recurring request when considering inclusions for the Mautic core.
On the other hand, if you think this can be done as a plugin and are offering to donate a plugin to the Community then that would be awesome!
I have added custom field groups (I even created hidden field group and all the fields in that group do not show in the GUI). The only thing that I have not done before in regards to this feature is GUI for editing the groups.
While there might be some obstacles I do not see it at the moment. I will give it a try - as I see it at the moment this should be easy enough to implement (but I could be wrong).
If I manage to implement it, I will post it on the forum and you can take it from there, wish me luck :).
Thank you so much for this. I had it working well in Mautic4, and am trying to get it working Mautic5 with your dev branch… having trouble with the install process. Any ETA on when this will be complete and available on the main branch?
thank you for the quick reply! I am still having installation issues following the instructions in dev_mautic5 branch. i will wait until you complete the tests and push it to main. thank you again for a great plugin!
Everything was working fine in Mautic4. I have a staging server set up that I have cloned over, and successfully upgraded to Mautic5 by removing/disabling this plugin (along with a few others). So my old directory has been removed.
When I follow the steps in the repo
cd
rm -rf var/cache/dev/* var/cache/prod/*
cd plugins
git clone ADRA Network / mautic-field-groups-plugin · GitLab MZagmajsterFieldGroupBundle
cd MZagmajsterFieldGroupBundle
composer install
php bin/console mautic:plugins:install --dev
I get: "The “–dev” option does not exist. "
When I remove --dev I get: “0 new plugins were installed and 0 updated.”
Then I cd into the plugins/MZagmajsterFieldGroupBundle and I run:
git pull origin dev_mautic5
it looks like it pulls everything OK.
when I then run:
php bin/console mautic:plugins:reload --env=dev
I get:
" PHP Fatal error: Uncaught Error: Class “Symfony\Bundle\WebProfilerBundle\WebProfilerBundle” not found in /var/www/html/<MY.DOMAIN>/public_html/app/AppKernel.php:197