We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7923
    • 4,213 Posts
    You need to use the &manage_target and &is_target parameters to make the picture management on a separate document, because there are two gallery calls in the same document. See the parameters in wiki page to get an idea how to use them. Basically you create a new document (hidden one for example) that has the same snippet call, but with &is_target=`1` in the parameters. Then in document where you have your gallery call, you use &manage_target=`id_of_the_document_that_you_created`. Every gallery can use the same document to manage the pictures, if the picture settings (size etc) are common to all galleries.


      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
      • 27330
      • 884 Posts
      Quote from: doze at Mar 17, 2008, 03:40 AM

      Yes, or you could use the &keep_bigimg=`1` parameter to have also bigger version of the images (size is controlled with &max_big_size parameter). Then do another document for the popup gallery that uses &view_gallery parameter to view the gallery from the original document, but modify the galleryPictureTpl that instead of showing normal images, show the big images (filename prefixed with "big_").

      Sorry for waking this dead thread, but I have a quick question about it smiley

      can you think of a way this can be done dynamically without adding a new document for each gallery?
      I mean like a one popup document that gets the ID of the gallery document and displays it with different parameters?
      I’m trying to avoid creating 2 documents for each gallery...

      any idea appreciated.
        • 7923
        • 4,213 Posts
        Sure, just use a call:

        [!MaxiGallery? &view_gallery=`[[get_gal_id]]`!]

        and do a get_gal_id snippet:
        return $_GET['gal_id'];
        


        Then you can call that document with mysite.com/page.html?gal_id=21 to view a gallery from the document id 21.

        Or to build a link with MODx tags, use [~32~]?gal_id=21 where 32 is the document that has the snippet call above and 21 is the document that holds the gallery you want to view.


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 27330
          • 884 Posts
          thanks doze for looking into it.

          I tried modifying the JS and added this
          <a href="[~32~]?gal_id=[~[*id*]~]"  onmouseover="javascript:showPic....


          (32 is indeed my document with the get_gal_id snippet, cool like your example smiley


          Whats good is that the link open but I get this parse error
          « MODx Parse Error »
          MODx encountered the following error while attempting to parse the requested resource:
          « `one-more-item1.php` is not numeric and may not be passed to makeUrl() »


          though the URL display this
          http://domain.com/popup-gallery.php?gal_id=31

          maybe it has something to do with my FURL? I don’t have friendly alias if it matters.
            • 7923
            • 4,213 Posts
            That’s because you are also making the id document variable to an url, try this instead:

            <a href="[~32~]?gal_id=[*id*]"  onmouseover="javascript:showPic....


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 27330
              • 884 Posts
              You are the man! now just some polishing and I have NewEgg.com Like gallery smiley

              do u mind explaining me the difference between [*id*] and [~[*id*]~] or where I can read about them?
                • 7923
                • 4,213 Posts
                [*id*] is the document variable for the document id, for example 23.

                [~document_id_here~] is a tag in MODx to make a link to some document.

                [~[*id*]~] would then be same as [~23~] and that would print the url to that document with the alias information when parsed, eg. container/another/yourpage.html


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 27330
                  • 884 Posts
                  cool. now it make sense why I got the parse error.
                  thanks once more doze.