We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3689
    • 264 Posts
    I’m trying to add the first picture from my maxigallery at site.com/events/events01 to site.com/events/ which is working fine, but I have "?pic=22&from_id=4" added to the link which opens page with the pictures at full size saying "previous | index | next"

    my maxigallery call:
    [[MaxiGallery? &gal_query_ids=`[+id+]`&limit=`1` &galleryOuterTpl=`galOutter` &galleryPictureTpl=`galPic`]]


    how do I fix this so the image link is site.com/events/events01 instead of site.com/events/events01?pic=22&from_id=4?
      • 7923
      • 4,213 Posts
      In your custom galleryPictureTpl, make the link href from the thumbnail be [~[+maxigallery.picture.gal_id+]~]


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 3689
        • 264 Posts
        Quote from: doze at Sep 21, 2009, 04:25 AM

        In your custom galleryPictureTpl, make the link href from the thumbnail be [~[+maxigallery.picture.gal_id+]~]

        its taking me to the error page.. heres my chunk (changed it back to what i had when creating thread)

        [+maxigallery.embedtype:is=`smoothgallery`:then=` 
        	<div class="imageElement">
        	<h3>[+maxigallery.picture.title:htmlent+]</h3>
        	<p>[+maxigallery.picture.descr:htmlent+]</p>
        	<a href="[+maxigallery.picture_link_url+]" title="[+maxigallery.strings.click_to_zoom+]" class="open"></a>
        	<img src="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" class="full" />
        	<img src="[(base_url)][+maxigallery.path_to_gal+]tn_[+maxigallery.picture.filename+]" class="thumbnail" />
        	</div>
        `+]
        
        [+maxigallery.embedtype:isnot=`smoothgallery`:then=`
         
        [+maxigallery.embedtype:is=`slidebox`:then=` 
        
        	<a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="lightbox_[+maxigallery.path_to_gal+]gallery">
        
        `+]
        
        [+maxigallery.embedtype:is=`lightboxv2`:then=` 
        
        	<a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="lightbox[maxigallery]" title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+]">
        
        `+]
        
        [+maxigallery.embedtype:is=`slimbox`:then=` 
        
        	<a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="lightbox[maxigallery]" title="[+maxigallery.picture.title:htmlent+] - [+maxigallery.picture.descr:htmlent+]">
        
        `+]
        
        [+maxigallery.embedtype:is=`popup`:then=` 
        
        	<a href="javascript:void(0);" onClick="javascript:openWindow('[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]','[+maxigallery.picture.title:htmlent+]',[+maxigallery.picture_height_normal+],[+maxigallery.picture_width_normal+],'gallery');">
        
        `+]
        
        [+maxigallery.embedtype:is=`external`:then=` 
        
        	<a href="[(base_url)][+maxigallery.path_to_gal+][+maxigallery.picture.filename+]" rel="external">
        
        `+]
        
        [+maxigallery.embedtype:is=``:then=`
        	
        	<a href="[+maxigallery.picture_link_url+]">
        
        `+]
        	
        	 	<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>
        	`+]
        `+]


        Im not even too sure if i created the template the correct way.. I just wanted to remove the <li> tags so i copied the whole thing and removed the tags.. but how do i get this to work so it just goes to the page?
          • 7923
          • 4,213 Posts
          You don’t need to have all the PHx conditionals in the template as you already know what the output should be. They are in the default templates just so that the various display type parameters work. Try something like this:

          	<a href="[~[+maxigallery.picture.gal_id+]~]">
          	 	<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>
          	`+]
          


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 3689
            • 264 Posts
            Quote from: doze at Sep 21, 2009, 06:11 AM

            You don’t need to have all the PHx conditionals in the template as you already know what the output should be. They are in the default templates just so that the various display type parameters work. Try something like this:

            	<a href="[~[+maxigallery.picture.gal_id+]~]">
            	 	<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>
            	`+]
            

            this adds an extra "events" so instead of site.com/events/event01 its site.com/events/events/event01 so its takin me to the error page
              • 7923
              • 4,213 Posts
              do you have <base href="[(site_url)]"></base> in your template <head>? try adding that if you don’t have it.


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                • 3689
                • 264 Posts
                Quote from: doze at Sep 21, 2009, 08:24 AM

                do you have <base href="[(site_url)]"></base> in your template <head>? try adding that if you don’t have it.
                it worked smiley thanks!