Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
631 views
in Technique[技术] by (71.8m points)

translation - TYPO3 news - show "single latest news" in all languages

Behavior

On a page with a SingleNewsView I added TS for "Latest news" fallback, that works like expected in default Language, but not for translated content. Instead of news there is this shown "The news record is not available anymore."

This only happens if the latest default news doesent have a translation for that language, what I want is that if the news doesent have a translation it the latest news that HAS a translation is used instead. Anyone an idea ?

Environment

  • TYPO3 version: 10.4.7
  • Extension: "tx_news/news": 8.4.0 (already tested newest Version(8.5.2) in ext.Repo)
  • Composer Mode: no

Example in this example only News3 would work in all languages, but when "News 4" was added the latest news in EN would still be "News 3" but it trys to load "News 4" instead.

 News        | Language       
 ----------- | -------------- 
 News4       | Default- DE    
   News4     | Lang1 - CN    
 News3       | Default- DE    
   News3     | Lang1 - EN     
   News3     | Lang2 - CN     
   News3     | Lang2 - PT      
 News2       | Default- DE    
 News1       | Default- DE    

Typoscript:

#Seperate for the 3 Languages, each works like this one
[siteLanguage("languageId") == "2"]
plugin.tx_news.settings {
        overrideFlexformSettingsIfEmpty = singleNews,cropMaxCharacters,dateField,timeRestriction,orderBy,orderDirection,backPid,listPid,startingpoint
        useStdWrap = singleNews

        singleNews.stdWrap.cObject = CONTENT
        singleNews.stdWrap.cObject {
                table = tx_news_domain_model_news
                select {
                        max = 1
                        orderBy = datetime desc
                        pidInList = 134
                        sys_language_uid = 2
                        l10n_parent != 0
                }
                renderObj = TEXT
                renderObj.field = uid
        }
}
[global]
question from:https://stackoverflow.com/questions/65906778/typo3-news-show-single-latest-news-in-all-languages

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...