preview thumbnail with pdf file

4 posts by 3 authors in: Forums > CMS Builder
Last Post: February 22, 2011   (RSS)

Re: [Maurice] preview thumbnail with pdf file

By Jason - January 11, 2011

Hi Maurice,

Currently, it's only possible to CMS Builder to create a thumbnail of an image file.

If you have a graphic that you would like to display for a zip or a pdf file, you can check the uploads extension field and then output that a corresponding image.

For example:

<?php foreach ($record['upload'] as $upload):?>
<?php if($upload['extension']=="zip"):?>
*OUTPUT ZIP GRAPHIC*
<?php elseif ($upload['extension']=="pdf"):?>
*OUTPUT PDF GRAPHIC*
<?php endif ?>
<?php endforeach ?>


Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] preview thumbnail with pdf file

I have just implemented this but I need to limit the pdf graphic to just one, so for example if 3 pdfs are uploaded I just want to display one graphic. The url is:http://www.wildcountryconsultants.co.uk/cms/wildcountry_consultants_uk_courses.php

Re: [Mercer Design] preview thumbnail with pdf file

By Jason - February 22, 2011

Hi,

Probably the easiest solution would be to have a separate upload field where you only allow pdfs to be uploaded. All you'll need to do then is check to see if there are any uploads. If there are, output your pdf graphic and then output all of your links.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/