CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Css problem after upgrade to 3.3.x (Drupal)
Pages: [1]

Author Topic: Css problem after upgrade to 3.3.x (Drupal)  (Read 1053 times)

bijama1

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
Css problem after upgrade to 3.3.x (Drupal)
January 07, 2011, 11:06:54 am
I have a CiviCRM Profile "Name and Address" with the Option "Used for: View/Edit Drupal User Account" enabled. So the data is nicely display when the authenticated user clicks on "My Account" and is transferred to http://mysite.org/users/username.

After upgrade from 3.2.5 to 3.3.1 or 3.3.2 all the formatting was gone and the page looked ugly.

After installing forth an back I saw that on the page the lines

<link type="text/css" rel="stylesheet" media="all" href="/drupal/sites/all/modules/civicrm/drupal/../css/deprecate.css?k" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal/sites/all/modules/civicrm/drupal/../css/civicrm.css?k" />
<link type="text/css" rel="stylesheet" media="all" href="/drupal/sites/all/modules/civicrm/drupal/../css/extras.css?k" />

were missing.

Comparing the function civicrm_html_head() in civicrm.module of version 3.2.5 and 3.3.2 showed that in
Version 3.3.2. the lines

        drupal_add_css(drupal_get_path('module', 'civicrm') . '/../css/deprecate.css');
        drupal_add_css(drupal_get_path('module', 'civicrm') . '/../css/civicrm.css');
        drupal_add_css(drupal_get_path('module', 'civicrm') . '/../css/extras.css'); 

are inside "if ( arg(0) == 'civicrm' ) {" in version 3.2.5. outside.

Moving the curly brace

   } //inserted here    
        if ( isset( $config->customCSSURL ) && ! empty( $config->customCSSURL ) ) {
            $head  = "<style type=\"text/css\">@import url({$config->customCSSURL});</style>\n";
        } else {
            drupal_add_css(drupal_get_path('module', 'civicrm') . '/../css/deprecate.css');
            drupal_add_css(drupal_get_path('module', 'civicrm') . '/../css/civicrm.css');
            drupal_add_css(drupal_get_path('module', 'civicrm') . '/../css/extras.css');
        }
  }   //removed here

solved the problem in a first run.

But I think thats not a professional solution.
Did I miss something in the configuration?
 


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Css problem after upgrade to 3.3.x (Drupal)
January 07, 2011, 01:22:34 pm
The thinking behind that change was that My Account and User Registration are "Drupal" pages and should be styled by the Drupal theme (similarly to Views pages which contain CiviCRM content / data). in other words, "get out of the way". That said, I think there are valid arguments for either approach and the pages look better with civicrm.css in place then w/ default theme css (i.e. Garland etc.). Not sure what the right long-term solution is, but given that the page elements have crm-xxxxx css classes - might be best to just paste the relevant declarations from civicrm.css into your drupal theme css.
Protect your investment in CiviCRM by  becoming a Member!

bijama1

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
Re: Css problem after upgrade to 3.3.x (Drupal)
January 07, 2011, 01:59:15 pm
Thank you for the answer Dave.
I fully understand your argument. The only thing I might add is, that, as long as there is the option to invoke civicrm generated code in drupal pages, civicrm should provide the used css classes and not leave it to all the many drupal themes.

An other option might be to give contact/user data management completely to civicrm - but than access to username and password would be required.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Css problem after upgrade to 3.3.x (Drupal)

This forum was archived on 2017-11-26.