Hello,
i have installed imageMagick and i can upload some pdf in my gallery. Gallery display pdf thumbs, everything work.
When i click on it, it displays the first page of the pdf as a photo. You have to click on "Download document in original format" in order to view the entire pdf with adobe reader (in full screen).
I just want to know if it's possible to open the pdf directly by clicking on the pdf thumb, and skipping the step where it displays the first page of the pdf as a photo.
i hope my explanation is clear
Thank you
Posts: 8339
best way would be to modify /themes/your theme/templates/local/album.tpl <- you may have to copy the original here
the find where it is looping through the $child items and test for application/pdf and set the view to DownloadItem url instead of a ShowItem url
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 8
thank you for the answer,
it doesn't work yet because i am a little bit lost, am i doing right ?
is it the right place to put the code (in bold) ?
Posts: 8339
put it just above this line:
{elseif isset($child.thumbnail)}
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 8
Thank you very much, it works !
I really appreciate your help
i put it below the line because noting happened when i put it above.
Thanks again
Posts: 2
I tried to follow this post to achieve the exact same requirement. However, i have fol to share:
1. the folder named "local" is not found at the path "~/gallery2/themes/matrix/"
2. even though i created the folder and copied the file "album.tpl" in it
3. i made the necessary modifications as you suggested, BUT it just wont work for me !
can you again elaborate by sharing the file or file content of your album.tpl, so that i am able to resolve it !!!
Thanks in anticipation.
Posts: 8
I can't share the file content because i'm using my tab.
In fact, i don't use a copy of the file (i know its bad) so i dont have the local folder. I modify the original file.
It should work like this
Isy
Posts: 8339
Remember, when you edit templates you must clear your template cache to see changes
FAQ: How can I clear cached data?
-s
Posts: 2
even after many tries and clearing the template cache as well i cant make it work (possibly owing to my lack of php knowledge)....
Here is the partial code of my album.tpl....
.
.
.
{/g->container}
{if $child.mimeType == 'application/pdf'}
{capture assign=linkUrl}{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}{/capture}
{/if}
{elseif isset($child.thumbnail)}
<a href="{$linkUrl}">
{g->image item=$child image=$child.thumbnail class="giThumbnail"}
</a>
{else}
<a href="{$linkUrl}" class="giMissingThumbnail">
{g->text text="no thumbnail"}
</a>
{/if}
</div>
.
.
.
What am i doing wrong .... please help correct it .... Thanks.
Posts: 5
SOLVED !
I had to put 's piece of code a few lines up the position you suggested:
This is my album.tpl working.
----
<div>
{if isset($theme.params.$frameType) && isset($child.thumbnail)}
{g->container type="imageframe.ImageFrame" frame=$theme.params.$frameType
width=$child.thumbnail.width height=$child.thumbnail.height}
<!-- PDF CHECK - start --> {if $child.mimeType == 'application/pdf'}<!-- 002 -->
{capture assign=linkUrl}{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}{/capture}
{/if}
<!-- PDF CHECK - end -->
<a href="{$linkUrl}">
{g->image id="%ID%" item=$child image=$child.thumbnail
class="%CLASS% giThumbnail"}
</a>
{/g->container}
{elseif isset($child.thumbnail)}
<a href="{$linkUrl}">004
{g->image item=$child image=$child.thumbnail class="giThumbnail"}
</a>
{else}
...
...
{/if}
</div>
----
Thanks for your help !!!
Alessandro