3

I have the following in my template.php file, in my custom theme:

function shriver_css_alter(&$css) {
    unset($css[drupal_get_path('module','civicrm').'/css/civicrm.css']);
}

It doesn't work, though. I can disable other stylesheets this way, but not this one. I know I can disable this stylesheet in civicrm settings, but then it is disabled on the back end as well. I only want it to be disabled on the public pages. Since I use a different admin theme than my public one, I thought it made sense to disable it for my public theme only.

Can someone help me to get this to work? Or, if you know a different method, that would be good, too. Thank you.

2

This is the correct way to disable civicrm.css on the front end. Put this in the template.php file of your theme:

function shriver_css_alter(&$css) { unset($css['sites/all/modules/civicrm/css/civicrm.css']); }

Manually enter the path to the css. When I used drupal_get_path('module','civicrm'), it would output sites/all/modules/civicrm/drupal/css/civicrm.css. Not sure why it added 'drupal' to the path but that was the problem.

0

You can also use the CiviCRM Theme module in Drupal Administration menus:

Drupal Modules Menu

Then, the following menu appears at the bottom of the Drupal Appearance menu:

Allow different themes to be used for front-facing CiviCRM pages

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.