Nick wrote:If you're using it in the folders loop, then you would have to change $this->folder to $folder or something this way if you're inside the foreach() loop. Just look at the surrounding code that outputs folder information.
Can I add a photo that I only want as thumbnail for folder? So that I can force some photo from the folder with images and choose a photo to use as thumbnail.
Here is my code
<table>
<td height="<?php echo $maxFolderHeight + 10; ?>"><?php if ($item->previewimage && ($file = ivMapperFactory::getMapper('file')->find($item->getPrimary() . $item->previewimage))) : ?>
<?php if (ivPath::canonizeRelative(substr($file->thumbnail, 0, strlen($this->contentPath))) !== $this->contentPath): ?>
<img onMouseOver="$(this).fadeTo('fast', 0.5)" onMouseOut="$(this).fadeTo('fast', 1)" onload="$(this).completed = 1; $(this).delay(60 * 1).fadeTo('fast', 1)" src="<?php echo $this->url(array('c' => 'xml', 'a' => 'thumb', 'path' => $file->getPrimary())) ?>" alt="" />
<?php else: ?>
<img onMouseOver="$(this).fadeTo('fast', 0.5)" onMouseOut="$(this).fadeTo('fast', 1)" onload="$(this).completed = 1; $(this).delay(60 * 1).fadeTo('fast', 1)" src="<?php echo htmlspecialchars($file->thumbnail) ?>?<?php echo htmlspecialchars($file->getThumbnailMTime()); ?>" class="thumbImage" alt="<?php echo htmlspecialchars($item->name); ?>"/>
<?php endif; ?>
<?php else: ?>
<img onMouseOver="$(this).fadeTo('fast', 0.5)" onMouseOut="$(this).fadeTo('fast', 1)" onload="$(this).completed = 1; $(this).delay(60 * 1).fadeTo('fast', 1)" src="<?php echo htmlspecialchars($item->thumbnail); ?>?<?php echo htmlspecialchars($item->getThumbnailMTime()); ?>" width="90" height="80" alt="<?php echo htmlspecialchars($item->name); ?>"/>
<?php endif ?>
</td>
</table>