简体   繁体   English

TYPO3新闻部分数据库表

[英]TYPO3 News Section Database Tables

I am using News System extension to display all the news articles. 我正在使用新闻系统扩展来显示所有新闻文章。

I would like to know in which table in the database are these news articles stored ? 我想知道这些新闻文章存储在数据库的哪个表中? Can I add data directly into the backend MySQL tables for these news articles ? 我可以直接将数据添加到这些新闻文章的后端MySQL表中吗?

I actually tried adding data into 'news_domain_model_news' table in my database, but the changes are not reflecting. 我实际上尝试将数据添加到数据库中的“ news_domain_model_news”表中,但更改未反映出来。

tx_news_domain_model_news is the correct table, but adding the data there is not sufficient for TYPO3. tx_news_domain_model_news是正确的表,但是在其中添加数据不足以用于TY​​PO3。 You also need to add that data to the TCA (Table configuration array) and to the Database definition, and make EXT:news aware of the new field 您还需要将该数据添加到TCA (表配置数组)和数据库定义中,并使EXT:news知道新字段

The most simple way to do so is this: 最简单的方法是:

  1. Create a new Extension using the "extension_builder"-Extension (creates the mentioned entries in the TCA and the database definition files) 使用“ extension_builder” -Extension创建新的扩展(在TCA和数据库定义文件中创建提到的条目)
  2. Create a class "Tx__Domain_Model_News" in your new extension that contains the new fields and setters + getters for them (Use the naming conventions, otherwise it won't work!) 在您的新扩展中创建一个类“ Tx__Domain_Model_News”,其中包含新的字段以及它们的设置器和获取器(使用命名约定,否则将不起作用!)
  3. Add a file "Resources/Private/extend-news.txt" to your new extension, containing "Domain/Model/News" as its only content. 将文件“ Resources / Private / extend-news.txt”添加到您的新扩展名,其中仅包含“域/模型/新闻”。

That should be it. 应该是这样。 Here is a link to the extension manual, describing the process: 这是扩展手册的链接,描述了该过程:

http://docs.typo3.org/typo3cms/extensions/news/Main/Tutorial/ExtendingNews/Index.html http://docs.typo3.org/typo3cms/extensions/news/Main/Tutorial/ExtendingNews/Index.html

You can also edit the records directly in the database, but be aware that there are multiple caches in TYPO3 CMS. 您也可以直接在数据库中编辑记录,但要注意TYPO3 CMS中有多个缓存。

Therefore clear the caches after you finished editing the data. 因此,在完成数据编辑后,请清除缓存。

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

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