英文:
CType not showing up in dropdown, TYPO3 version 11.5.23
问题
我尝试创建我的扩展。该扩展名为"personal",因此我在CType中使用了"personal_"前缀。
TYPO3的版本为11.5.23。
对于下拉选项,我认为唯一需要做的是创建"tt_content.php"。
Configuration/TCA/Overrides/tt_content.php
// 将内容元素添加到"CType"下拉列表
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
'tt_content',
'CType',
[
'Titel',
'personal_titel',
'content-text',
],
'textmedia',
'after'
);
英文:
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'
);
答案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
就解决了这个问题
英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论