Custom Contact Field Groups and UI Tabs

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.

If you need further assistance let me know.

Thanks for your input @mzagmajster .

I might not have made this clear (apologies if so), but the feature request is for:

  1. A user to be able to Add/Remove/Edit the Groups via the UI
  2. 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).

Does your proposal achieve both of these?

Hi @iamjrock,

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).

Thx @mzagmajster,

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 :).

Wow @mzagmajster , good luck with it then!

If you are able to implement this I am sure many in the community will be very grateful!

I know its a bit old, but did you make any progress on this one?

There is this plugin that is compatible with Mautic 5: ADRA Network / mautic-field-groups-plugin · GitLab (dev_mautic5) , all I need is add some tests.

2 Likes

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?

At the moment I have some issues with writing the tests, when tests are done I am gonna merge it to main branch.

Until then you can use the dev 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!

If you show what the issues are here, I might be able to help you.

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

Stack trace:

#0 /var/www/html/<MY.DOMAIN>/public_html/vendor/symfony/http-kernel/Kernel.php(386): AppKernel->registerBundles()

#1 /var/www/html/<MY.DOMAIN>/public_html/app/AppKernel.php(243): Symfony\Component\HttpKernel\Kernel->initializeBundles()

#2 /var/www/html/<MY.DOMAIN>/public_html/vendor/symfony/framework-bundle/Console/Application.php(168): AppKernel->boot()

#3 /var/www/html/<MY.DOMAIN>/public_html/vendor/symfony/framework-bundle/Console/Application.php(74): Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands()

#4 /var/www/html/<MY.DOMAIN>/public_html/vendor/symfony/console/Application.php(171): Symfony\Bundle\FrameworkBundle\Console\Application->doRun()

#5 /var/www/html/<MY.DOMAIN>/public_html/bin/console(16): Symfony\Component\Console\Application->run()

#6 {main}

thrown in /var/www/html/<MY.DOMAIN>/public_html/app/AppKernel.php on line 197"

Can you please do:

git fetch origin dev_mautic5
git checkout dev_mautic5
cd <mautic-root>
rm -rf var/cache/dev/prod/* var/cache/dev/dev/*
php bin/console mautic:plugins:reload --env=dev

You have to be on the right branch in order to have plugin running on Mautic 5.

thank you. I successfully switched branches, then when I get to:

php bin/console mautic:plugins:reload --env=dev

I get the same PHP Fatal error with same errors 0-6 from post above

I tried changing .env to APP_ENV=dev (was =prod) per this suggestion

issue persists

I am open to hop on a quick meeting to assist with the issue. Please send me PM if you are interrested.

Maybe you are running in production environment. Try to reload the plugins like:

php bin/console mautic:plugins:reload --env=prod

The error message you have above complains about debug dependency as far as I know, which is not included / installed in prod. env.