Images in html template not shown

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
User avatar
athoopen
Posts: 57
Joined: Wednesday 14 December 2022 12:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: Netherlands
Contact:

Images in html template not shown

Post 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 .....
Cheers,
Arjan

Rp3 Using : RFXCom, LaCrosse, KNMI, Remeha, TinyTuya, zigbee and a few others
User avatar
waltervl
Posts: 6689
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Images in html template not shown

Post by waltervl »

Perhaps use the path in the src eg
"./templates/voor.jpg"
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
athoopen
Posts: 57
Joined: Wednesday 14 December 2022 12:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Images in html template not shown

Post 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!
Cheers,
Arjan

Rp3 Using : RFXCom, LaCrosse, KNMI, Remeha, TinyTuya, zigbee and a few others
Kedi
Posts: 595
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Images in html template not shown

Post by Kedi »

Give this a try: "templates/voor.jpg"
Logic will get you from A to B. Imagination will take you everywhere.
User avatar
waltervl
Posts: 6689
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: Images in html template not shown

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Kedi
Posts: 595
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Images in html template not shown

Post by Kedi »

I just tested my solution, and it works.
Logic will get you from A to B. Imagination will take you everywhere.
User avatar
athoopen
Posts: 57
Joined: Wednesday 14 December 2022 12:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: Images in html template not shown

Post by athoopen »

@kedi, you are right, works!

Thanks for your time.
Cheers,
Arjan

Rp3 Using : RFXCom, LaCrosse, KNMI, Remeha, TinyTuya, zigbee and a few others
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest