[TYPO3-english] Get count from database and display image based on count

Tomaž Lovrec tomaz.lovrec at gmail.com
Sun Jul 21 21:51:35 CEST 2013


I need to display an image, based on the count from the database. I've got my count out of the databse:
lib.unreadMessages = CONTENT
lib.unreadMessages {
  table = tx_mmforum_pminbox
  select {
    selectFields = count(*) as msges
    pidInList = 21
    andWhere.data = TSFE:fe_user|user|uid
    andWhere.wrap = to_uid=|
    andWhere.20.data = 1
    andWhere.20.wrap = read_flg=|
  renderObj = COA
  renderObj {
    10 = TEXT
    10 {
      data = field:msges

And would like to display 2 different images, never both at the same time. One is when count is 0, and other, when count is greater than zero. Can this be done with typoscript alone? I'm running out of ideas.

Kind regards,

More information about the TYPO3-english mailing list