Images in table from URL

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
kikee122
Posts: 1
Joined: 2015-05-23 22:13

Images in table from URL

Post by kikee122 » 2015-05-23 22:14

Hi there,

I have lots of image URL's in a database table.

I would like to show the image in the generated table. So, is there a way to have <img src="DATABASE FIELD VALUE">

Thanks

User avatar
a.gneady
Site Admin
Posts: 1287
Joined: 2012-09-27 14:46
Contact:

Re: Images in table from URL

Post by a.gneady » 2015-05-24 22:34

Yep. Open the generated templates/tablename_templateTV.html file in a text editor (where tablename is the name of the concerned table) and find the following placeholder in the file:

Code: Select all

<%%SELECT%%><%%VALUE(fieldname)%%><%%ENDSELECT%%>
fieldname is the name of your image url field. Change this to:

Code: Select all

<img src="<%%VALUE(fieldname)%%>" style="max-width: 200px;">
The max-width style in the above code might be needed to control the display size of the image .. you might want to use max-height instead based on how you want your layout to look like (the aspect ratio won't be distorted).
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

Post Reply