We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15175
    • 116 Posts
    I’m not sure if this question would better in the Maxigallery forum. Anyways, what I need to do is pass the amount of images in a gallery to Ditto, and I cannot work out how to do it.

    This is the snippet I am using in the template for the individual gallery pages:

    <?php
    $id = $modx->documentIdentifier;
    $sql = $modx->db->query( "SELECT COUNT(*) FROM modx_maxigallery WHERE gal_id = ('$id') ");
    $result = mysql_result($sql,"0");
    return  $result;
    ?>
    


    Now when the snippet is used via ditto it is using the ID of the page that contains the ditto call and returns ’0’. What to do?


      • 15175
      • 116 Posts
      OK, got it sorted - I had to pass the ditto instance id into the snippet.

      I created a new snippet called ’ditto-count-pics’:

      <?php
      $sql = $modx->db->query( "SELECT COUNT(*) FROM modx_maxigallery WHERE gal_id = ('$ditto_id') ");
      $result = mysql_result($sql,"0");
      return  $result;
      ?>


      and this is the snippet call in my Ditto template:

      [!ditto-count-pics? &ditto_id=`[+id+]`!]


        • 2632
        • 18 Posts
        I have a page, which is aggregating subpages using Ditto. Each subpage has a gallery, using maxigallery. The MaxiGallery call is in the template for this subpage. The content (only some additional text to the gallery) is edited in tinymce.

        When I preview my top page, all subpages are shown, just like I want them. But the galleries are missing...

        When previewin just a subpage from the manager I can edit the gallery, the pictures are shown.

        What am I doing wrong?
          • 2632
          • 18 Posts
          problem solve i work around and fmade this call on my galleries document

          [!MaxiGallery? &display=`embedded` &tpl=`galleryPictureTpl` &gal_query_ids=`72` &embedtype=`colorbox` &pics_per_row=`6` &max_thumb_size=`110` &max_pic_size=`0` &thumb_use_dropshadow=`1` !]


          &gal_query_ids=`72` it ducument id of gallery