We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1416
    • 75 Posts
    Is this possible?

    I know that the normal image is linked to the bigger image, but my site design requires this setup:

    Page with thumbnails.
    Each thumbnail linked to normal size image in imageset to be able to preview with lightbox
    Adds a link beneath each thumbnail so anyone can download the bigger image easily.

    Great snippet doze.
    Love the simplicity of it. smiley

    Cheers
      • 7923
      • 4,213 Posts
      yes its possible, simply create a custom galleryPictureTpl based on the default template (see wiki for more info). At the bottom of the template you see where it adds the picture title under the thumbnail, add your link there. Its the same as the link to the normal image in that template, but prefix the filename witi "big_".


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

        I tried with different settings, but, no luck.
        <a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="external">

        Thats the code I copied, and if I dont append big_ just before picture I can download the linked image.

        But when I append big_ all it points to is my gallery directory.

        I use &keep_bigimg=`1` and the files are saved on the server with big_ appended to them so they exists.

        Any suggestions?

        Cheers
        Amrit
          • 7923
          • 4,213 Posts
          So you did try it like this ?
          <a href="[(base_url)][+maxigallery.path_to_gal+]big_[+maxigallery.picture.filename+]" rel="external">


          Also if you use that rel="external", you should be including the following js to your page (It goes through all the links that have "rel" attribute set to "external" and changes their "target" attribute to "blank". That is done in JS because if you use target=blank in html, it can be that it won’t validate. That depends on the document type that you are using):
          function externalLinks() {
          	if (!document.getElementsByTagName) return;
          	var anchors = document.getElementsByTagName("a");
          	for (var i=0; i<anchors.length; i++) {
          		var anchor = anchors[i];
          		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external"){
          			anchor.target = "_blank";
          		}
          	}
          }
          window.onload = externalLinks;
          


          Or depending on your document type, you can use this and forget about js (or if you don’t care if it validates or not):
          <a href="[(base_url)][+maxigallery.path_to_gal+]big_[+maxigallery.picture.filename+]" target="_blank">


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 1416
            • 75 Posts
            Aaaah.

            Works great now. I put the _big just before picture, inside the [], not before it.
            That was the problem.

            Thanks man.

            Keep up the good work. smiley

            Cheers