We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26482
    • 138 Posts
    Hi,

    I’ve setup MG using the following call:

    [tt][!MaxiGallery? &display=`embedded` &language=`nl` &keep_bigimg=`1` &embedtype=`slimbox` &pics_per_row=`2` &max_thumb_size=`200` &max_pic_size=`700` &thumb_use_dropshadow=`1`!][/tt]

    This works very nice, but I need to give my users the possibility to download the pictures. How can I achieve this?

    Thanks.
      • 7923
      • 4,213 Posts
      Do you want that they can download normal images (size set with &max_pic_size) or bigger / original images (size set with &max_big_size)?

      Slimbox gets the picture description text from the link "title" attribute, so do a custom template and put the download link there. But the page won’t validate after that because title attribute content cannot have html code.

      If you are ok with that, change this:
      <a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="lightbox[image[+maxigallery.pageinfo.id+]set]" title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+]">


      to:
      <a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="lightbox[image[+maxigallery.pageinfo.id+]set]" title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+] <br/><a href='[(base_url)][+maxigallery.path_to_gal+]big_[+maxigallery.picture.filename+]'>Download picture</a>">


      If you want the normal picture for download instead of the big/original, remove the "big_" prefix before the filename placeholder.


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

        Thanks for this. I need some help finding the template I need to change this in. As per my snippet call, I’m using the default template. Correct?
        If so, where would I find this template (I assume assets/snippets/maxigallery/templates, but which template?) and how can I call the modified template in the snippet call?

        Thanks again.

        Update: I’ve tried editing picturetpl.html in the slimbox section, so now the code looks like:

        [+maxigallery.config.display:is=`pictureview`:then=`
        	[+maxigallery.managebutton:isnot=``:then=`
        
        		<center>[+maxigallery.managebutton+]</center>
        		<br />
        	
        	`+]
        `+]
        
        <div class="picturecontainer">
        
        	<p class="navigation">
        		[+maxigallery.counter:is=`1`:or:is=`0`:then=`
        
        			[+maxigallery.strings.previous+] |
        
        		`:else=`
        
        			<a href="[+maxigallery.previous_pic_url+]">[+maxigallery.strings.previous+]</a> | 
        
        		`+]
        
        			<a href="[+maxigallery.index_url+]">[+maxigallery.strings.index+]</a> | 		
        
        		[+maxigallery.counter:is=`[+maxigallery.total_pics_count+]`:then=`
        
        			[+maxigallery.strings.next+]
        
        		`:else=`
        
        			<a href="[+maxigallery.next_pic_url+]">[+maxigallery.strings.next+]</a>
        
        		`+]
        	</p>
        
        	<p class="picturecount">[+maxigallery.strings.picture+] [+maxigallery.counter+] / [+maxigallery.total_pics_count+]</p>
        
        	[+maxigallery.total_pics_count:isnot=`0`:then=`
        	
        	<div class="picture">
        	
        	[+maxigallery.big_img_linkstyle:is=`slidebox`:then=` 
        
        		<a href="[(base_url)][+maxigallery.path_to_gal+]big_[+maxigallery.picture.filename+]" rel="lightbox" title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+]">
        
        	`+]
        
        	[+maxigallery.big_img_linkstyle:is=`lightboxv2`:then=` 
        
        		<a href="[(base_url)][+maxigallery.path_to_gal+]big_[+maxigallery.picture.filename+]" rel="lightbox" title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+]">
        
        	`+]
        
        	[+maxigallery.big_img_linkstyle:is=`slimbox`:then=` 
        
        <a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="lightbox[image[+maxigallery.pageinfo.id+]set]" title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+] <br/><a href='[(base_url)][+maxigallery.path_to_gal+]big_[+maxigallery.picture.filename+]'>Download picture</a>">
        
        	<!--	<a href="[(base_url)][+maxigallery.path_to_gal+]big_[+maxigallery.picture.filename+]" rel="lightbox" title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+]"> -->
        
        	`+]
        
        	[+maxigallery.big_img_linkstyle:is=`popup`:then=` 
        
        		<a href="javascript:void(0);" onClick="javascript:openWindow('[(base_url)][+maxigallery.path_to_gal+]big_[+maxigallery.picture.filename+]','[+maxigallery.picture.title:htmlent+]',[+maxigallery.picture_height_big+],[+maxigallery.picture_width_big+],'gallery');" title="[+maxigallery.strings.click_to_open_original+]">
        
        	`+]
        
        	[+maxigallery.big_img_linkstyle:is=`external`:then=` 
        
        		<a href="[(base_url)][+maxigallery.path_to_gal+]big_[+maxigallery.picture.filename+]" rel="external" title="[+maxigallery.strings.click_to_open_original+]">
        
        	`+]
        
        	[+maxigallery.keep_bigimg:is=`0`:then=`
        
        		<a href="[+maxigallery.index_url+]" title="[+maxigallery.strings.click_to_go_back+]">
        
        	`+]
        
        		<img src="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" class="imageview" alt="[+maxigallery.strings.date+] : [+maxigallery.picture.date+]" />
        
        		</a>
        		
        	</div>
        	
        	`+]
        	
        	[+maxigallery.picture.title:isnot=``:then=`
        		<p class="title">[+maxigallery.picture.title:htmlent+]</p>
        	`+]
        	[+maxigallery.picture.descr:isnot=``:then=`
        		<p class="description">[+maxigallery.picture.descr:htmlent+]</p>
        	`+]
        	
        </div>


        This doesn’t seem to be making a difference. I don’t see a Download link.

          • 7923
          • 4,213 Posts
          Please always wrap code in your posts between bbcode code tags. Helps with readability. (fixed your post above)

          From maxigallery wiki page you can see to what are the various templates used.

          You probably don’t want to change the original templates. Instead, do a new chuck with the content of the original one and modify it as needed.

          In this case, you want to look at galleryPictureTpl. Create new chuck with the original content and use it in your snippet call like &galleryPictureTpl=`chunknamehere`.

          In the original galleryPictureTpl the part that you want to modify is below this line:

          [+maxigallery.embedtype:is=`slimbox`:then=`
          


          and optionally you could remove all the other code from the default template, because you need just slimbox code there.


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 26482
            • 138 Posts
            Thank you doze. This works like a charm!
            grin