Answers.Body: <p>For folks looking for a no-coding solution to this, you can use the <a href="https://civicrm.org/extensions/contact-layout-editor" rel="nofollow noreferrer">Contact Layout Editor</a> extension to change icons.  After installing the extension, go to <strong>Administer menu » Customize Data and Screens » Contact Summary Layouts</strong>.  You can click on the icon on a tab (see screenshot below) and it will bring up a menu of FontAwesome icons to choose from.</p>
  
  <p><a href="https://i.sstatic.net/IOdwr.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/IOdwr.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-13T16:09:17.453Z
Answers.Text: This is very good to know - we don't use that extension currently but it looks very appealing.
Answers.UserDisplayName: RayWright
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-13T16:13:48.463Z
Answers.Text: Wow that's a lot of tabs!
Answers.UserDisplayName: Coleman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-13T16:06:29.893Z
Answers.LastActivityDate: 2020-03-13T16:06:29.893Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>I found there were two parts to this, first I needed to identify the current array that was setting the 'default' gear icon, then I needed to set a new one.</p>
  
  <p>This page describes the basics of the tabset hook - so I started with that as a base: <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_tabset/" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_tabset/</a> I built the basic hook </p>
  
  <p>Then I had to figure out which nested array held the information for my custom data and I was unable to perform the code that follows without the array number (not just the custom data number). In my case, it is an 'alerts' tab. This was tricky because the number can change depending on the contact, so I couldn't just ask it to look for the 15th array, because it could be a different number per contact. <a href="https://civicrm.stackexchange.com/questions/3682/how-can-i-hide-specific-tabs-in-member-view-regardless-of-viewer-permissions">I used this post's logic</a> to search the array for the id containing my custom data.</p>
  
  <p>With the array number, I was able to reset the icon part of the array</p>
  
  <pre><code>function mymodule_civicrm_tabset($tabsetName, &amp;$tabs, $context) {
    //check if the tabset is Contact Summary Page
    if ($tabsetName == 'civicrm/contact/view') {
      // get the number of the tabset, change custom_00 to the number of your custom data fieldset
      $alertstabnum = array_search('custom_00', array_column($tabs, 'id'));
      // change the icon from the default gear icon
      $tabs[$alertstabnum]['icon'] = 'crm-i fa-flag';
    }
  }
  </code></pre>
  
  <p>If there's an 'easier' way or something already set up in the tabset hook, I'm all ears this is just what I found to work.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-13T15:59:44.987Z
Answers.LastActivityDate: 2020-03-13T15:59:44.987Z
Answers.UserDisplayName: RayWright
Body: <p>Now that there are icons on all the tab sets (awesome, btw) - I'd like to change the standard gear icon that appears on any custom contact field sets that are set to display as a tab. I didn't see anywhere in the interface that I could select a fa icon to use.</p>
  
  <p>I know the hook_civicrm_tabset can be used if you've added a tab as part of an extension, you can just include the <code>'icon' =&gt; 'crm-i fa-yourchoicehere'</code> line in your array. But I'm wondering how to apply that to an existing tab set.</p>
  
Tags: <custom-fields><hooks><contact-view>
Title: How can I customize the default gear icon on a custom tab set?
ThreadText: # How can I customize the default gear icon on a custom tab set?
  
  (Asked by: username_0 on 2020-03-13)
  
  Now that there are icons on all the tab sets (awesome, btw) - I'd like to change the standard gear icon that appears on any custom contact field sets that are set to display as a tab. I didn't see anywhere in the interface that I could select a fa icon to use.
  
  I know the hook\_civicrm\_tabset can be used if you've added a tab as part of an extension, you can just include the `'icon' => 'crm-i fa-yourchoicehere'` line in your array. But I'm wondering how to apply that to an existing tab set.
  
  **Tags:** custom-fields, hooks, contact-view
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-03-13. Score: 3
  
  For folks looking for a no-coding solution to this, you can use the [Contact Layout Editor](https://civicrm.org/extensions/contact-layout-editor) extension to change icons. After installing the extension, go to **Administer menu » Customize Data and Screens » Contact Summary Layouts**. You can click on the icon on a tab (see screenshot below) and it will bring up a menu of FontAwesome icons to choose from.
  
  [![enter image description here](https://i.sstatic.net/IOdwr.png)](https://i.sstatic.net/IOdwr.png)
  
  > **Comments:**
  > **username_0**: This is very good to know - we don't use that extension currently but it looks very appealing.  
  > **username_2**: Wow that's a lot of tabs!  
  
  ---
  
  ### Answer by username_0 on 2020-03-13. Score: 1
  
  I found there were two parts to this, first I needed to identify the current array that was setting the 'default' gear icon, then I needed to set a new one.
  This page describes the basics of the tabset hook - so I started with that as a base: https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_tabset/ I built the basic hook 
  Then I had to figure out which nested array held the information for my custom data and I was unable to perform the code that follows without the array number (not just the custom data number). In my case, it is an 'alerts' tab. This was tricky because the number can change depending on the contact, so I couldn't just ask it to look for the 15th array, because it could be a different number per contact. I used this post's logic to search the array for the id containing my custom data.
  With the array number, I was able to reset the icon part of the array
  function mymodule_civicrm_tabset($tabsetName, &$tabs, $context) {
    //check if the tabset is Contact Summary Page
    if ($tabsetName == 'civicrm/contact/view') {
      // get the number of the tabset, change custom_00 to the number of your custom data fieldset
      $alertstabnum = array_search('custom_00', array_column($tabs, 'id'));
      // change the icon from the default gear icon
      $tabs[$alertstabnum]['icon'] = 'crm-i fa-flag';
    }
  }
  
  If there's an 'easier' way or something already set up in the tabset hook, I'm all ears this is just what I found to work.
  
  
  ---
  
  