We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8109
    • 128 Posts
    I have an MG call on a page that displays a single image. If there is another MG call on the same page that calls up a gallery with more than one image, then the single image will display in slimbox as expected. Otherwise it is opened in a new page.

    Here’s what I’m doing

    1. I have a snippit that calls the MG call and substitutes teh image ID placeholder This is handy, as it takes a legnthy snippit call and makes a short one!

    [[mg1Pic? &mgPicID=`636`]]

    where mg1Pic is:

    <?php
       $params['mgPicID']=$mgPicID;
       $chunk=$modx->parseChunk('mg1PicCall', $params, '[+', '+]');
       return $chunk;
    ?>
    


    and the chunk mg1PicCall looks like this:

    [!MaxiGallery? &pic_query_ids=`[+mgPicID+]` &galleryOuterTpl=`mg1PicGOT` &galleryPictureTpl=`mg1PicGPT`!]

    The templates are:

    Gallery outer Template (mg1PicGOT)

    <div class="inlinePic">
    [+maxigallery.pictures+]
    </div>



    Picture Template (mg1PicGPT)

    <a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="lightbox[set[+maxigallery.picture.id+]]" title="{{mgSlimboxCaption}}">
    
    <img src="[*myimage:phpthumb=`hp=225&wl=225&ws=180&q=80#[+maxigallery.path_to_gal+][+maxigallery.picture.filename+]#1`*]" class="thumb" title="[+maxigallery.picture.title:notags+]" alt="[+maxigallery.picture.title:notagst+]" />
    
    </a>


    But even if I jsut place the MG snippit call directly, there problem persists. Ideas?
      Revo 2.0.8-pl
      • 7923
      • 4,213 Posts
      add &display=`embedded` &embedtype=`slimbox` to the snippet call so that MaxiGallery knows to include slimbox resources to the html head.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 8109
        • 128 Posts
        Oh how stupid of me! I have those in my gallery calls, so this is why it worked when the gallery was on the page... how interesting. Thanks!

          Revo 2.0.8-pl