We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31640
    • 100 Posts
    I asked this question allready in general support thread but nobody could help...
    Hope you coders can help with this

    I had some problems with maxigallery. I succeeded in getting this working

    I have in my site 1 page with a thumbnail on it for every gallery
    this is the url: http://www.yannickmx.be/index.php?id=5
    This page is a folder
    and i have in this folder 1 document for every gallery

    It works great
    but it is too difficult for my customer !!!!

    I Explain:

    There is a folder with the following code:
    [!MaxiGallery?  &gal_query_ids=`22` &display=`embedded` &embedtype=`slimbox` &order_by=`pos` &limit=`1` 
    &max_thumb_size=`250` &quality_pic=`100` &quality_thumb=`100` &galleryPictureTpl=`mgGalPicTpl`!] 
    [!MaxiGallery?  &gal_query_ids=`21` &display=`embedded` &embedtype=`slimbox` &order_by=`pos` &limit=`1` 
    &max_thumb_size=`250` &quality_pic=`100` &quality_thumb=`100` &galleryPictureTpl=`mgGalPicTpl`!] 
    [!MaxiGallery?  &gal_query_ids=`22,21` &display=`embedded` &embedtype=`slimbox` &order_by=`pos` &limit=`99999` 
    &galleryPictureTpl=`mgGalPicTplHidden` &manageOuterTpl=`CODE:` &manageButtonTpl=`CODE:`!] 
    


    Then on every document in that folder there is the following code to put one gallery on the document
    [!MaxiGallery? &display=`embedded` &embedtype=`slimbox` &order_by=`pos` &limit=`1` 
    &max_thumb_size=`300` &quality_pic=`100` &quality_thumb=`100` &galleryPictureTpl=`mgGalPicTpl`!]
     [!MaxiGallery? &display=`embedded` &embedtype=`slimbox` &order_by=`pos` &limit=`99999`
     &galleryPictureTpl=`mgGalPicTplHidden` &manageOuterTpl=`CODE:` &manageButtonTpl=`CODE:`!]
    


    With this code there is a thumbnail with a slimbow for every document in the folder...

    When my customer needs to create a new document (gallery) she has to do 2 things that are too complicated:

    First off all she has to put the specific code on the new document...
    But that piece of code is always the same, is there a way to automatically insert the code in the documents created in the specific folder for the galleries.

    And the second item is allready mentioned, that is the fact that she has to modify the folder code: there she has to add, for XX (the newly created documented id):
    [!MaxiGallery? &gal_query_ids=`XX` &display=`embedded` &embedtype=`slimbox` &order_by=`pos` &limit=`1`
    &max_thumb_size=`250` &quality_pic=`100` &quality_thumb=`100` &galleryPictureTpl=`mgGalPicTpl`!]

    for the new gallery and she has to modify :
    [!MaxiGallery? &gal_query_ids=`22,21,XX` &display=`embedded` &embedtype=`slimbox` &order_by=`pos` &limit=`99999`
    &galleryPictureTpl=`mgGalPicTplHidden` &manageOuterTpl=`CODE:` &manageButtonTpl=`CODE:`!]

    Doze suggested to use TV to automate this proces

    But i don’t really know how i do this

    Hope you can help, because this is the last thing i need to fix to finish my first modx project smiley
      • 16034
      • 107 Posts
      If you create a template variable called galleryid and a template containing:
      [!MaxiGallery?  &gal_query_ids=`[*galleryid*]` &display=`embedded` &embedtype=`slimbox` &order_by=`pos` &limit=`1`
      &max_thumb_size=`250` &quality_pic=`100` &quality_thumb=`100` &galleryPictureTpl=`mgGalPicTpl`!]
      


      You can simplify the first issue. Then the above code will be on every page, and all the editor has to do is add the correct id to the TV "galleryid".

      If I’ve understood your post correctly, the second task is then to gather all [*galleryid*]’s from documents in a folder, and do 2 things. Run MaxiGallery for each with
      [!MaxiGallery?  &gal_query_ids=`XX` &display=`embedded` &embedtype=`slimbox` &order_by=`pos` &limit=`1` 
      &max_thumb_size=`250` &quality_pic=`100` &quality_thumb=`100` &galleryPictureTpl=`mgGalPicTpl`!] 

      and run one MaxiGallery with all galleryids:
      [!MaxiGallery?  &gal_query_ids=`XX,YY,ZZ,...` &display=`embedded` &embedtype=`slimbox` &order_by=`pos` &limit=`99999` 
      &galleryPictureTpl=`mgGalPicTplHidden` &manageOuterTpl=`CODE:` &manageButtonTpl=`CODE:`!] 


      This could be accomplished by creating a custom snippet that reads the TVs of all child-documents from the database and launches MaxiGallery several times with:
      <?php
      $modx->runSnippet(...);
      ?>
        MODx snippet-glossary 101:
        Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control
        • 31640
        • 100 Posts
        @Kleist thanks a lot man, this reply helped me a lot.

        I succeeded in creating the snippet...

        Still one tiny question...

        IS there a possibility to create a TV lets say acheckbox. And when you select the checkbox, you insert a specific chunck off code into the page.

        Why i ask this: beceause now there is one chunk in every specific gallery document.
        When my customer needs to add a new gellary he has to add that specific chunk off code.
        But my customer is really a pc noob so i want i want to do is:

        instead off adding a chunch off code, displaying a checkbox (TV) that adds the chunck.
        So the only thing my customer has to do is create a new image document, and check the checkbox saying that the new page is a gallery and not a standard document

        Is this possible???
          • 28042 ☆ A M B ☆
          • 24,524 Posts
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 31640
            • 100 Posts
            @sottwell

            thanks a lot this was the tutorial i needed to complete my project


            great stuff!!!