# Custom Contact Field Groups and UI Tabs

**URL:** https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141
**Category:** Ideas and Feature Requests
**Tags:** contacts-and-fields, user-interface
**Created:** [March 20, 2022, 5:04pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141 "2022-03-20T17:04:15Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![iamjrock](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iamjrock/32/7127_2.png) [@iamjrock](https://forum.mautic.org/u/iamjrock)
#### Post date: [March 20, 2022, 5:04pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/1 "2022-03-20T17:04:16Z")

</div>

**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](https://forum.mautic.org/t/adding-additional-groups-to-custom-fields/3035), [here](https://github.com/mautic/mautic/issues/2412), [here](https://github.com/mautic/mautic/issues/865), [here](https://github.com/mautic/mautic/issues/4276), [here](https://github.com/mautic/mautic/issues/5208) and [here](https://github.com/mautic/mautic/issues/5687).

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [March 20, 2022, 6:03pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/2 "2022-03-20T18:03:29Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![iamjrock](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iamjrock/32/7127_2.png) [@iamjrock](https://forum.mautic.org/u/iamjrock)
#### Post date: [March 20, 2022, 7:24pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/3 "2022-03-20T19:24:48Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [March 20, 2022, 9:44pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/4 "2022-03-20T21:44:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![iamjrock](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iamjrock/32/7127_2.png) [@iamjrock](https://forum.mautic.org/u/iamjrock)
#### Post date: [March 21, 2022, 5:26am UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/5 "2022-03-21T05:26:52Z")

</div>

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](https://forum.mautic.org/t/adding-additional-groups-to-custom-fields/3035/5).

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!

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [March 21, 2022, 12:31pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/6 "2022-03-21T12:31:57Z")

</div>

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

---

<div class="post-metadata">

### Author: ![iamjrock](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iamjrock/32/7127_2.png) [@iamjrock](https://forum.mautic.org/u/iamjrock)
#### Post date: [March 21, 2022, 1:02pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/7 "2022-03-21T13:02:40Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![zeljko.k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/zeljko.k/32/13803_2.png) [@zeljko.k](https://forum.mautic.org/u/zeljko.k)
#### Post date: [February 11, 2024, 9:50am UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/8 "2024-02-11T09:50:47Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [February 11, 2024, 1:59pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/9 "2024-02-11T13:59:18Z")

</div>

There is this plugin that is compatible with Mautic 5: [ADRA Network / mautic-field-groups-plugin · GitLab](https://gitlab.com/adra-network/mautic-field-groups-plugin) (dev\_mautic5) , all I need is add some tests.

---

<div class="post-metadata">

### Author: ![cfloinc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cfloinc/32/11036_2.png) [@cfloinc](https://forum.mautic.org/u/cfloinc)
#### Post date: [February 20, 2024, 11:35pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/10 "2024-02-20T23:35:17Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [February 21, 2024, 6:07pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/11 "2024-02-21T18:07:31Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![cfloinc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cfloinc/32/11036_2.png) [@cfloinc](https://forum.mautic.org/u/cfloinc)
#### Post date: [February 21, 2024, 7:16pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/12 "2024-02-21T19:16:49Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [February 21, 2024, 8:34pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/13 "2024-02-21T20:34:20Z")

</div>

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

---

<div class="post-metadata">

### Author: ![cfloinc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cfloinc/32/11036_2.png) [@cfloinc](https://forum.mautic.org/u/cfloinc)
#### Post date: [February 22, 2024, 8:45am UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/14 "2024-02-22T08:45:57Z")

</div>

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](https://gitlab.com/adra-network/mautic-field-groups-plugin.git) 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.”_

---

<div class="post-metadata">

### Author: ![cfloinc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cfloinc/32/11036_2.png) [@cfloinc](https://forum.mautic.org/u/cfloinc)
#### Post date: [February 22, 2024, 8:48am UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/15 "2024-02-22T08:48:56Z")

</div>

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"

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [February 22, 2024, 6:18pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/16 "2024-02-22T18:18:09Z")

</div>

Can you please do:

```auto
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.

---

<div class="post-metadata">

### Author: ![cfloinc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cfloinc/32/11036_2.png) [@cfloinc](https://forum.mautic.org/u/cfloinc)
#### Post date: [February 22, 2024, 7:30pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/17 "2024-02-22T19:30:34Z")

</div>

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

---

<div class="post-metadata">

### Author: ![cfloinc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cfloinc/32/11036_2.png) [@cfloinc](https://forum.mautic.org/u/cfloinc)
#### Post date: [February 22, 2024, 7:37pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/18 "2024-02-22T19:37:58Z")

</div>

I tried changing .env to APP\_ENV=dev (was =prod) per this suggestion

> <https://github.com/mautic/mautic/issues/3514#issuecomment-682128477>
>
> What type of report is this:
> 
> | Q | A
> | ---| ---
> | Bug report? | Y
> | Featu…re request? | N
> | Enhancement? | N
> 
> \## Description:
> 
> \`PHP Fatal error: Uncaught Symfony\\Component\\Debug\\Exception\\ClassNotFoundException: Attempted to load class "WebProfilerBundle" from namespace "Symfony\\Bundle\\WebProfilerBundle".
> Did you forget a "use" statement for another namespace? in /home/douglas/mautic.dev/public\_html/app/AppKernel.php:218
> Stack trace:
> \#0 /home/douglas/mautic.dev/public\_html/vendor/symfony/http-kernel/Kernel.php(430): AppKernel-\>registerBundles()
> \#1 /home/douglas/mautic.dev/public\_html/app/AppKernel.php(257): Symfony\\Component\\HttpKernel\\Kernel-\>initializeBundles()
> \#2 /home/douglas/mautic.dev/public\_html/vendor/symfony/framework-bundle/Console/Application.php(70): AppKernel-\>boot()
> \#3 /home/douglas/mautic.dev/public\_html/vendor/symfony/console/Application.php(124): Symfony\\Bundle\\FrameworkBundle\\Console\\Application-\>doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
> \#4 /home/douglas/mautic.dev/public\_html/app/console(41): Symfony\\Component\\Console\\Application-\>run(Object(Symfony\\Component\\Con in /home/douglas/mautic.dev/public\_html/app/AppKernel.php on line 218\`
> 
> \## If a bug:
> 
> | Q | A
> | --- | ---
> | Mautic version | 2.6.1
> | PHP version | 7.0.8
> 
> \### Steps to reproduce:
> 1. php app/console cache:clear --env=dev
> 2. 
>  
> \### Log errors: 
> 
> \_Please check for related errors in the latest log file in \[mautic root\]/app/log/ and/or the web server's logs and post them here. Be sure to remove sensitive information if applicable.\_

issue persists

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [February 22, 2024, 9:47pm UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/19 "2024-02-22T21:47:41Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)
#### Post date: [February 23, 2024, 8:45am UTC](https://forum.mautic.org/t/custom-contact-field-groups-and-ui-tabs/23141/20 "2024-02-23T08:45:26Z")

</div>

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

```auto
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.
