简体   繁体   中英

TYPO3 TypoScript CONTENT with languageField

Is "languageField" only available for tt_content or pages table?

I want to use the CONTENT object on an own extension table:

renderObj = CONTENT
renderObj {

    table = tx_myext_domain_model_table

    select {    
        pidInList = 28
        languageField = sys_language_uid
    }

    renderObj = COA
    renderObj {
        10 = TEXT
        10.field = description_short
    }
}

But the translation not working. I tooked the TCA-, and SQL-settings from the tt_content. Also defined SQL-keys:

PRIMARY KEY (uid),
KEY t3ver_oid (t3ver_oid,t3ver_wsid),
KEY parent (pid,sorting),
KEY language (l18n_parent,sys_language_uid)

Can this be a bug like here described http://forge.typo3.org/issues/22406 ?

edited

In the file typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php line 7578 (TYPO3 6.1.7) you will find these lines:

        if ($GLOBALS['TSFE']->sys_language_contentOL && $GLOBALS['TCA'][$table] && $GLOBALS['TCA'][$table]['ctrl']['languageField'] && $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']) {
            // Sys language content is set to zero/-1 - and it is expected that whatever routine processes the output will
            // OVERLAY the records with localized versions!
            $sys_language_content = '0,-1';
        } else {
            $sys_language_content = intval($GLOBALS['TSFE']->sys_language_content);
        }
        $query .= ' AND ' . $conf['languageField'] . ' IN (' . $sys_language_content . ')';

And $GLOBALS['TSFE']->sys_language_contentOL will be 1 . So there will be no translation.

This is the config:

config {
  sys_language_uid = 1
  sys_language_mode = content_fallback; 0
  sys_language_overlay = 1
}

With this config I expect a translation…

I feel like a newbie. Page translation layer/record was missing !!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM