0
Suggested question
Suggested question.
> I'm trying to display a photo from a image field (Profile) within an html() block. My code concatenates the path with file(Profile):
html("<img src='" + file(Profile) + "'>")
However, the image doesn't display in the browser within Ninox.
What's the correct way to get the attachment URL and use it as the src of an <img> tag in html()?
The code.
let foto := Profile;
let nom := if Nombre then Nombre else "" end;
let ape := if Apellido then Apellido else "" end;
let dis := if 'Especialidad/Diciplina' then
'Especialidad/Diciplina'
else
""
end;
let nombreCompleto := nom +
if nom != "" and ape != "" then
" "
else
""
end +
ape;
let ed := dis;
html("<div style='display:flex;align-items:center;gap:10px'>
<img src=' + file(Profile) + ' style='width:20px;height:20px;border-radius:50%;object-fit:cover;'>
<div style='line-height:1'>
<div style='font-weight:600;font-size:12px'>" +
nombreCompleto +
"</div>
<div style='font-size:9px;color:#666;margin-top:2px'>" +
ed +
"</div>
</div>
</div>")
This don't work.
let fotoUrl := url(Profile);
html("<img src='" + fotoUrl +
"' style='width:20px;height:20px;border-radius:50%;object-fit:cover;'>")
1 Antwort
-
I take it. (ShareLink)
Content aside
- Status Answered
- vor 11 TagenZuletzt aktiv
- 1Antworten
- 21Ansichten
-
1
Folge bereits