1

Some of my pane's are causing the pane's editor to crash (some cause the grears to dissapear, some cause the add new panes element to break). We'd therefore like to disable the preview option in Panels, it looks like Panopoly has the option to do this: https://www.drupal.org/node/2171809. "Enable Previews when adding Panes"

Does anyone know how this could be done on the panels module for Drupal 7? We're not using Panopoly.

The reason behind it not working is that Panels was written against jquery 1.4 and some of my blocks that are being previewed when adding panes to the page manager are panels 1.9+

1 Answer 1

1

I had same problem in one of my project. Then what I did, I added a custom code to remove all the js files except drupal core js, Panels js, Token Js, Ctools js and Views Js. And it is only for the panel pages so it solve the issue of jquery version. We also have a drupal module jqmulti for this. But in some cases it also do not work well. That is why I removed all the unwanted js files from panel page. Here is the sample code for this.

function custom_module_js_alter(&$js){
  if(arg(0) == 'admin' && arg(1) == 'structure' && arg(2) == 'pages'){
    $allow = array('modules/filter/filter.js', 'modules/field/modules/text/text.js', 'modules/file/file.js');
    foreach($js as $key => $value){
      $pos =  strpos($key, 'misc');
      if(strstr($key, 'misc') == '' && $key != 'settings' && strstr($key, 'ctools') == '' && strstr($key, 'panels') == '' && strstr($key, 'views') == '' && strstr($key, 'token') == '' && strstr($key, 'admin_menu') == '' && !in_array($key, $allow)){
        unset($js[$key]);
      }
    }
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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