We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23299
    • 1,161 Posts
    I have a MaxiGallery system going with latest version of MG.

    I am making things more complicated by using three jQuery scripts on each page. I am using the new Fancybox script to display the images within the MaxiGallery system. I finally got it all working nicely.

    One thing though: when the full size images are displayed with Fancybox there is a Title text box at the bottom of the image. If there is no title created when uploading the image with MaxiGallery the Title box still displays the words "click to zoom" which I don’t want. If I add a real title while uploading the image with MaxiGallery the Title box will display the title AND the words "click to zoom." Again I do not want these words to appear.

    Also, If I add a caption during the MaxiGallery upload process the caption will not appear. The title will appear though.

    This is the template I am using to activate the Fancybox script:
    <li class="image_gallery">
        <a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" class="fancybox" rel="gallery">
            <img src="[(base_url)][+maxigallery.path_to_gal+]tn_[+maxigallery.picture.filename+]" class="thumbnail" title="[+maxigallery.picture.title:htmlent+]
            [+maxigallery.strings.click_to_zoom+]" alt="[+maxigallery.picture.title:htmlent+] [+maxigallery.strings.click_to_zoom+]" />
        </a>
        [+maxigallery.picture.title:isnot=``:then=`
            <p style="width: [+maxigallery.picture_width_thumb+]px;">
                [+maxigallery.picture.title:htmlent+]
            </p>
        `+]
    </li>


    Removing the last strings.click_to_zoom removes the unwanted "click to zoom" words but then displays a still unwanted empty text box below the image. Is there a way I can edit this template so that the Title box and caption box will display ONLY when there is a real Title and Caption entered with the image file?

    I hope explained this correctly?

    Thanks!
      • 7923
      • 4,213 Posts
      Try using a template like this:

      <li class="image_gallery">
          <a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" class="fancybox" rel="gallery" [+maxigallery.picture.title:isnot=``:then=`title="[+maxigallery.picture.title:htmlent+]"`+]>
              <img src="[(base_url)][+maxigallery.path_to_gal+]tn_[+maxigallery.picture.filename+]" class="thumbnail" />
          </a>
          [+maxigallery.picture.title:isnot=``:then=`
              <p style="width: [+maxigallery.picture_width_thumb+]px;">
                  [+maxigallery.picture.title:htmlent+]
              </p>
          `+]
      </li>
      


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 23299
        • 1,161 Posts
        Thanks Doze,

        That kills the "click to zoom" words on the full size image. If I add a title with MaxiGallery then that shows up nicely without the "click to zoom" words in the full size image.

        The one thing that does not happen is that the words in the Description box do not show?

        I will take a look at the Wiki, but it might be a limitation with Fancybox...
          • 7923
          • 4,213 Posts
          FancyBox takes the picture caption text from the link title attribute.

          If you look at the template above, I only put the picture title there, eg:

          [+maxigallery.picture.title:isnot=``:then=`title="[+maxigallery.picture.title:htmlent+]"`+]


          If you would like to have the picture description there too, use:

          [+maxigallery.picture.title:isnot=``:then=`title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+]"`+]


          Also note the pxh syntax.. The title and description is output only if picture title is not empty. So if you have pictures that only has descrtiption text, they don’t show up. If you want that to work, adjust the phx syntax.


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 7527
            • 437 Posts
            Hi,

            Sorry to reopen an old thread. I have tried this method, and it's great. The only problem is that the thumbnails open in a blank document. I want them to open normally like a slimbox. I just wanted to drop the 'click to zoom' and automatically assign the title to the file name. Please help
              www.PawsForWildlife.co.uk
              www.Borntobrick.co.uk
              • 7527
              • 437 Posts
              I almost have it (I think). I changed the template to:

              <li class="image_gallery">    
              <a href="[(base_url)][+maxigallery.picture.filename+]"class="lightbox"  rel="lightbox[maxigallery]"  [+maxigallery.picture.title:isnot=``:then=`title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+]"`+]>        
              <img src="[(base_url)][+maxigallery.path_to_gal+]tn_[+maxigallery.picture.filename+]" class="thumbnail" />    
              </a>    
              [+maxigallery.picture.title:isnot=``:then=`        
              <p style="width: [+maxigallery.picture_width_thumb+]110px; height: [+maxigallery.picture_height_thumb+]110px;">            
              [+maxigallery.picture.title:htmlent+] 
              </p>    
              `+]
              </li>


              But if I change my embed type in the Snippet call to lightbox, it all fails. If I leave it as slimbox the pic opens and just continually shows a loading screen

              I know I am missing something, any help appreciated
                www.PawsForWildlife.co.uk
                www.Borntobrick.co.uk
                • 16278
                • 928 Posts
                Have you considered using a different snippet? I use MaxiGallery on a couple of sites I built years ago, but looking at them to try to help you out just reminded me what an absolute pain it was to adjust the templates. Particularly the way that the start of an output element will be in one file, and the end in another, like some nightmare WordPress theme. I don't think MG has been actively supported for some time now, and it may be suffering terminal bit rot.

                I haven't tried the alternatives - I have something of my own that suits my purpose, but that's not a lightbox approach. I see that Easy2Gallery is still under active development. It looks a lot easier to customize, it was created by the very capable Temus and it's supported by the very capable Goldsky, all of which is to say: why not give it a try?

                :) KP
                  • 7527
                  • 437 Posts
                  Thanks Kp52 I will give it a try. I have built my sit myself, but still struggle sometimes!
                    www.PawsForWildlife.co.uk
                    www.Borntobrick.co.uk