Page 1 of 1

Images in html template not shown

Posted: Monday 15 May 2023 20:48
by athoopen
Guru's,

I created a simple template file in .../www/templates/webcam.html. It looks like:

Code: Select all

<!DOCTYPE html>
  <html>
    <body>
      <img src="achtertuin.jpg" alt="Achtertuin" style="width:400px;height:400px">
      <img src="voor.jpg"       alt="Voor"       style="width:400px;height:400px">
      <img src="prieel.jpg"     alt="Prieel"     style="width:400px;height:400px">
   </body>
</html>
In the UI I get the dropdown to go to this page, but it DOES NOT show me the images.
If I browse to https://domoticz/templates/webcam.html I DO get the images.

What am I doing wrong ... I expected to see the images also within the Domoticz UI.

PS: it is https but self signed .....

Re: Images in html template not shown

Posted: Monday 15 May 2023 21:37
by waltervl
Perhaps use the path in the src eg
"./templates/voor.jpg"

Re: Images in html template not shown

Posted: Tuesday 16 May 2023 14:36
by athoopen
I don't think that it will work since the images are in the same dir as the html file ... but I give a go ...didn't work, except that in accessing the page directly the images are not found anymore (as I expected).

But thanks for taking the time to think about it!

Re: Images in html template not shown

Posted: Tuesday 16 May 2023 17:04
by Kedi
Give this a try: "templates/voor.jpg"

Re: Images in html template not shown

Posted: Tuesday 16 May 2023 17:09
by waltervl
The custom page is rendered by the domoticz internal webserver running from the www folder. so everything should be relative from that.
I suppose "/templates/voor.jpg" should work.
If you press F12 on the browser when showing the custom page from domoticz you probaly also see the error message.

Re: Images in html template not shown

Posted: Tuesday 16 May 2023 19:12
by Kedi
I just tested my solution, and it works.

Re: Images in html template not shown

Posted: Friday 19 May 2023 17:13
by athoopen
@kedi, you are right, works!

Thanks for your time.