CType在下拉菜单中未显示,TYPO3版本11.5.23。

huangapple go评论40阅读模式
英文:

CType not showing up in dropdown, TYPO3 version 11.5.23

问题

我尝试创建我的扩展。该扩展名为"personal",因此我在CType中使用了"personal_"前缀。

TYPO3的版本为11.5.23。

对于下拉选项,我认为唯一需要做的是创建"tt_content.php"。

我尝试了这个指南:
https://docs.typo3.org/m/typo3/reference-coreapi/11.5/en-us/ApiOverview/ContentElements/AddingYourOwnContentElements.html

Configuration/TCA/Overrides/tt_content.php

  // 将内容元素添加到"CType"下拉列表
  \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
      'tt_content',
      'CType',
      [
          'Titel',
          'personal_titel',
          'content-text',
      ],
      'textmedia',
      'after'
  );

但当我从向导中选择它时,CType显示为未知。
CType在下拉菜单中未显示,TYPO3版本11.5.23。

英文:

I try to create my extension. The extension is called personal. So I use the personal_ prefix for the CType.

TYPO3 has version 11.5.23

For the dropdown, I think the only thing I have to do is to create the tt_content.php

I tried this guide:
https://docs.typo3.org/m/typo3/reference-coreapi/11.5/en-us/ApiOverview/ContentElements/AddingYourOwnContentElements.html

Configuration/TCA/Overrides/tt_content.php

  // Add the content element to the "Type" dropdown
  \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
      'tt_content',
      'CType',
      [
          'Titel',
          'personal_titel',
          'content-text',
      ],
      'textmedia',
      'after'
  );

But when I choose it from the wizard, the CType is unknown.
CType在下拉菜单中未显示,TYPO3版本11.5.23。

答案1

得分: 0

在我限制了内容列的允许CE(也许您使用grielements或其他东西)后,曾经出现过这种行为。

我不得不在内容列配置中明确允许我的CE,并在清除缓存后才能正常工作。也许这对您的情况有帮助?

英文:

Had that behaviour once i had limited the allowed CEs of the content column (maybe you use grielements or sth elese).

I had to explicitly allow my CE in the content column config and after clearing the cache it worked. Maybe it helps in your case, too?

答案2

得分: 0

问题是根本性的。我认为这就是为什么没有人能给我一个解决方案的原因。

只需在文件开头添加 <?php 就解决了这个问题 CType在下拉菜单中未显示,TYPO3版本11.5.23。

英文:

The problem was fundamental. I think that is why nobody could give me a solution.

Just putting <?php at the head of the file solved the problem CType在下拉菜单中未显示,TYPO3版本11.5.23。

huangapple
  • 本文由 发表于 2023年2月9日 01:05:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/75389253.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定