We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4429
    • 429 Posts
    I am using maxigallery with a timed, embedded smooth gallery.

    I have a gallery/slideshow on the home page of my development site. I want this gallery to be able to go into the all the child galleries on the site and pick out random images and display them on the home page.

    My current call is

    [!MaxiGallery?  &childgalleries_ids=`all` &display=`childgalleries` &order_by=`random` &childgalleries_order_by=`createdon`  &display=`embedded` &embedtype=`smoothgallery` &smoothgallery_timed=`true` &smoothgallery_width=`640` &max_pic_size=`640` &smoothgallery_height=`585` &smoothgallery_preloader =`true` &quality_pic =`100`  &disable_rightclick=`1` !] 


    However this does not work.

    Is it even possible to do this? Everything i’ve seen involving child galleried just creates a list of thumbnails. I actually want the (random) contents displayed in an embedded smoothgallery.
      • 7923
      • 4,213 Posts
      Retrieve 5 random pictures from all the galleries and show in smoothgallery:

      [!MaxiGallery? &gal_query_ids=`all` &order_by=`random` &limit=`5` &display=`embedded` &embedtype=`smoothgallery`!]

      See the query examples in wiki.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 4429
        • 429 Posts
        Thanks - I did have look through the wiki. I just got a tiny bit confused and looked under child galleries instead.
          • 4429
          • 429 Posts
          @Doze

          Hi yet another maxigallery question relating to child galleries.

          On my home page I have the code that you provided above which is working great.

          Throughout my site i want a call in the sidebar area of my template. This call will show 4 or 6 thumbnails that when clicked on will jump to that galleries page. Additionally these thumbnails need to be generated randomly i.e the actual thumbnail image and the the gallery (assuming there are more than 4 galleries).

          Is this possible? - What i tired was just a basic call to show child galleries, obviously that conflicts the gallery in the content area and also doens’t link through to the actual galleries themselves but tires to display them in the sidebar shocked
            • 7923
            • 4,213 Posts
            Use that same call, but instead of smoothgallery embed type, use normal display type with a custom galleryPictureTpl what links to the gallery document instead of the picture itself, eg:

            [!MaxiGallery? &gal_query_ids=`all` &order_by=`random` &limit=`5` &galleryPictureTpl=`mg_gallerypicturetpl`!]

            And in gallerypicturetpl chunk:
            <li>
            <a href="[~[+maxigallery.picture.gal_id+]~]" title="Go to the gallery">
               <img src="[(base_url)][+maxigallery.path_to_gal+]tn_[+maxigallery.picture.filename+]" class="thumbnail" title="Go to the gallery" alt="[+maxigallery.picture.title:htmlent+]" />
            </a>
            [+maxigallery.picture.title:isnot=``:then=`
               <p style="width: [+maxigallery.picture_width_thumb+]px;">
                  [+maxigallery.picture.title:htmlent+]
               </p>
            `+]
            </li>
            


            Although that call retrieves random pictures from every gallery, so there can be 2 or more pictures from same gallery.


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 4429
              • 429 Posts
              Hmm.

              Two issues.

              Firstly using the call and chunk above, I’m not getting anything at all showing in the sidebar i.e where i put the maxigallery call. The chunk was saved as per above.

              Secondly when uploading an image to a gallery i keep recieving the following error


              « MODx Parse Error »
              MODx encountered the following error while attempting to parse the requested resource:
              « PHP Parse Error »
               
              PHP error debug
                Error: 	chmod() [function.chmod]: No such file or directory	 
                Error type/ Nr.: 	Warning - 2	 
                File: 	/var/www/fruitfulthoughts/assets/snippets/maxigallery/maxigallery.php	 
                Line: 	372	 
                Line 372 source: 	chmod($path_to_gal.$name,0666); 	 
               
              Parser timing
                MySQL: 	0.0015 s	(7 Requests)
                PHP: 	0.1665 s	 
                Total: 	0.1680 s


              Now if I then revisit the page I can see that the image has uploaded.
                • 7923
                • 4,213 Posts
                did you create the chunk with the name "mg_gallerypicturetpl" as in the snippet call?

                If you have more than one MaxiGallery snippet calls on a single document, you need to use the &manage_target and &is_target snippet paramaters to make the picture management on a separate document. See more info about those parameters in the wiki.

                Basically just create a new document with a maxigallery snippet call that has the correct picture size parameters and has &is_target in the snippet call. Then in all of your normal gallery calls, add &manage_target snippet parameter and use the id of the document that you created as the value.


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 4429
                  • 429 Posts
                  Hmm.

                  I have the following calls.

                  The one below is in the content area of my home page.
                  [!MaxiGallery? &gal_query_ids=`all` &order_by=`random` &limit=`5` &display=`embedded` &embedtype=`smoothgallery` &smoothgallery_timed=`true` &smoothgallery_width=`640` &max_pic_size=`640` &smoothgallery_height=`480` &smoothgallery_preloader =`true` &quality_pic =`100` &big_use_dropshadow=`1` &disable_rightclick=`1`!]


                  This one is in the side bar area so appears on all pages, including the home page
                  [!MaxiGallery? &gal_query_ids=`all` &order_by=`random` &limit=`5` &galleryPictureTpl=`mg_gallerypicturetpl`!]


                  related to that call above is a chunk: gallerypicturetpl
                  <li>
                  <a href="[~[+maxigallery.picture.gal_id+]~]" title="Go to the gallery">
                     <img src="[(base_url)][+maxigallery.path_to_gal+]tn_[+maxigallery.picture.filename+]" class="thumbnail" title="Go to the gallery" alt="[+maxigallery.picture.title:htmlent+]" />
                  </a>
                  [+maxigallery.picture.title:isnot=``:then=`
                     <p style="width: [+maxigallery.picture_width_thumb+]px;">
                        [+maxigallery.picture.title:htmlent+]
                     </p>
                  `+]
                  </li>


                  That’s it.

                  What needs to go inside this mg_gallerypicturetpl chunk?

                  I don’t really understand any more than that.
                    • 7923
                    • 4,213 Posts
                    In your snippet call, you are using &galleryPictureTpl=`mg_gallerypicturetpl`

                    But the chunk you created is named gallerypicturetpl.. You need to name it mg_gallerypicturetpl as used in your snippet call.


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 4429
                      • 429 Posts
                      Quote from: doze at Oct 21, 2008, 05:34 AM

                      In your snippet call, you are using &galleryPictureTpl=`mg_gallerypicturetpl`

                      But the chunk you created is named gallerypicturetpl.. You need to name it mg_gallerypicturetpl as used in your snippet call.

                      Thanks, but i’m still getting the same phase error when uploading pictures.

                      Also when i click on manage pictures I get the picture manager displayed in both the main content area and the side bar. I need it displayed only in the main content area.


                      « MODx Parse Error »
                      MODx encountered the following error while attempting to parse the requested resource:
                      « PHP Parse Error »
                       
                      PHP error debug
                        Error: 	chmod() [function.chmod]: No such file or directory	 
                        Error type/ Nr.: 	Warning - 2	 
                        File: 	/var/www/fruitfulthoughts/assets/snippets/maxigallery/maxigallery.php	 
                        Line: 	372	 
                        Line 372 source: 	chmod($path_to_gal.$name,0666); 	 
                       
                      Parser timing
                        MySQL: 	0.0501 s	(7 Requests)
                        PHP: 	0.1648 s	 
                        Total: 	0.2149 s