We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25497
    • 22 Posts
    I’ve created a image template variable "Photo1" to contain photos.

    please see:

    http://66.216.120.27/test-photo-page.htm
    (the tv is in the middle column - the picture)

    how can I create a link from the photo to a larger image of the photo - in a pop up window or something similar?

    thanks
      • 15914
      • 145 Posts
      Try taking a look at my thread here: http://modxcms.com/forums/index.php/topic,3163.0.html

      There are quite a few good scripts you can use. Search for "lightbox".
        Kunal Kapoor
        Technical Director
        Limesharp Internet Limited - Effective, Functional, Standards Compliant

        IRC Nick: KingKoopa
        Skype ID: KingKoopa16
        • 25497
        • 22 Posts
        cool thanks - I’ll check it out
          • 25497
          • 22 Posts
          I’ve followed the directions and have a page with the tv and snippet here:

          http://66.216.120.27/lightboxtest.htm

          when I edit the page the lightbox template variable shows up in the manager but the image does not show up on the page.

          also, not sure how to add a link to a larger pic..

          thanks for your help.

          I’ve read the threads concerning this, and am just a little confused. I will need to add a few photos (the numberwill vary) on a page and wondering what the best implementation for this would be
            • 15914
            • 145 Posts
            That script will automatically make a thumbnail of the your large image. Make sure you select the larger image in the TV on that template. When you have created the corresponding snippet as well, instead of call the TV into your document, like this [*lightboxImage*], you put the snippet call with the same name as the TV instead: [[lightboxImage]]
              Kunal Kapoor
              Technical Director
              Limesharp Internet Limited - Effective, Functional, Standards Compliant

              IRC Nick: KingKoopa
              Skype ID: KingKoopa16
              • 2762
              • 1,198 Posts
              Great snippet Kunal! can anyone add it in the Resource repository?
                Free MODx Graphic resources and Templates www.tattoocms.it
                -----------------------------------------------------

                MODx IT  www.modx.it
                -----------------------------------------------------

                bubuna.com - Web & Multimedia Design
                • 25497
                • 22 Posts
                Thanks so much for your help. Still no luck on getting it to work though. I’m probably doing something stupid, I’m a newbie here. The test page is located here: http://66.216.120.27/test-photo-page.htm

                Here’s the template code I have for my picture "column":
                <div id="piccolumn">
                [[lightboxImage]]
                [*#Photo1*]
                </div> <!-- end of piccolumn div -->


                Photo 1 TV is showing up (I left this TV here just as a test) , but the lightbox snippet won’t display the image from the lightboximage tv (which will display if I use the lightboximage tv directly on the template)

                Here’s the snippet I’m using:
                if (!$tv_image) {$tv_image = "lightboxImage";}
                if (!$width) {$width = "350";}
                if (!$height) {$height = "350";}

                $phpThumb = "/assets/snippets/phpThumb/phpThumb.php";
                $js = "/assets/js/lightbox/lightbox.js";
                $css = "/assets/js/lightbox/lightbox.css";
                $tv = $modx->getTemplateVar($tv_image);

                if ($tv[’value’]) {
                $modx->regClientStartupScript($js);
                $modx->regClientCSS($css);
                $output = ’<a href="’.$tv[’value’].’" rel="lightbox" title="’;
                $output .= $modx->documentObject[’longtitle’].’">’;
                $output .= ’<img src="’.$phpThumb.’?src=’.$tv[’value’];
                $output .= ’&amp;w=’.$width.’&amp;h=’.$height.’"’;
                $output .= ’ alt="’.$modx->documentObject[’longtitle’].’" /></a>’;
                return $output;
                }

                The template variable: is [*lightboxImage]

                so I think everything is default
                  • 15914
                  • 145 Posts
                  Have you applied the patch from this post?:

                  http://modxcms.com/forums/index.php/topic,1942.msg20513.html#msg20513

                  Lightbox needs to use [tt]$modx->regClientStartupScript($js);[/tt] and [tt]$modx->regClientCSS($css);[/tt]. These functions only work with the patched file in the above post.
                    Kunal Kapoor
                    Technical Director
                    Limesharp Internet Limited - Effective, Functional, Standards Compliant

                    IRC Nick: KingKoopa
                    Skype ID: KingKoopa16
                    • 25497
                    • 22 Posts
                    Yes, but I think I’ll backtrack and double check everything I’ve done - could have missed a step.
                    Really appreciate your help. The function looks very cool.

                    website is now at alistairpaterson.com/index.php.
                      • 15914
                      • 145 Posts
                      Let me know if there’s anything else I can do. Would a temporary login to my MODx help?
                        Kunal Kapoor
                        Technical Director
                        Limesharp Internet Limited - Effective, Functional, Standards Compliant

                        IRC Nick: KingKoopa
                        Skype ID: KingKoopa16