Hi,
I was hoping for some feed back on my situation. I have a "quotes" widget that whenever the page loads, randomly picks a quote from the database. The quotes database table has a title, quote_text, first_name, last_name, city, and state columns. I then have a very basic HTML template that includes tags so the website admin user can position each bit of information for each quote in the right spot within the widget.
Example (overly simplified) template:
My Widget Title<br />
"<!quote!>"<br />
<!first_name!> <!last_name!><br />
<!city!>, <!state!>
I have the basics done and functional. However, I have a problem where if a specific quote doesn't have certain content, the code or punctuation on the same line is not removed, which leave a loose comma or blank line in the final display. For example; city and state are missing, but the comma after city and the break tag after state, which is in the template are still displaying.
I really don't want to get into a complex conditional templating system, because the users are very much novices and would get easily confused. It appears I have the following options;
1) make the users complete all fields per record. (not ideal)
2) hope that some smart person on this form knows of a good solution.
3) implement a conditional, nested template class. (anyone know of a "light" templating system?)
I would really appreciate any guidance anyone can provide. This script is written in PHP and data is pulled from a MySQL database.
Thank you,
Spencer