Problem is I want it to display the image from a certain field only (fieldname = “Img1”) and not all image file attachments on the document like this code is doing.
Can someone give me a hand please, is this just an easy code change or is it more difficult?
Subject: Help to Change CodeStore Code for Image in a View
why not have a hidden field on the document that stores the computed URL?
You could use the querysave event to run some lotusscript which would build the URL by getting the embedded objects and checking the parent property to see the name of the field that contains the image.
This will also mean the view column can simply reference a field instead of having to compute a value which should improve the performance of the view.
Subject: RE: Help to Change CodeStore Code for Image in a View
Attachments are not held “in” the rich text fields where the link appears; they are held in $File items on the document. That’s why the URL goes through “/$File/”. All of these items have the same name (a possibility in Rich Text fields).
Subject: RE: Help to Change CodeStore Code for Image in a View
OK, Can I specify the image by name then?
I can then make sure that the image is the same name in all documents, meaning the image will be shown in the view, but any others attached to the document will not.
Subject: RE: Help to Change CodeStore Code for Image in a View
Chris,
Thanks for responding again.
Each document contains an image attachment. Each document is a property which is for sale.
Therefore, in the web view, I want that image to be displayed, therefore having a small picture of each property in each row in the view, together with other details like type, number of bedrooms, etc so web users can see the small picture and click on it, which will take them into the actual document.
At the moment, I am using the code I said, which looks at any attachments on the document and puts them in the view. I am therefore only attaching one image per document to get this to work. I want to start attaching other larger images to use for other things, but if I attach any other files onto the document, they display in the view too.
Hence my thought of calling the image file that shows up in the view a certain within each document - like view_image.gif. Would that work with the code I am using??
If so, what would I have to do to the code. Sorry, a newbie to this but learning fast now.
Subject: RE: Help to Change CodeStore Code for Image in a View
It sure will. In fact, you can do the same sort of thing with all of the attachments – give them a consistent name across all documents, then coding any links (to, say, PDFs and so forth) can be done the same way.
Subject: RE: Help to Change CodeStore Code for Image in a View
Thanks to all who helped me here.
Sorry, but I am a newbie in at the deep end, learning fast.
We have all been there and thanks for taking the time to help me.
All sorted now, still not 100% sure how that formula is working, but I reapaced the @attachmentnames with the file name viewimage.gif and it is picking the image with that name, meaning I am able to attach other files into the document without them diplaying in my view.