Hi all,
I'm building a product system and want to display a image from a url given in the product details. So this is in the database and I want to display this on the page.
How can I do this the best way?
Thanks,
Tim
show image from url
Re: show image from url
Hi,
just to clarify, the url is in the database and that points to an "external" image (an image that does not belong to you app)?
just to clarify, the url is in the database and that points to an "external" image (an image that does not belong to you app)?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
- Posts: 22
- Joined: 2019-03-20 13:46
Re: show image from url
Yes, to a external url like supplier website or CDN.
©2019 - No rights reserved
Re: show image from url
Code: Select all
you can add to the TABLENAME.php -> TABLENAME_dv function something like:
Code: Select all
$url=YOUR_SQL_STATEMENT_TO_RETRIEVE_THE_URL;
$html.=<<<EOC
<script>
\$j(SPACE_TO_PUT_THE_IMAGE_AFTER).after('<img src="$url">');
</script>
EOC;
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
- Posts: 22
- Joined: 2019-03-20 13:46
Re: show image from url
Ok, will try that later.
Guess there is no build-in option for this unfortunately.
Guess there is no build-in option for this unfortunately.
©2019 - No rights reserved
Re: show image from url
You should have a look at the new SQL Query feature of 5.80. You should be able to use the SQL concat() function to concat a valid <img>-Tag including the src="" attribute.
Just an idea.
Best,
Jan
Just an idea.
Best,
Jan
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
-
- Posts: 22
- Joined: 2019-03-20 13:46
Re: show image from url
just testing with the tip of Jan...
Used this code in the SQL Query field
Result in only the SQL data, not the other strings that I added.
Adding html tags kills the query...
Used this code in the SQL Query field
Code: Select all
SELECT `products`.`item_img_upload` FROM `products`
CONCAT(`Show`,`products`.`item_img_upload`,`IMG-URL`)
Adding html tags kills the query...
©2019 - No rights reserved
-
- Posts: 22
- Joined: 2019-03-20 13:46
Re: show image from url
also tested with this code:
I only get the value as a return, not the CONCAT string...
Anyone with an idea what goes wrong here?
Code: Select all
SELECT CONCAT(
'<img src="',
`products`.`item_img_upload`,
'">'
) FROM `products`
WHERE `products`.`id`='%ID%'
Anyone with an idea what goes wrong here?
©2019 - No rights reserved