Answers.Body: <p>There are 3 solutions on how to achieve this</p>
  
  <p>1 - Adding Javascript in tpl file as mentioned by Demerit</p>
  
  <pre><code>{literal}
  &lt;script type="text/javascript"&gt;
    CRM.$(function($) {
      $('.crm-report-form-block select[name="groups"]').closest('td').hide();
    });
  &lt;/script&gt;
  {/literal}
  </code></pre>
  
  <p>2 - Adding a code using buildForm hook in an extension</p>
  
  <pre><code>function membershipapproval_civicrm_buildForm($formName, &amp;$form) {
    // unset from all reports
    // Change if condition to $formName == 'CRM_Report_Form_Event/Summary'
    // if want to hide on specific event
    if (get_parent_class($form) == 'CRM_Report_Form') {
      $groupsElementIndex = CRM_Utils_Array::value('groups', $form-&gt;_elementIndex);
      if ($groupsElementIndex) {
        unset($form-&gt;_elements[$groupsElementIndex]);
      }
    }
  }
  </code></pre>
  
  <p>3 - Adding CSS in tpl file as</p>
  
  <pre><code>{literal}
  &lt;style type="text/css"&gt;
   #s2id_groups {
    display:none;
   }
  &lt;/style&gt;
  {/literal}
  </code></pre>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-16T00:18:27.213Z
Answers.LastActivityDate: 2019-01-16T16:25:53.343Z
Answers.LastEditDate: 2019-01-16T16:25:53.343Z
Answers.UserDisplayName: Pradeep Nayak
Answers.Body: <p>You might be able to do it with css but I might use jquery instead:</p>
  
  <pre><code>{literal}
  &lt;script type="text/javascript"&gt;
  CRM.$(function($) {
    $('#s2id_groups').hide();
  });
  &lt;/script&gt;
  {/literal}
  </code></pre>
  
  <p>The problem with css might also be that you don't have a <code>&lt;style type="text/css"&gt;</code> tag around your css?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-16T00:10:34.507Z
Answers.Text: Thanks Demerit. Adding the style tag was needed. I haven't done much with these tpl files so great to know what is needed.
Answers.UserDisplayName: Andy Burns
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-15T23:24:55.177Z
Answers.LastActivityDate: 2019-01-15T23:24:55.177Z
Answers.UserDisplayName: Demerit
Body: <p>I've added CSS to a Summary.extra.tpl file to change reports. But the CSS does not apply.</p>
  
  <p>Adding the CSS by itself crashes the report (character encoding issue) so adding the {literal} tag is what I have.</p>
  
  <pre><code>{literal}
  #s2id_groups {display:none;}
  {/literal}
  </code></pre>
  
  <p>I am trying to remove the add contacts to group dropdown.</p>
  
  <p><a href="https://i.sstatic.net/nHX79.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/nHX79.png" alt="enter image description here"></a></p>
  
Tags: <css><custom-templates>
Title: Adding CSS to extra tpl file
ThreadText: # Adding CSS to extra tpl file
  
  (Asked by: username_0 on 2019-01-15)
  
  I've added CSS to a Summary.extra.tpl file to change reports. But the CSS does not apply.
  Adding the CSS by itself crashes the report (character encoding issue) so adding the {literal} tag is what I have.
  {literal}
  #s2id_groups {display:none;}
  {/literal}
  
  I am trying to remove the add contacts to group dropdown.
  
  **Tags:** css, custom-templates
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-01-15. Score: 4 | Accepted answer
  
  You might be able to do it with css but I might use jquery instead:
  {literal}
  
  {/literal}
  
  The problem with css might also be that you don't have a
  
  > **Comments:**
  > **username_0**: Thanks username_2. Adding the style tag was needed. I haven't done much with these tpl files so great to know what is needed.  
  
  ---
  
  ### Answer by username_1 on 2019-01-16. Score: 3
  
  There are 3 solutions on how to achieve this
  1 - Adding Javascript in tpl file as mentioned by username_2
  {literal}
  
  {/literal}
  
  2 - Adding a code using buildForm hook in an extension
  function membershipapproval_civicrm_buildForm($formName, &$form) {
    // unset from all reports
    // Change if condition to $formName == 'CRM_Report_Form_Event/Summary'
    // if want to hide on specific event
    if (get_parent_class($form) == 'CRM_Report_Form') {
      $groupsElementIndex = CRM_Utils_Array::value('groups', $form->_elementIndex);
      if ($groupsElementIndex) {
        unset($form->_elements[$groupsElementIndex]);
      }
    }
  }
  
  3 - Adding CSS in tpl file as
  {literal}
  
  {/literal}
  
  HTH
  Pradeep
  
  
  ---
  
  