|
#1
|
||||
|
||||
|
There are currently 2 different ways that I know of to change the way the photos appear. Credit goes to spaceboy for example one, and for example two the credit goes to suzkaw. Just plug the code into your viewlisting.tpl template. Remember to have a backup on hand if you find out that you don't either of them.
Example 1: Code:
{* This the image display portion *}
<script type="text/javascript" language="javascript">
{literal}
function showPic (whichpic) {
if (document.getElementById) {
document.getElementById('placeholder').src = whichpic.href;
return false;
} else {
return true;
}
}
{/literal}
</script>
{if $viewphotos=="Y"}
{if $data<>""}
<table width="375" height="350" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="350" height="300" align="center">
{section name=image loop=$data max=1}
<table border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#FFFBE7" bgcolor="#333333" style="border-collapse: collapse">
<tr>
<td>
<p align="center">
<img id="placeholder" src="photos/{$data[image].image}" alt="" class="imageborder" style="border-left:2px solid #999999; border-right:2px solid #999999; border-top:2px solid #999999; border-bottom:2px solid #999999; " width="350" />{/section}</p> </td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top" height="60" align="center">
<table border="0" cellpadding="10" cellspacing="0" bgcolor="#E3E4E6">
<tr>
<td height="10">
{foreach from=$data item="entry"}
<a onClick="return showPic(this)" href="photos/{$entry.image}">
<img src="thumbs/small_{$entry.image}" hspace="0" vspace="0" border="0" class="imageborder" width="60" height="45" alt="" align="center" style="border: 2px solid #666666; "/></a>
{/foreach} </td>
</tr>
</table>
</div></td>
</tr>
</table>
{/if}
{/if}
{* This ends the image display portion *}
Code:
{* This the image display portion *}
{if $viewphotos=="Y"}
{if $data<>""}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="80%">
{section name=image loop=$data max=1}
<p align="center"><img id="placeholder" src="photos/{$data[image].image}" alt="" class="imageborder" /></p>
<strong><p align="center" id="desc">{$data[image].title}</p></strong>
{/section}</td>
<td>
<DIV STYLE="height:320px; width:180px;overflow:auto">
<div align="center">
{foreach from=$data item="entry"} <a onclick="return showPic(this)" href="photos/{$entry.image}" title="{$entry.title}"><img src="thumbs/small_{$entry.image}" hspace="5" vspace="5" border="0" class="imageborder" /></a>
{/foreach}
</div>
</div>
</td>
</tr>
</table>
{/if}
{/if}
{* This ends the image display portion *}
__________________
Version 4.0.1 Developer Last edited by cwp; 02-28-2008 at 02:33 AM. |
|
#2
|
|||
|
|||
|
Excellent mod... thank you cwp! I am using the first one in the viewlisting2.tpl template (so the photos are on top). Also looks good with the photos on the right (in viewlisting.tpl).
Is there any way to add to the code so that if the user only has one photo the thumbnail does not appear? This would be an awesome addition. |
|
#3
|
||||
|
||||
|
Quote:
![]()
__________________
Version 4.0.1 Developer |
|
#4
|
|||
|
|||
|
Quote:
If anyone could point me in the right direction of how to do an {if} statement on those thumbnails, that would be great!
__________________
v4.0.1 Developer |
|
#5
|
|||
|
|||
|
Still working on trying to get the thumbnail to only appear when there are 2 or more photos. Any suggestions? I am also wondering how to show the title of the images and have them change when clicking a thumbnail.
In version 2 of the image changes that were posted, the title appears under the first photo, but it does not change when clicking different thumbs. How do I change the title with the photo? There is an error in the version 2 code that was posted... it does not work unless you add the javascript (the code between and including the <script> tags) from the first example. Any help is always appreciated!
__________________
v4.0.1 Developer Last edited by crystal; 05-01-2008 at 12:25 AM. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Display full size photo of first photo on viewlisting.tpl | cwp | v4 Questions & Support | 2 | 02-23-2008 09:49 PM |
| Changing the name of a field and changing page backgound | Sandy68Classi | v3.1 Modifications | 7 | 10-16-2007 01:31 AM |
| Changing look of categories on home page | Baz | HTML, CSS, and Design Help | 2 | 11-09-2006 01:29 PM |
| Modification so the Add creation page | Unregistered | Pre Sales | 4 | 10-12-2006 11:05 AM |
| Changing Yahoo Maps layout | GSP | v3.1 Modifications | 1 | 10-01-2006 08:57 AM |