Announcement
Collapse
No announcement yet.
How do I refer to one image id in {{imageIds}} in Template
Collapse
X
-
Excellent improvements ! specially the Custom Template Helpers.
I look forward to 5.8.0 and try to see if "css classes" can be defined as custom template helpers and thus they will be correctly rendered by TCPDF.
Leave a comment:
-
In the next version it will be possible use imageTag https://github.com/espocrm/documenta...-pdf.md#images
- Likes 2
Leave a comment:
-
Perhaps you can verify if the image is actually loaded, Espo keeps track of images as "attachments" by creating one attachment record for each file where the record id is the same as the file name.
The actual file exists in the "data/upload/" folder
Leave a comment:
-
Originally posted by telecastg View PostI am not familiar with TCPDF errors but I am printing image fields to PDF without a problem using the following code in a template, my image field id is "landlordSignatureId" maybe it can help:
Code:<img style="width: 132.83px; height: 83.95px;" src="?entryPoint=image&id={{landlordSignatureId}}">
The field type should be "Image" right? So it correct, without using the image code it produce the #ID string so it can retrieve the code but it cannot display image.
Then I noticed that I been using the Header section, thinking that is the mistake I tried do same code in the Body but it still didn't work.
I guess I give this up for now.
Leave a comment:
-
I am not familiar with TCPDF errors but I am printing image fields to PDF without a problem using the following code in a template, my image field id is "landlordSignatureId" maybe it can help:
Code:<img style="width: 132.83px; height: 83.95px;" src="?entryPoint=image&id={{landlordSignatureId}}">
- Likes 1
Leave a comment:
-
Having trouble using this. Just learn about it, I get this error:
TCPDF ERROR: [Image] Unable to get the size of the image: 5e14147c43d
Is there a standard type of format of the image that we must use for this to work? This is a .jpg file I'm testing it with. Saved the image from irfanview.
Leave a comment:
-
{{file imageId}} means the name of the field (image type) where the image is contained concatenated with the string "Id".
So for example, if you have an entity with a field type IMAGE named "myImage" the template line should be <img src="myImageId"> and this will display the image.
Espo stores images as files in the data/upload folder and assigns an ID string to refer to them, so the actual content of the "myImage" field is the ID string assigned by the system to the file.
The reason why you have to concatenate "Id" to the field name is because the actual mysql table field name is "my_image_id"
Leave a comment:
-
How do I refer to one image id in {{imageIds}} in Template
I am writing a template and have a quick question that I can find the answer from
It's possible to print image fields:
<img src="{{file imageId}}"> where imageId – the name of custom image field, concatenated with the suffix Id.
when I use the above line it doesn't show any photos, when I use {{imageIds}} it returns 5cbf164eb8f245ae8,5cbf165be263d61e6,5cbf16654f0f60 6d8,5cbf1668e50359b69,5cbf166c60013a7 a3,5cbf187aa2ae037c7,5cbf187ec89466199
How do I get just the first image id in Template?
ThanksTags: None
- Likes 1
Leave a comment: