Disable Javascript Aggregation on specific pages
Disable Javascript Aggregation on specific pages 1 CommentsOptimising Drupal sites by reducing the overheads of numerous css files and js files spit out by modules can be done using the following modules:
However, aggregating Javascript which also Gzip and minifies all js files into one may case some problems as TinyMCE or FCK Editor and some jquery functionalities like expand / Collapse might not work.
These features are mostly used in the admin section. so to work round this we can hook into the Drupal preprocessor to turn off aggregation on the admin specific pages:
use the hook_init() in a custom module as follows:
function my_module_init() {
$uri_path = trim($_SERVER['REQUEST_URI'], '/');
$uri_parts = explode('/', $uri_path);
if($uri_parts[0] == 'admin') { // Disables javascript pre process in all admin pages
global $conf;
$conf['preprocess_js'] = FALSE;
}
}









International Tibet Support Network
Bookbloc
Styles Webbin
Does this also work with the core js optimization?
Post new comment