Typoscript:IMAGE内容对象的条件

时间:2012-10-17 13:56:21

标签: conditional typo3 typoscript

我有这段代码:

customers = CONTENT
                customers {
                    table = tx_nmshowroom_customers
                    select {
                        pidInList = {$plugin.tx_nmshowroom_pi1.pid.showroomData}
                        recursive = 10
                        where = FIND_IN_SET(uid, ###CUSTOMERSLIST###)
                        markers {
                            CUSTOMERSLIST.field = tx_nmshowroom_customers
                        }
                    }


                    customersList = COA
                    customersList {

                        10 = HTML
                        10.value.field = name
                        10.value.typolink{
                                    parameter = {$plugin.tx_nmshowroom_pi1.pid.customersDetailView}
                                    additionalParams = &tx_nmshowroom_pi1[customeruid]={field:uid}
                                    additionalParams.insertData = 1
                        }

                        10.stdWrap {
                            wrap = <p class='list'>|</p>
                            required = 1
                        }

                    }

                    renderObj < .customersList
                    renderObj.stdWrap {
                            wrap = <div class='label'><p>Auftrag:</p></div><div>|</div>
                            required = 1
                    }       

                }

select也可以不返回任何值,这意味着没有找到记录。

在这种情况下,我想用文本或其他图像替换客户对象。

问题是,我不知道如何在“客户”上写条件:

customers.override.if.....根本不知道。

有人能帮助我吗?

非常感谢您提前。 的Davide

2 个答案:

答案 0 :(得分:2)

我会建议这个解决方案:

customers.stdWrap.ifEmpty = Sorry, there is no content here

如果您需要内容对象:

customers.stdWrap.ifEmpty.cObject = TEXT
customers.stdWrap.ifEmpty.cObject.value = Sorry, there is no content here

答案 1 :(得分:0)

customers = COA
customers {
  10 = CONTENT
  10 {
    table = tx_nmshowroom_customers
    select {
      pidInList = {$plugin.tx_nmshowroom_pi1.pid.showroomData}
      recursive = 10
      where = FIND_IN_SET(uid, ###CUSTOMERSLIST###)
      markers {
        CUSTOMERSLIST.field = tx_nmshowroom_customers
      }
    }

    renderObj = COA
    renderObj {
      10 = HTML
      10 {
        value.field = name
        value.typolink{
          parameter = {$plugin.tx_nmshowroom_pi1.pid.customersDetailView}
          additionalParams = &tx_nmshowroom_pi1[customeruid]={field:uid}
          additionalParams.insertData = 1
        }

        stdWrap {
          wrap = <p class='list'>|</p>
          required = 1
        }
      }

      wrap = <div class='label'><p>Auftrag:</p></div><div>|</div>
      required = 1
    }
  }

  20 = TEXT
  20 {
    if.isFalse.numRows < customers.10
    value = [substitute content]
  }
}