[TYPO3-english] use tt_news if no content element

Michael Christensen michael at stenskjaer.dk
Thu Nov 27 17:16:28 CET 2008


JoH asenau skrev:
>> It doesn't work. I imports the tt_news regardsless of whether there is
>> any content or not.
>> But it works with text, like this:
>>
>> 10 = RECORDS
>> 10.source.current=1
>> 10.tables = tt_content
>> 10.wrap = <!--TYPO3SEARCH_begin--> | <!--TYPO3SEARCH_end-->
>> 20 = TEXT
>> 20.value = HELLO WORLD!
>> 20.ifEmpty.current = 1
> 
> Of course it does, since you don't need any "if" here because tt_content 
> doesn't render anyway if there are no content elements.
> tt_news won't because there always will be some news.
> 
> What you want should be done the other way around:
> First create the fallback (tt_news) and then override it with the records.
> 
> 10 = COA
> 10 {
>     10 < plugin.tt_news
>     stdWrap.override.cObject = RECORDS
>     stdWrap.override.cObject {
>         source.current = 1
>         tables = tt_content
>         stdWrap.required = 1
>         stdWrap.wrap = <!--TYPO3SEARCH_begin--> | <!--TYPO3SEARCH_end-->
>     }
> }
> 
> stdWrap will work with RECORDS at least with 4.2.3 although not mentioned in 
> TSref.
> 
> HTH
> 
> Joey
> 

Okay. But how do I make a location in the template TS object path AND 
Content Element as eType at the same time? Do you understand? It want it 
to be possible to use the TV page module to insert content, but if 
nothing is inserted, it's gonna take the latest news record..

Kind regards
Michael


More information about the TYPO3-english mailing list