I would like to show a image at the beginning of a row if a value in my database is set. How can I do that?
I’ve got a date field which is filled with a value after a user has marked this entry as finished via a edit etemplate. In the etemplate which shows the rows of my database entrys I like to show an image (red light) if the date field isn’t filled in the database otherwise (if the field is filled) I like to show a different image (green light).
Is there an easy way to implement this within etemplates?
It is possible. Do you have the rows and data working yet? Leave the image on/off part to the end and get the rest of the functionality working and I suspect you will answer your own question along the way.
You could hack etemplate as well but it would be easier to perhaps create a new widget. It sounds as if you would not need to do either though.
It is possible. Do you have the rows and data working yet? Leave the image
on/off part to the end and get the rest of the functionality working and I
suspect you will answer your own question along the way.
Yes, get the basics working first.
To get an image that changes, you would set another field in your row data:
Then set the image name to ${row}[image] (or something like that…).
Nathan
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl
Rows and data are working fine inside my etemplate. The image on/off part is some kind of improvement for my users to quickly see which entries are finished / are in progress / are past due…
The image on/off part works fine now after I added some code to my UI file. I altered the row data array with the php function array_push to extend it with a status_picture and a status_text value and entered those values in the image widget in my list rows etemplate.
I was searching for some kind of trick inside the image widget to make this image of/off part functional without using to much code inside my UI file.