Sun 13 Dec |
|
The ImageSlideShow module from briask.com is an excellent and simple image gallery which shows any images from a designated folder and have one link from the images. Clients (and I see on Briask's own forum) have asked whether it would be possible to have individual links to individual images. I've come up with a couple of ways. Both ways are pretty primitive and involve naming the image file in a certain way that is then detected and provides the correct link. I'm sure it could be done more nicely but it works flawlessly. The first way is if you want to link to different content pages within your own site or at least if the links are all similar except for a different id number each time. First find the Joomla link structure that you want to link to. The url will be like index.php?option=com_content&view=article&id=60&Itemid=32 so note each different id number you want to link to. Then rename your images corresponding to the id number like so -
The url in the backend ImageSlideShow module parameters will be index.php?option=com_content&Itemid=32&id= Open up the file modules/mod_briaskISS/mod_briaskUtility.php in your editor and go to line 325 --> echo '<li><a href="'.$picURL.'"><img src="'.$picDir.'/'.$file.'" alt="'.$picTitle.'" /></a></li>';Comment this out and add the following -> $number = preg_replace("/[^0-9]/", '', $file); // ditch anything that is not a number echo '<li><a href="'.$picURL.$number.'&view=article"><img src="'.$picDir.'/'.$file.'" alt="'.$picTitle.'" /></a></li>'; This simply finds the number in the image file name and adds it to the url. Now the individual images will link to the desired pages. The second way is even more clonky but this way you can link to any url that you like. I will describe it in the next post. |
Last Updated on Monday, 14 December 2009 09:05 |