We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31902
    • 342 Posts
    I'm implementing the Gallery component on a site that I'm currently building. I'm following Shaun's tutorial on this page:

    http://rtfm.modx.com/display/ADDON/Gallery.Setting+Up+Your+Gallery

    What I did first was to implement and test this tutorial on another site...one I have set up just to test new things in MODx...and got it running okay. I was able to upload images from within the Components>Gallery page, etc.

    I then took all the code I got created on this test site and transferred it to the site I'm building exactly. No changes. Same server. Same version of MODx (2.1.3). Everything the same.

    On the new site, I used the Gallery component to upload a batch of images (from Components>Gallery), just like I did on the test site. They seemed to upload okay. I don't think the images are too huge (between 30k and 70k).

    Not sure if I was supposed to do this, but I made sure the assets > components > gallery > files directory, as well as the image directory under that, were readable/writable.

    The problem is that on the front end, there are no images appearing. I do see the the different image names arranged in the grid and when I click on a name (where the thumbnail would go), the top large image changes accordingly. The script seems to be running okay...just the images are not appearing.

    After troubleshooting this thing for a whole lot more time than I should be, the only thing I can think of that is different between this new site and my test site is that the new site, at this point, does not have the domain name pointing to it. I'm viewing it from the IP address.

    I would not think this has anything to do with my problem but at this point it's the only thing I can think of that is different between the two sites.

    Please take a look at the screen shot to see what I'm seeing on the front end.

    Thank you in advance.

    MODx 2.1.3
    PHP Version 5.2.10 [ed. note: waizen last edited this post 14 years, 9 months ago.]
      • 3109 ☆ A M B ☆
      • 894 Posts
      If you inspect the element what does it say?
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 31902
        • 342 Posts
        Hi, benmarte... I appreciate you chiming in with this problem of mine, too.

        I feel stupid asking this, but what do you mean by element? The page is located here:

        http://67.222.24.164/~hawkresort/index.php?id=21
          • 10208 ☆ A M B ☆
          • 1,780 Posts
          The element is found in the source output from your page. Use Firebug or similar to inspect specific elements.

          I got an example from your page's source of one of the gallery elements.

          Sorry, can't help further (due to the fact that I'm not proficient in any way with Gallery yet. I just started looking into it yesterday), but this is what you'll need to check to see if it's fetching properly. Is the image path correct?

          </div><div class="gal-item">
              <a href="index.php?id=21&galItem=115&galAlbum=2&galTag=">
          
                  <img class="" src="/~hawkresort/assets/components/gallery/connector.php?action=web/phpthumb&w=100&h=100&zc=1&far=C&q=90&src=%2F%7Ehawkresort%2Fassets%2Fcomponents%2Fgallery%2Ffiles%2F2%2F115.jpg" alt="wedGal14.jpg" />
              </a>
            Frogabog- MODX Websites in Portland Oregon
            "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
            Having server issues? These guys have MODX Hosting perfected - SkyToaster
            • 31902
            • 342 Posts
            @Frogabog

            Thank you for responding.

            Yeah, I had looked at that and compared it with my test site, which worked okay. For instance, on the site I'm building, a sample looks like this:

            <div class="gal-item">
                <a href="index.php?id=21&galItem=107&galAlbum=2&galTag=">
            
                    <img class="" src="/~hawkresort/assets/components/gallery/connector.php?action=web/phpthumb&w=100&h=100&zc=1&far=C&q=90&src=%2F%7Ehawkresort%2Fassets%2Fcomponents%2Fgallery%2Ffiles%2F2%2F107.jpg" alt="wedGal6.jpg" />
                </a>
            </div>


            ... and from my test site, where the gallery is working, a sample looks like this:

            <div class="gal-item">
                <a href="gallery.html?galItem=100&galAlbum=4&galTag=" >
            
                    <img class="" src="/assets/components/gallery/connector.php?action=web/phpthumb&w=100&h=100&zc=1&far=C&q=90&src=%2Fassets%2Fcomponents%2Fgallery%2Ffiles%2F4%2F100.jpg" alt="5-Decor-Entry-Canopy_L.jpg" />
                </a>
            </div>


            Seems to be about the same except the first part of the src...the part before /assets/
              • 10208 ☆ A M B ☆
              • 1,780 Posts
              I can't figure out where the path for the thumbnails is set with Gallery, sorry. I never did get a chance to try to implement it.

              If you figure it out however, set it to use
              [[++site_url]]
              to preface the path (assets/components/...) which will be better able to follow any root path when you move it to the live site. You can use that anywhere you need to reference the root path, except in the css files. Make sure to not include the leading / before assets/components.

              paths coded this way should look something like this:

              src="[[++site_url]]assets/templates/your_folder_path/image_file.jpg"
                Frogabog- MODX Websites in Portland Oregon
                "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                Having server issues? These guys have MODX Hosting perfected - SkyToaster
                • 31902
                • 342 Posts
                @Frogabog

                Thanks for responding. Sounds plausible. I'll start a search for where to implement it and post my findings.
                  • 31902
                  • 342 Posts
                  The closest I found was in core > components > gallery > model > schema > build.schema.php. There, under setup paths, I found this:

                  $sources = array(
                      'root' => $root,
                      'build' => $root.'_build/',
                      'core' => $root.'core/components/gallery/',
                      'model' => $root.'core/components/gallery/model/',
                      'assets' => $root.'assets/components/gallery/',
                  );


                  I changed it to:

                  $sources = array(
                      'root' => $root,
                      'build' => $root.'_build/',
                      'core' => $root.'[[++site_url]]core/components/gallery/',
                      'model' => $root.'[[++site_url]]core/components/gallery/model/',
                      'assets' => $root.'[[++site_url]]assets/components/gallery/',
                  );


                  ...but it had no effect. I had first tried it with just the assets one and after that had no effect, I then added it to the others.

                  Did I add it correctly to begin with?
                    • 3109 ☆ A M B ☆
                    • 894 Posts
                    @waizen don't edit your build.schema.php file you can do that in your gallery chunk tpl which I would suggest you post both your gallery call and you tpl chunk to see what may be going on.
                      Benjamin Marte
                      Interactive Media Developer
                      Follow Me on Twitter | Visit my site | Learn MODX
                      • 31902
                      • 342 Posts
                      @benmarte Followed as per Shaun's tutorial. My version of it is in a chunk called wedding_gallery and contains this:

                      [[!GalleryItem]]
                      <div align="center">[[!+galitem.image:notempty=`
                      <div class="image">
                        <a href="[[+galitem.image]]"><img class="[[+galitem.imgCls]]" src="[[+galitem.image]]" alt="[[+galitem.name]]" /></a>
                      </div>
                      `]]</div>
                       
                      
                      
                      
                       
                      [[!Gallery? &album=`2` &toPlaceholder=`gallery`]]
                       
                      [[+gallery]]


                      I made sure the &album is set to the correct album. This exact code was tested on another site on the same server and worked great.

                      By gallery chunk tpl, do you mean one of the chunks that came with Gallery? [ed. note: waizen last edited this post 14 years, 9 months ago.]