Default Image for a file upload not shown when referencing from databasejoin

burghard

Member
I have a databasejoin element which references another table with a fileupload element for which a default image is set. I set the databasejoin element to be rendered as '<img src="', upload-element, '"/>', where upload-element is the fileupload element (with the set standard image) from the joined table.
If there is no image uploaded for a referenced record, which has no picture uploaded, I get "/" for the image source. So a broken image for all records with no picture uploaded is displayed. I expected to get the url to the default image. Is there a trick to get it running?
 
Last edited:
The default image isn't stored in the database. It's added by the element code when rendering, if the upload element is empty.

You could probably do it with a variation on a COALESCE, and specify your default image in the CONCAT label ...

Code:
'<img src="',  COALESCE(NULLIF(upload-element, ''), '/your/default/image.png'), '"/>'

-- hugh
 
Yup. We just stick whatever you put there in a CONCAT(...), so you can do anything that's valid in a concat, from simple strings to complex queries.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top