+ Start a Discussion
Tanya ShahTanya Shah 

thumbnail s3

Hi experts,

I'm trying to integrate amazon S3 with Sales force, i did it with the toolkit. When it says to
upload image,it shows the image to a bigger size which I do not want.How do i resize it ?.Pressing my head onto this from many days . Can anybody please help me to fix this ?

Thank you !
Best Answer chosen by Tanya Shah
Sumitkumar_ShingaviSumitkumar_Shingavi
Based on what you wrote above, I see the approach you trying to follow for building this solution is going in wrong direction.

You need to use <apex:image> tag like below:
<apex:image id="theImage" value="https://s3.amazonaws.com/{!AWS_S3_Object__c.Bucket_Name__c}/{!AWS_S3_Object__c.File_Name__c}" width="100" height="100"/>

Above syntax will display a single image! Now you need to use simple HTML table and have a tr inside it and then 3 td if you want to show 3 images. Each td will hold 1 <apex:image> tag and this all can be written in a VF page. The VF page which you want to embed on standard detail page need to have standardController as that object. You will be bale to achieve dynamics of records specific images by this!

Hope this solves your problem!

All Answers

Sumitkumar_ShingaviSumitkumar_Shingavi
have you tried to manupulate Toolkit or the specific code in page and apply a <div> on the top of it and get it styled to show expected size.

PS: if this answers your question then hit Like and mark it as solution!
Tanya ShahTanya Shah
They have taken image with the formula field under the <script > . Like , they have a VF page called 'S3Preview ' where following is the code
 
<apex:page standardController="AWS_S3_Object__c" >
<script>window.location.href="https://s3.amazonaws.com/{!AWS_S3_Object__c.Bucket_Name__c}/{!AWS_S3_Object__c.File_Name__c}";</script>
</apex:page>
I did try it but no luck . Could you please help me .! Thank you !
 
Sumitkumar_ShingaviSumitkumar_Shingavi
You can modify that formula field (AWS_S3_Object__c.Bucket_Name__c) to say like below:
IMAGE("http://images.odeo.com/1/8/4/Zencast.jpg", "Flower", 100, 100)

PS: if this answers your question then hit Like and mark it as solution!
Tanya ShahTanya Shah
I want to arrange images in thumbnails .Like below

Thumbnail type images
I'm really stucked here . How do we make this possible . With apex this is not possible and its still a idea . I see that through HTML5 or Jquery but how do i make this possible in the toolkit ?

You owe choclates from me !! :) Thank you !

 
Sumitkumar_ShingaviSumitkumar_Shingavi
Approach 1: You can have a inline VF page which have your Jquery or HTML5 widget which toggle through those images.
Approach 2: You can have Rich Text Area Fields for each of the images and keep it on record if those images varies record to record. You can also put all images in single Rich Text Area.
Approach 3: You can have RTA for each of image and have one formula field which have all 3 together which you will show in Preview section.

I would like you to select my previous comment as answer as it does answered your question posted on this post.

PS: if this answers your question then hit Like and mark it as solution!
Tanya ShahTanya Shah
I re-read all the code again .I did try the changes you suggested but in preview it is showing blank. Below is what i tried ,
 
<script>window.location.href="https://s3.amazonaws.com/!IMAGE("http://images.odeo.com/1/8/4/Zencast.jpg", "Flower", 100, 100)/{!AWS_S3_Object__c.File_Name__c}";</script>

The Approach 2  was what I was thinking . But in the toolkit , the images vaires from record to record . Could you please help me to achieve it to pull all images in single RTA . I'm able to see black cloud only .

 
Tanya ShahTanya Shah
I'm absolutely stucked here . Which fields should I make it RTA to get the images ? Please help.
Sumitkumar_ShingaviSumitkumar_Shingavi
You did it wrong Tanya! That was the formula field code and how you can control dimention in Formula field. What your formula field contains? Image or just name of image? if name of image then you need to use "<img>" tag else if you have Image in Formula then use my syntax.

PS: if this answers your question then hit Like and mark it as solution!
Tanya ShahTanya Shah
I'm bit confused now, banging my head . You are an expert !  I have a forumala field (Preview_Link__c) which has
HYPERLINK('https://s3.amazonaws.com/'& Bucket_Name__c &'/'& File_Name__c , 
'https://s3.amazonaws.com/' & Bucket_Name__c &'/'& File_Name__c )
Also  as mentioned they have made a component (Preview ) which as following
<script>window.location.href="https://s3.amazonaws.com/{!AWS_S3_Object__c.Bucket_Name__c}/{!AWS_S3_Object__c.File_Name__c}";</script>
I do not see any image nor any image name anywhere . I tried with all aspects but still no luck .Thank you ! Please help.

 
Sumitkumar_ShingaviSumitkumar_Shingavi
Based on what you wrote above, I see the approach you trying to follow for building this solution is going in wrong direction.

You need to use <apex:image> tag like below:
<apex:image id="theImage" value="https://s3.amazonaws.com/{!AWS_S3_Object__c.Bucket_Name__c}/{!AWS_S3_Object__c.File_Name__c}" width="100" height="100"/>

Above syntax will display a single image! Now you need to use simple HTML table and have a tr inside it and then 3 td if you want to show 3 images. Each td will hold 1 <apex:image> tag and this all can be written in a VF page. The VF page which you want to embed on standard detail page need to have standardController as that object. You will be bale to achieve dynamics of records specific images by this!

Hope this solves your problem!
This was selected as the best answer