Scroll To Top

Enter a query to search our site. Note that you can use "*" and "?" as wildcards. Enclosing more than one word in double quotes ("CSS Layout") will search for the exact phrase.

PVII Knowledge Base

1. Select a product ...
2. Select category ...
3. Search the Knowledge Base...

Question #231

In Image Gallery Magic (IGM) I'm using a link in the additional description area to load a new page. Is there a way to also assign this link to the actual full-size image?

The Answer

Prepared Feb. 2008 by Gerry Jacobsen, PVII

In Image Gallery Magic (IGM) I'm using a link in the additional description area to load a new page. Is there a way to also assign this link to the actual full-size image?

The Image Gallery Magic (iGM) system does not allow for links on the full-size image, but you can place links in the "Additional Description" box. Just enter the actual html markup for the link, like:

<a href="MyPage.htm">My Test Link</a>

directly into the additional description box in the user interface. This will display the active link directly below the image, and since this is a normal link, it allows you to provide text for the link so that the user will know to click it.

Once you have added the link in the "Additional Description" area you can apply this code tweak to have the system automatically apply this link to the full-size image, making the entire image clickable.

Here's how:

1. Open the p7gsscripts.js file and Copy & Paste this function to the end of the file:

function P7_HGSaddLink(){ //v1.1
 var i,tD,tA,iM,tt,tm,hm,nh;
 fS=document.getElementById('p7GSfs');
 tD=fS.getElementsByTagName("TD");
 iM=fS.getElementsByTagName("IMG");
 pM=iM[0].parentNode;
 if(tD&&tD.length>0){
   for(i=0;i<tD.length;i++){
     if(tD[i].className&&tD[i].className=='p7GSfsd'){
       tA=tD[i].getElementsByTagName("A");
       break;
     }
   }
   if(tA&&tA.length>0){
     tt=tA[0].getAttribute("target");
     tm=(tt)?' target="'+tt+'"':'';
     hm='<a href="'+tA[0].href+'"'+tm+'>';
     nh=hm+pM.innerHTML+'</a>';
     pM.innerHTML=nh;
   }
 } 
}

2. Locate the last lines of the P7_GSfin(im,ug) function, around line 463:

   }else{document.getElementById('p7GSfs').getElementsByTagName('IMG')[0].style.visibility='visible';}
 }

3. Add this code line into a new line just before the last }:

P7_HGSaddLink();

so that it now looks like this:

   }else{document.getElementById('p7GSfs').getElementsByTagName('IMG')[0].style.visibility='visible';}
   P7_HGSaddLink();
 }

4. Save the file.

That's it. The system will now look for the first link in the "Additional Description" area and if it finds one will apply the same link to the full-size image.

Back to the questions list