简体   繁体   English

TYPO3 9.5.x 与新闻 7.2.x:自定义属性

[英]TYPO3 9.5.x with news 7.2.x: Custom properties

I've extended TYPO3 9.5.x with news extension 7.2.x with some custom properties.我已经使用带有一些自定义属性的新闻扩展 7.2.x 扩展了 TYPO3 9.5.x。

I used the manual I found here .我使用了我在这里找到的手册。

In general, everything works, but somehow the custom properties I created seem to be blank at the frontend.一般来说,一切正常,但不知何故,我创建的自定义属性在前端似乎是空白的。 After clearing the cache, everything works again, but after some time the same issue appears again.清除缓存后,一切正常,但一段时间后再次出现相同的问题。

What am I doing wrong?我究竟做错了什么? Maybe it has something to do that I'm working with TYPO3 9.5.x and the manual is written for TYPO3 7.6.x?也许它与我正在使用 TYPO3 9.5.x 和手册是为 TYPO3 7.6.x 编写的有关吗?

Thanks for your help!谢谢你的帮助!

move your TCA modifying code (from ext_tables) to /typo3conf/ext/yourEXT/Configuration/TCA/Overrides/tx_news_domain_model_news.php将您的 TCA 修改代码(从 ext_tables)移动到 /typo3conf/ext/yourEXT/Configuration/TCA/Overrides/tx_news_domain_model_news.php

something like this:像这样的东西:

defined('TYPO3_MODE') or die();

( function( &$tca) {

    $tempColumns = array(
        'NEW_FIELD' => array(
           'exclude' => 0,
           'label' => 'LLL:EXT:yourEXT/Resources/Private/Language/locallang_be.xlf:tx_newsextend_domain_model_news.NEW_FIELD',
           'config' => array(
              'type' => 'check',
              'default' => 0
           ),
        ),
     );

     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
        'tx_news_domain_model_news',
        $tempColumns
     );

     \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes("tx_news_domain_model_news", 'NEW_FIELD', '', 'after:title');

})( $GLOBALS['TCA']['tx_news_domain_model_news']);

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

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