2

I use drupal 6. How do I remove global.css from certain path like cart* and replace it with another css? I can add for example stylesheets[all][] = custom.css inside my theme info file but how to load it only on path cart* and how to disable global.css on the same path? Thank you

3

You would need to use your theme to watch for it. You'll need to hook into preprocess_page and look for the global.css file in the css array and unset it. Below is an example of how to remove the modules/system/system.css you'll need to see where in the array global.css is and do the same thing. You'll want to wrap that inside of an if for your paths. In this example I use arg() to get the first path value (ie cart) and turn it on for that case. You can do what ever you want.

function phptemplate_preprocess_page(&$vars)
{
    if(arg(0) == 'cart') {
        $css = $vars['css'];
        unset($css['all']['module']['modules/system/system.css']);
        $vars['styles'] = drupal_get_css($css);
    }
}
| improve this answer | |

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.