[SOLVED] Get Images With Databasejoin

Status
Not open for further replies.

startpoint

Active Member
Hi,
I have a list who have a fileupload field.
In the second list i use databasejoin element to show data with radio list.
I want to show image instead of it's image path.
How to change this path to real image?
 
Not sure, but maybe if you try to use '<img src="your/path/filename.jpg">' in "or concat label" area?
 
I use in "or concat label" area this code:
Code:
`table_name`.`image_element_name`
,
but this show only image path.
And this code:
HTML:
<img src="`lop2q_fenster_profile`.`profile_image`"/>'
not working too.
?his is part of the example in tooplip:
(e.g. `people.last_name, ', ', people.first_name` ...
I think there is an error and should be as follows:
(e.g. `people.last_name`, ', ', `people.first_name` ...

To me this way works.
 
Hmm, looks like we strip tags from the labels. Don't know when we started doing that, as I'm sure I've shown IMG tags in radios before.

Anyway, as of this commit:

https://github.com/Fabrik/fabrik/commit/847b446dc1b9789686575ce228ce1ec903375ee5

... you should be able to do what you are trying to do. Although I suspect it will have issues if you try and use that element as a list filter, which will still strip tags as it'll show it in a dropdown list.

-- hugh
 
I use this code:
Code:
'<img src="', {thistable}.image, '"/>'
but this show write image file path instead of the image itself.
If I use ReReplacer from NoNumber images show.
 
I saw Jaanus's pull request on that one, I'm just not 100% sure that's the right place to do it ... but I'll go ahead and merge, and we'll worry about the niceties later.

This is a bit of a hack. It's a problem we have in several places. When dealing with data coming out of the database which we need to display, we have no a-priori knowledge of whether things like < and > are part of HTML tags which the admin wants to be kept as-is, or non tag characters which need to be html encoded.

So with code after Jaanus's change, we could wind up with broken DOM's, where someone has (say) a > character in the label ("Rob > Hugh") which is supposed to be encoded.

-- hugh
 
It's working on my site.
You have to make sure that your image path has the correct format etc (e.g. on Windows a fileupload image is stored as a\b\img.jpg in DB and you have to do a REPLACE({thistable}.element,"\\","/") in your concat.
Check with a browser dev tool what you get and how it must be.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top