thumbnail src
hdotnet
Joined: 2003-01-29
Posts: 23 |
Posted: Fri, 2009-10-30 13:15 |
hi there, I've been tasked with developing a custom theme that utilises rollovers on thumbnails. As such I need to get at the src attribute of the thumbnail of each album and photo to provide it within the template as a css background url on the html element container. g->image only seems to provide the full <img...> html tag. Looking at the api doc's I can't see which method to use to get this info from within my theme.inc to pass it to the template. fetchThumbnailsByItemIds seems to only this sort of data: Array ( [width] => 150 [height] => 150 [derivativeSourceId] => 19 [derivativeOperations] => thumbnail|150 [derivativeOrder] => 0 [derivativeSize] => 5322 [derivativeType] => 1 [mimeType] => image/jpeg [postFilterOperations] => [isBroken] => 0 [parentId] => 19 [id] => 20 [creationTimestamp] => 1252655433 [isLinkable] => 0 [linkId] => [linkedEntity] => [modificationTimestamp] => 1252655434 [serialNumber] => 2 [entityType] => GalleryDerivativeImage [onLoadHandlers] => [_persistentStatus] => Array ( [flags] => 0 [originalValue] => Array ( [width] => 150 [height] => 150 [derivativeSourceId] => 19 [derivativeOperations] => thumbnail|150 [derivativeOrder] => 0 [derivativeSize] => 5322 [derivativeType] => 1 [mimeType] => image/jpeg [postFilterOperations] => [isBroken] => 0 [parentId] => 19 [id] => 20 [creationTimestamp] => 1252655433 [isLinkable] => 0 [linkId] => [modificationTimestamp] => 1252655434 [serialNumber] => 2 [entityType] => GalleryDerivativeImage [onLoadHandlers] => ) ) ) Can anyone point me in the right direction to get the /path/to/thumbnail/image ? Are there any other issues I should be aware of in doing this? Thanks in advance. H -- |
|
Posts: 23
I've think I've found the droid I was looking for...
am using this in the relevant theme.inc method:
Please tell me if this is the right droid, obi wan.
Thanks
--
freelance web developer in london
http://www.capitalh.net
Posts: 16504
First, I'd start with looking at other themes. Depending on what you want to do, you may need to change code in theme.inc so the information is going to be available to your theme. But all you said was that you want a rollover.
You'll want to look at album.tpl. That's the template file that controls the look of the album pages.
http://codex.gallery2.org/Gallery2:Editing_Templates
Theme showcase:
http://themes.gallery2.hu/
If you put Gallery into buffered debug mode, a Smarty Debug popup window will appear and that contains ALL of the information available to the theme you are currently using and the page you are currently viewing.
FAQ: How to set/use Gallery in debug mode?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 23
Hi nivekiam,
The code I had pasted in the OP was from the smarty debug popup.
I am editting theme.inc as you suggest already... and reading the api docs/viewing themes all over, but finding the img/thumbnail src info was proving problematic. sometimes the smallest things are the hardest to find!
Eventually I found the info I needed in a 3rd party chunk of code: mediaBlock.php
I think I'm there now, but seem to be taking a bit of a performance hit when running the urlGenerator object (despite passing by reference). Could just be my VM playing up however.
The only info I've found on this class is here, which I've found via google:
http://gallery.menalto.com/gallery/doc-images/uml/URL+Generator.png.html
gallery.menalto.com is an enormous site, and its been a while (G1!!) since I've hacked about with this software.
Thanks
H
--
freelance web developer in london
http://www.capitalh.net
Posts: 16504
I don't understand what you are trying to do. Are you creating a theme for Gallery or are you trying to embed pictures or thumbnails from Gallery into non-gallery pages?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 23
Within theme.inc I am iterating over the objects, using the urlGenerator->generateUrl() class::method to get the src url of the thumbnail (using the arguements in my second post), adding this to the object array... I can then use this in the style attribute of my theme/albums.tpl.
The smarty debug info wasn't revealing the info I needed, and I came accross what is hopefully the correct solution in a 3rd party file.
As I've said, I think I've solved the problem.
H
--
freelance web developer in london
http://www.capitalh.net