Jump to content
  • 0
DesiLogi

Use CB image path in text field instead of file field to open image

Question

Hi, 
My app is very image intensive and I have the user sometimes upload images to CB the normal way (in a File type field from a Submission form) and sometimes the image path/url will come from an S3 Bucket and be stored in a Text255 field. The goal is to have all image paths stored in a single field, whether uploaded by the user to CB or brought from an S3 bucket, and then use that field's file path to display images (because I often copy records and a FileType field cannot be copied without a special trigger set up by Caspio's DevOps, so I use a Text255 field for the image path). 

I can get the CB image path from the File Type field into a Text255 path, along with the S3 image paths (via formula). So that's done and I now have a single field with image file paths from either CB Upload or S3. The issue is displaying them: S3 images are fine but I can't get the images in CB to display. 

Neither <img src="[@field:Image_Text255_Field!]"/> or <img src="[@field:Image_Text255_Field/]"/> works if the image is stored in the CB account. 

Is there a way to reference images in CB from a text255 field to display them? I'd thought it would work the same as referencing a S3 image because it's just a file path and the image in CB is obviously available. Thanks for any help on this-- 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hello @DesiLogi

You can display using the URL in the Text255 only if you have one link in the field.
If you have more links, you need use JS to parse the value of the Text field, define each link and use them to append new <img /> tags with the appropriate values of links as many times as many links you have in the field.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...