Adding a link to a downloable high-resolution file (jpg)
2 posts by 2 authors in: Forums > CMS Builder
Last Post: August 31, 2009 (RSS)
By gagester - August 31, 2009
Hello,
I'm trying to add an option to a page for users to download a high-resolution version of a photo that's displayed on the site.
We have a list of client stories. There's a thumbnail image that appears with the list of client stories, along with a larger version of the same image that displays on the client story detail page.
We need to add an option on the bottom of the detail client story page for users to download a high-resolution version of the photo.
I'm kind of confused about the whole "uploads" section in the admin and how those results are displayed. I'd prefer if our client wouldn't have to upload the image twice in order for this to work... but only if it's easy for me to implement. :P
Ideas?
Attached is the client story detail page that i need to add this "download" option to.
[:/]
I'm trying to add an option to a page for users to download a high-resolution version of a photo that's displayed on the site.
We have a list of client stories. There's a thumbnail image that appears with the list of client stories, along with a larger version of the same image that displays on the client story detail page.
We need to add an option on the bottom of the detail client story page for users to download a high-resolution version of the photo.
I'm kind of confused about the whole "uploads" section in the admin and how those results are displayed. I'd prefer if our client wouldn't have to upload the image twice in order for this to work... but only if it's easy for me to implement. :P
Ideas?
Attached is the client story detail page that i need to add this "download" option to.
[:/]
Re: [gagester] Adding a link to a downloable high-resolution file (jpg)
By Chris - August 31, 2009 - edited: August 31, 2009
Hi gagester,
If I understand you correctly, each "client story" record has one image, and you want it displayed in three different sizes: one small, for the list page; one medium-sized, for the detail page; and one large, to be linked to from the detail page?
How about having your client upload the large image, and having CMSb generate both the medium and small images as thumbnails?
To do this, modify your upload field and check out the options under Input Validation. I've attached a screenshot of how I think you'll want them set up.
Your list page won't change, since you're not changing how the first thumbnail works. You'll want to add these code snippets to your detail page to show the medium-sized image and a link to the big one:
You'll need to change the name of the record variable (mine is $newsRecord in the above example) and the name of your field (if it isn't already named 'upload', like mine.) You'll also need to re-upload large versions of your existing images, or visitors will be disappointed when they click on that link! :)
I hope this helps! Please let us know if you have any questions or comments.
If I understand you correctly, each "client story" record has one image, and you want it displayed in three different sizes: one small, for the list page; one medium-sized, for the detail page; and one large, to be linked to from the detail page?
How about having your client upload the large image, and having CMSb generate both the medium and small images as thumbnails?
To do this, modify your upload field and check out the options under Input Validation. I've attached a screenshot of how I think you'll want them set up.
Your list page won't change, since you're not changing how the first thumbnail works. You'll want to add these code snippets to your detail page to show the medium-sized image and a link to the big one:
<!-- the medium-sized thumbnail -->
<?php foreach ($newsRecord['upload'] as $upload): ?>
<img src="<?php echo $upload['thumbUrlPath2'] ?>" width="<?php echo $upload['thumbWidth2'] ?>" height="<?php echo $upload['thumbHeight2'] ?>" alt='' /><br/>
<?php endforeach ?>
<!-- a link to the full-sized image -->
<?php foreach ($newsRecord['upload'] as $upload): ?>
<a href="<?php echo $upload['urlPath'] ?>">Download a high-resolution version of this photo</a><br />
<?php endforeach ?>
You'll need to change the name of the record variable (mine is $newsRecord in the above example) and the name of your field (if it isn't already named 'upload', like mine.) You'll also need to re-upload large versions of your existing images, or visitors will be disappointed when they click on that link! :)
I hope this helps! Please let us know if you have any questions or comments.
All the best,
Chris
Chris