简体   繁体   English

TYPO3 TypoScript内容与languageField

[英]TYPO3 TypoScript CONTENT with languageField

Is "languageField" only available for tt_content or pages table? “ languageField”仅适用于tt_content或pages表吗?

I want to use the CONTENT object on an own extension table: 我想在自己的扩展表上使用CONTENT对象:

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. 我从tt_content中获取了TCA和SQL设置。 Also defined SQL-keys: 还定义了SQL键:

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 ? 这可能是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: 在文件typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php第7578行(TYPO3 6.1.7)中,您会找到以下typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php行:

        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 . $GLOBALS['TSFE']->sys_language_contentOL将为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 !!! 页面翻译层/记录丢失!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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