We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30328
    • 35 Posts
    Hi,

    I’m trying to stop MaxiGallery from putting links to javascript files in the head of the page when managing galleries. I have tried putting &disable_js_libs=`1` into the snippet call, but it seems to have no effect, the javascript files still show up, - so I’m not sure if I’m somehow doing it wrong. Does anyone know how should I make this call?

    Thanks,

    Tommy T.
      • 7923
      • 4,213 Posts
      &disable_js_libs=`1` makes MaxiGallery not include the mootools/scriptaculous/prototype js libraries, but it still includes slimbox/smoothgallery/slidebox, etc scripts if you are using those display types.

      If you do not need those, use the normal display mode and make custom templates to format the output the way it’s needed for your js script. Look at the default templates for examples if they contain the format that you need.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 30328
        • 35 Posts
        Hi,

        Thanks for your reply, however...

        Even when setting &disable_js_libs=`1`, and using normal mode, I have these libraries included on the manage gallery page:

        /assets/snippets/maxigallery/js/draggableReorder.js
        /assets/snippets/maxigallery/js/mooSortables.js

        So it does seem to include the mootools libraries for me. How can I stop these from showing up?

        Tommy T.
          • 30328
          • 35 Posts
          I’ve had a bit of a delve into the source, and in maxigallery.php, I’ve enclosed where it adds these two scripts to the head, in an if statement:
          if(!$mg->mgconfig['disable_js_libs']) { 
            $modx->regClientStartupScript($modx->config['base_url'] . MAXIGALLERY_PATH . 'js/draggableReorder.js');
            $modx->regClientStartupScript($modx->config['base_url'] . MAXIGALLERY_PATH . 'js/mooSortables.js');
          }
          

          And now the headers are not added. Is this the right thing to do?

          Tommy T.
            • 7923
            • 4,213 Posts
            Oh yea, those libraries required for the drag sorting are always added to the header, I’ll get that fixed. Thanks.


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."