[TYPO3] tt_news in multilang-site with 'local' news

Martin Kästner mkaestner at gmx.de
Sun Jan 29 22:41:33 CET 2006


Hi,

in multilanguage-sites it could simpler for an author if he could a news
in an alternative language without having first add an entry in the
master language. You could use an news-entry with language='all', but
then the news would show up in all languages and not only in one
alternative language.

So I patched the tt_news-Plugin with the following:
(tt_news version 2.2.24)
in function getSelectConf() add in the first if-statement an elseif:


} elseif ($this->sys_language_mode == 'showLocalNews') {
    // sys_language_mode == 'showLocalNews': If a certain language is
requested, select only news-records which exists in this language.
    // first select all translated news
    $tmpres = $this->cObj->exec_getQuery('tt_news', array('selectFields'
=> 'tt_news.l18n_parent', 'where' => 'tt_news.sys_language_uid =
'.$GLOBALS['TSFE']->sys_language_content.' AND tt_news.l18n_parent!=0
'.$this->enableFields, 'pidInList' => $this->pid_list));
    $strictUids = array();
    while ($tmprow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($tmpres)) {
        $strictUids[] = $tmprow['l18n_parent'];
    }
    $strStrictUids = implode(',', $strictUids);
    // select all (1) translated news (2) all-lang-news and (3) local-news
    $selectConf['where'] .= ' AND (tt_news.uid IN (' .
($strStrictUids?$strStrictUids:0) . ') OR tt_news.sys_language_uid=-1 OR
(tt_news.sys_language_uid='.$GLOBALS['TSFE']->sys_language_content.' AND
tt_news.l18n_parent=0))';


Perhaps someone might use it or include this new sys_language_mode in
next tt_news-version or would make an extention for tt_news from it. I
don't know how this could be made in an secure way which allow updating
tt_news.

The only problem left is, that you can not use the "localization view"
in web>list and that you can not translate the news later in the master
language without copy&paste the news. Is it possible to change the
localization view so you can translate news/content elements from every
language in the system?


bye
Martin



More information about the TYPO3-english mailing list