[TYPO3-ttnews] Re: tt_news: Condition based on category in single view

Florian Seirer florian.seirer at tirol.gv.at
Thu Jul 18 17:59:22 CEST 2013


At the moment I am also considering a different approach without categories:

Override the default values if a certain field is not empty.
In my case this would have the same outcome.

(A little background: If the tt_news record has a youtube URL in the custom field tx_fsvideo_youtube_url, then the image gallery is not necessary on the SINGLE view, and the image is only used in LIST views)

My TS so far, which doesn't actually work: 

plugin.tt_news {
  firstImageIsPreview = 0
  firstImageIsPreview.override = 1
  firstImageIsPreview.override.if.isTrue.cObject = CONTENT
  firstImageIsPreview.override.if.isTrue.cObject {
    table = tt_news
    select.pidInList = 38616
    select.andWhere.dataWrap = uid={GP:tx_ttnews|tt_news}
    renderObj = TEXT
    renderObj.field = tx_fsvideo_youtube_url
  }
  forceFirstImageIsPreview = 0
  forceFirstImageIsPreview.override = 1
  forceFirstImageIsPreview.override.if.isTrue.cObject = CONTENT
  forceFirstImageIsPreview.override.if.isTrue.cObject {
    table = tt_news
    select.pidInList = 38616
    select.andWhere.dataWrap = uid={GP:tx_ttnews|tt_news}
    renderObj = TEXT
    renderObj.field = tx_fsvideo_youtube_url
  }
}

For testing purposes, if I only use the CONTENT from above I get the URL from the field:

lib.test = CONTENT
lib.test {
 table = tt_news
 select.pidInList = 38616
 select.andWhere.dataWrap = uid={GP:tx_ttnews|tt_news}
 renderObj = TEXT
 renderObj.field = tx_fsvideo_youtube_url
}

Does anyone know what's wrong here?


More information about the TYPO3-project-tt-news mailing list