Answers.Body: <p>Some of it is added via javascript, e.g. <a href="https://github.com/civicrm/civicrm-core/blob/5.15.2/js/crm.menubar.js#L104" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/blob/5.15.2/js/crm.menubar.js#L104</a></p>
  
  <p>But as this ticket notes the rest depends a bit on the CMS and the theme and is inconsistent:   <a href="https://lab.civicrm.org/dev/core/issues/300" rel="nofollow noreferrer">https://lab.civicrm.org/dev/core/issues/300</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-06T06:30:55.927Z
Answers.LastActivityDate: 2019-08-06T06:30:55.927Z
Answers.UserDisplayName: Demerit
Answers.Body: <p>I was using Drupal 8 adminimal theme and shoreditch civicrm theme. but civicrm tab for contact were not showing correctly as expected. Found issue that civicrm class build using url path were not present.</p>
  
  <p>Following block should be present in hook_preprocess_HOOK, This is total CMS functionality. </p>
  
  <p>File Ref : adminimal_theme/adminimal_theme.theme</p>
  
  <pre><code>/**
   * Implements hook_preprocess_HOOK() for HTML document templates.
   */
  function adminimal_theme_preprocess_html(&amp;$variables) {
    // Add adminimal class to the body.
    $path_args = explode('/', \Drupal::request()-&gt;getPathInfo());
    $path_args = array_filter($path_args);
    if ($suggestions = theme_get_suggestions($path_args, 'page', '-')) {
      foreach ($suggestions as $suggestion) {
        $variables['attributes']['class'][] = $suggestion;
      }
    }
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-08-06T08:25:29.790Z
Answers.LastActivityDate: 2019-08-07T15:25:10.270Z
Answers.LastEditDate: 2019-08-07T15:25:10.270Z
Answers.UserDisplayName: Sunil Pawar
Body: <p>Does anybody have an idea, how and where we build CiviCRM class on body tag.?
  <a href="https://i.sstatic.net/kqJMP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/kqJMP.png" alt="enter image description here"></a>
  E.g. 1</p>
  
  <ul>
  <li>URL:<a href="https://domain.com/civicrm/admin/setting/updateConfigBackend?reset=1" rel="nofollow noreferrer">https://domain.com/civicrm/admin/setting/updateConfigBackend?reset=1</a></li>
  <li>Class : html not-front logged-in page-civicrm page-civicrm-admin page-civicrm-admin-setting page-civicrm-admin-setting-updateconfigbackend</li>
  </ul>
  
  <p>E.g. 2</p>
  
  <ul>
  <li>URL: <a href="https://domain.com/civicrm/admin/setting/path?reset=1" rel="nofollow noreferrer">https://domain.com/civicrm/admin/setting/path?reset=1</a></li>
  <li>Class: html not-front logged-in page-civicrm page-civicrm-admin page-civicrm-admin-setting page-civicrm-admin-setting-path</li>
  </ul>
  
  <p>Basically class build using civicrm url</p>
  
  <ul>
  <li>page-civicrm-admin-setting-updateconfigbackend</li>
  <li>page-civicrm-admin-setting </li>
  <li>page-civicrm-admin  </li>
  <li>page-civicrm</li>
  </ul>
  
Tags: <evaluating-civicrm><ui>
Title: how civicrm class prepared on body tag
ThreadText: # how civicrm class prepared on body tag
  
  (Asked by: username_0 on 2019-08-06)
  
  Does anybody have an idea, how and where we build CiviCRM class on body tag.?
  [![enter image description here](https://i.sstatic.net/kqJMP.png)](https://i.sstatic.net/kqJMP.png)
  E.g. 1
  
  * URL:<https://domain.com/civicrm/admin/setting/updateConfigBackend?reset=1>
  * Class : html not-front logged-in page-civicrm page-civicrm-admin page-civicrm-admin-setting page-civicrm-admin-setting-updateconfigbackend
  
  E.g. 2
  
  * URL: <https://domain.com/civicrm/admin/setting/path?reset=1>
  * Class: html not-front logged-in page-civicrm page-civicrm-admin page-civicrm-admin-setting page-civicrm-admin-setting-path
  
  Basically class build using civicrm url
  
  * page-civicrm-admin-setting-updateconfigbackend
  * page-civicrm-admin-setting
  * page-civicrm-admin
  * page-civicrm
  
  **Tags:** evaluating-civicrm, ui
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-08-06. Score: 1
  
  Some of it is added via javascript, e.g. <https://github.com/civicrm/civicrm-core/blob/5.15.2/js/crm.menubar.js#L104>
  
  But as this ticket notes the rest depends a bit on the CMS and the theme and is inconsistent: <https://lab.civicrm.org/dev/core/issues/300>
  
  
  ---
  
  ### Answer by username_0 on 2019-08-06. Score: 1
  
  I was using Drupal 8 adminimal theme and shoreditch civicrm theme. but civicrm tab for contact were not showing correctly as expected. Found issue that civicrm class build using url path were not present.
  
  Following block should be present in hook\_preprocess\_HOOK, This is total CMS functionality.
  
  File Ref : adminimal\_theme/adminimal\_theme.theme
  
  ```
  /**
   * Implements hook_preprocess_HOOK() for HTML document templates.
   */
  function adminimal_theme_preprocess_html(&$variables) {
    // Add adminimal class to the body.
    $path_args = explode('/', \Drupal::request()->getPathInfo());
    $path_args = array_filter($path_args);
    if ($suggestions = theme_get_suggestions($path_args, 'page', '-')) {
      foreach ($suggestions as $suggestion) {
        $variables['attributes']['class'][] = $suggestion;
      }
    }
  }
  
  ```
  
  
  ---
  
  