|
|||||||
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jun 2007
Posts: 297
Rep Power: 16 ![]() |
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.3 Developer Last edited by cwp; 02-28-2008 at 02:33 AM. |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Jun 2007
Posts: 110
Rep Power: 11 ![]() |
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 | |
|
Senior Member
Join Date: Jun 2007
Posts: 297
Rep Power: 16 ![]() |
Quote:
__________________
Version 4.0.3 Developer |
|
|
|
|
|
|
#4 | |
|
Senior Member
Join Date: Jun 2007
Posts: 110
Rep Power: 11 ![]() |
Quote:
If anyone could point me in the right direction of how to do an {if} statement on those thumbnails, that would be great!
__________________
Crystal v4.0.8 Dev |
|
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jun 2007
Posts: 110
Rep Power: 11 ![]() |
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!
__________________
Crystal v4.0.8 Dev Last edited by crystal; 05-01-2008 at 12:25 AM. |
|
|
|
|
|
#6 |
|
Member
Join Date: Apr 2009
Posts: 52
Rep Power: 3 ![]() |
Thanks for providing these parts of code. exactly what i needed
Thanks
__________________
Jermayn Parker v4.1.3 Developer using deapsea as a template for hack m y own |
|
|
|
|
|
#7 |
|
All Hands On Deck
Join Date: Mar 2008
Posts: 1,257
Rep Power: 32 ![]() |
Tongue in cheek CWP. The debug feature of 68C shows you the variables available and you can see it in the template file.
Google is your friend. Smarty :: View topic - How to find the length of an array? You can make a test on {$data|@count} to see if you have 2 images in the array. Any logic you like. Like this {if $data|@count == 1} Hello Everyone {/if} |
|
|
|
|
|
#8 |
|
Member
Join Date: Apr 2009
Posts: 52
Rep Power: 3 ![]() |
Hey,
Just trying to do a mixture of both where you have the images listed to the right with the thumbnails below but when you click on the bigger image. It will use the thickbox JavaScript. Example: Trading Hub Classifieds Australia Pram Code: HTML Code:
<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 border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td> {section name=image loop=$data max=1} <table border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#000" style="border-collapse: collapse"> <tr> <td> <a href="photos/{$data[image].image}" title="{$data[image].title}" class="thickbox" rel="gallery"> <img id="placeholder" src="photos/{$data[image].image}" alt="" class="imageborder" width="250" /></a>{/section} </td> </tr> </table> </td></tr> <tr> <td valign="top" align="center"> <table border="1" cellpadding="5" cellspacing="0" bordercolor="#000" style="border-collapse: collapse" width="100%"> <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" height="70" alt="" /></a> {/foreach} </td> </tr> </table> Thanks
__________________
Jermayn Parker v4.1.3 Developer using deapsea as a template for hack m y own |
|
|
|
|
|
#9 |
|
68 Classifieds Staff
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,150
Rep Power: 119 ![]() |
I believe you can just add rel="gallery" to your small images and that will make them apart of the set. Not sure if that will cause them to popup in the lightbox though.
__________________
Eric Barnes 68 Classifieds Developer Please do not send me a private message asking for support. Instead use these open forums or our ticket system. Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules |
|
|
|
|
|
#10 | |
|
Member
Join Date: Apr 2009
Posts: 52
Rep Power: 3 ![]() |
Quote:
Only problem is that it adds an extra image in the gallery but you cannot view it. Not a big issue though
__________________
Jermayn Parker v4.1.3 Developer using deapsea as a template for hack m y own |
|
|
|
|
| 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 Modules & 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 Questions | 4 | 10-12-2006 11:05 AM |
| Changing Yahoo Maps layout | GSP | v3.1 Modules & Modifications | 1 | 10-01-2006 08:57 AM |