[TYPO3-english] use tt_news if no content element

JoH asenau info at cybercraft.de
Thu Nov 27 07:52:50 CET 2008


> 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

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
T3 cookbook (2nd edition): http://www.typo3experts.com
Jobs: http://www.professionals-only.com 




More information about the TYPO3-english mailing list