We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1511
    • 144 Posts
    I have a container with several child galleries. The container is not published and I use Ditto to list the galleries. But would like to show child galleries directly, without using MaxiGallerySolo + Ditto combination.

    Is there a way to use something like [!MaxiGallery?&display=`childgalleries` &parentId=`xx`!]? Otherwise it would be a feature request.

    Maybe I can program it as soon as I finish today’s work. smiley
      • 1511
      • 144 Posts
      Here, done it already. grin Modified MaxiGallery 0.5 beta 2 rev 049.

      Near the top of the maxigallery.php (line 17) substitute the following code
      ///////////////////////////////////////////////////////////////////////////////////////////////////
      // Default values (can be overridden in the snippet call), 
      // No need to edit unless you know what you're doing!
      //
      
      $mgconfig['debug'] = (isset($debug)) ? $debug : 0; //[0 | 1] display debug trace
      $mgconfig['lang'] = (isset($lang)) ? $lang : "en"; // [ en | fi | de | fr ] (you can add more by your self, see lang_en.php for example) 
      with
      ///////////////////////////////////////////////////////////////////////////////////////////////////
      // Default values (can be overridden in the snippet call), 
      // No need to edit unless you know what you're doing!
      //
      
      $mgconfig['parentId'] = (isset($parentId)) ? $parentId : false; // [ true | false ]
      $mgconfig['debug'] = (isset($debug)) ? $debug : 0; //[0 | 1] display debug trace
      $mgconfig['lang'] = (isset($lang)) ? $lang : "en"; // [ en | fi | de | fr ] (you can add more by your self, see lang_en.php for example) 
      This adds a parameter (parentId) to the snippet call.

      And now, near line 608 change
      //-------------------------------------------------------------------------------------------------
      // Childgalleries
      //-------------------------------------------------------------------------------------------------
      
      if($mg->mgconfig['display']=="childgalleries") {
      	$pageinfo=$modx->getPageInfo($modx->documentIdentifier,1, "id, pagetitle, description, alias, createdby");
      	$children = $mg->getAllSubDocuments($pageinfo['id'], "menuindex", "asc", $mg->mgconfig['childgalleries_level_limit'], true, false);
      with
      //-------------------------------------------------------------------------------------------------
      // Childgalleries
      //-------------------------------------------------------------------------------------------------
      
      if($mg->mgconfig['display']=="childgalleries") {
      	
        if ($mg->mgconfig['parentId'] != false) {
      	  $parent_Id = $mg->mgconfig['parentId'];
      	} else {
        	  $pageinfo=$modx->getPageInfo($modx->documentIdentifier,1, "id, pagetitle, description, alias, createdby");	
      	  $parent_Id = $pageinfo['id'];
      	}
      	
      	$children = $mg->getAllSubDocuments($parent_Id, "menuindex", "asc", $mg->mgconfig['childgalleries_level_limit'], true, false);
      


        • 7923
        • 4,213 Posts
        Good that you got it done by yourself, but the SVN version would have already had this ability.. So if you can access SVN repositories, go grab the latest trunk from there..


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 12387
          • 20 Posts
          Hi, I want to show on homepage thumbnails of latest pics from childgalleries under other parent, can I get it using the last snippet (0.5.2)? The code in latest snippet differ from examples shown here, so it’s difficult to use them.
            • 7923
            • 4,213 Posts
            In the latest MaxiGallery, you can use the &childgalleries_ids parameter to define parent document(s) where to look for child galleries.


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 12387
              • 20 Posts
              Thanks a bunch, it’s worked!