add thumbnail to item page

blitz boy

Joined: 2006-01-03
Posts: 10
Posted: Wed, 2006-01-04 00:28

Hello, obviously it's not useful to show a thumbnail on a photo page, but it is for videos! Does anyone know how to add the item thumbnail to the item page? Thanks for any help.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2006-01-14 21:51

have you disabled embedded display of the video, or using a movie type without embedded display? guess it would make sense to show the thumbnail if you just have a download link.. is that what you're after?

 
blitz boy

Joined: 2006-01-03
Posts: 10
Posted: Fri, 2006-02-10 08:28

Yes, exactly. I disabled embedded display and opted for a (force) download link.

This (below) is the code in the album.tpl that calls the thumbnail, so I pasted it in photo.tpl and changed it in every way I thought might work, but couldn't get it to display. Just kept saying "[Render error: missing entity]".
{g->image item=$child image=$child.thumbnail class="giThumbnail" vspace="4"}

I tried changing $child to $theme.item and $item, but neither worked. Any other ideas? Thanks.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2006-02-10 18:57

there's no $child in photo.tpl, $theme.item is right. but maybe there's no $theme.item.thumbnail. try turning on buffered debug output in config.php, then reload the page and view the popup window with smarty debug output.. this shows you all the data available to the page. i think something like $theme.imageViews.0 might have the thumbnail.

 
blitz boy

Joined: 2006-01-03
Posts: 10
Posted: Sun, 2006-02-12 09:27

$theme.imageViews.0 actually shows the item (video) itself. I turned on debugging but am not sure how to use it to see the problem. I really appreciate your help. If you have any other suggestion, feel free. Thanks.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2006-02-13 02:35

ah, if .0 has the item and not the thumbnail then the thumbnail probably isn't being loaded.
you can load that data into $template in your theme's showPhotoPage function, using GalleryCoreApi. if that's too much, this might work: add 'thumbnails' to $dataTypes in showPhotoPage, then after $dataTypes in the loadCommonTemplateData call, add:
, array($item->getId())
with those changes then i think $theme.children.0.thumbnail will have the thumbnail loaded.

 
blfh

Joined: 2004-05-14
Posts: 23
Posted: Thu, 2007-06-07 17:30

hello mindless and others,

i tried your suggestion.

just adding 'thumbnails' doesn´t work. adding the ", array($item->getId()" to the loadCommonTemplateData call makes all the pages display no more.

what´s the way to load the thumbnaildata into the showPhotoPage with GalleryCore API? - i read the apidocs, but couldn´t figure it out.
Any other way to get the thumbnail-id/url in the photo.tpl is highly appreciated, too!

Thanks a lot, Frank

 
ZubaZ

Joined: 2008-03-18
Posts: 23
Posted: Mon, 2009-05-04 12:54

Hello,

Is that hard to display thumbnail of the current image in photo.tpl? I was trying myself to do this and I could not find any solution :/
I see some old posts, including this one, regarding the issue and no solution yet. I am still trying but maybe somebody found the way! :D

Rectification: mindless's solution is working. $theme.children.0.thumbnail is array and if you put for example $theme.children.0.thumbnail.id, you will get the id of the thumbnail :)

------------
mediashow.ro

 
ZubaZ

Joined: 2008-03-18
Posts: 23
Posted: Mon, 2009-05-04 12:55
blfh wrote:
hello mindless and others,

i tried your suggestion.

just adding 'thumbnails' doesn´t work. adding the ", array($item->getId()" to the loadCommonTemplateData call makes all the pages display no more.

what´s the way to load the thumbnaildata into the showPhotoPage with GalleryCore API? - i read the apidocs, but couldn´t figure it out.
Any other way to get the thumbnail-id/url in the photo.tpl is highly appreciated, too!

Thanks a lot, Frank

You get the error because you miss one ")". you should put ", array($item->getId())" not ", array($item->getId()".
------------
mediashow.ro

 
ZubaZ

Joined: 2008-03-18
Posts: 23
Posted: Tue, 2009-06-30 17:14

I got a new and better approach in order to achieve this. I don't know if it's clean or it's the right way but it works and there is no need to modify theme.inc.

So here it is:

{* calling item thumbnail *}
  {g->callback type="core.LoadPeers" item=$item|default:$theme.item addEnds=false loadThumbnails=true windowSize="1"}
  {assign var="bla" value=$block.core.LoadPeers}
  {if !empty($bla.peers)}
   {foreach from=$bla.peers item=peer}
     {if ($peer.peerIndex == $bla.thisPeerIndex)}
      {assign var="blaThumbId" value=$peer.thumbnail.id}
     {/if}
   {/foreach}
  {/if}
{* end calling item thumbnail *}

And when you want to show, in my example, thumbnail ID, you put: {$blaThumbId}
I choose $peer.thumbnail.id because this is what I need but you can call whatever you want.

This is an example of why I need thumbnail inside photo.tpl (I display the thumbnail while the photo is loading): http://mediashow.ro/104609

Regarding the previous way, with the modification of theme.inc, there is one issue: you will have your thumbnail but you will have also all links in core.ItemLinks twice.

------------
mediashow.ro

 
bjunior

Joined: 2010-10-26
Posts: 3
Posted: Tue, 2010-11-09 01:44

Zuba,

Could you please post the complete tag to display the thumbnail of the current image in photo.tpl?

Thanks.
Jr