Is there a way to include graphics in an HTML template?
Depends how you want to include it but things like <img
tags to some URL should work just fine.
Is there a place somewhere in Corteza that we can place these images and refer to them in IMG tags? It would be a lot better than parking them off the server.
No.
@jfortun what do you think about this? Would be a decent idea to simplify referencing uploaded files.
At some point, we could make a drive-like feature but that’s out of reach for a white
Would make sense
Either that or a “template” file utility, where you can upload and reference those files in the templates.
A lot of improvements can be made for the template builder, currently its quite barebones.
Is there a particular folder that the templating engine thinks of as the www root? According to the Gotenberg website, images placed in that folder can be referenced.
Just following up on my last question about a folder that the Gotenberg engine thinks of as the root folder for the HTML file that it builds. Anyone know the answer?
OK, I’ve come up with a solution of sorts for this. Because we don’t have access to the document root when the template engine generates its output, the only alternative is to use images from external web servers, using image tags like img src=“http://…”. My issue up to this point was that I didn’t want the images that I was using to be exposed to the internet - they were for use only by the template engine.
What I ended up doing was:
- Configured the cloud server that I was using to add a new LAN IP address (not WAN, so it can’t be accessed from outside my server group)
- Established a docker instance of Apache Web Server (httpd) in a folder called httpd_lan, and configured it to listen only to port 80 of the LAN IP address established in step 1. Set the volumes so that the www root folder was available from the server file system.
- Created an /images folder in the www root and placed the images that I needed available to Gotenberg in this folder.
With this setup, the images are only available over the server group LAN, and only if the IP address of the httpd_lan server is known. And it works - I’m now able to use those images as I generate PDF files using the Corteza template engine.