英文:
TYPO3 v10 - Why is custom CE CType not shown in Backend pageview?
问题
我在TYPO3 v10安装中有一个自定义内容元素。它运行得很好,除了一件事。
在创建TYPO3标准内容元素时,在后端的页面视图中,其类型显示在标题上方。在我的内容元素中,只有标题显示,而没有类型。
希望类型显示在标题上方,就像截图中显示的“文本和媒体元素”标签一样。我该如何实现?
在这个截图上最清楚:
我已经查阅了文档,但没有找到解决方案。
额外信息:起初,我遇到的问题是,此视图中的图标始终是默认的ce-text图标,即使我配置了核心图标的“content-map”图标。
我通过将以下内容添加到EXT:my_ext/Configuration/TCA/Overrides/tt_content.php
来解决:
$GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['my_ext_map'] = 'content-map';
也许这有关系?
英文:
I have a custom content element in a TYPO3 v10 installation.
It works just fine - except one thing.
When creating a TYPO3 standard content element it's type is shown above the headline in pageview in backend. In my content element only the headline is shown - but not the type.
It would be nice to have the type shown above the header. Like the "Text & Media Element" label as shown in the screenshot. How can I achieve that?
It's best seen on this screenshot:
I already looked up the documentation, but didn't find a solution.
Additional info: first I had the problem that the icon in this view was always the default ce-text one, although I configured the "content-map" one from the core icons.
I could fix that by adding $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['my_ext_map'] = 'content-map';
to
EXT:my_ext/Configuration/TCA/Overrides/tt_content.php
Maybe that relates?
答案1
得分: 1
根据我所知,TYPO3 v10 的默认功能不包括在后端预览中显示 CType,就像您的截图中所示。我们维护了很多实例,但我找不到一个像您所示的那样显示 CType 的实例。
您在TYPO3实例中安装了哪些扩展?也许有一个扩展添加了自定义后端预览?
您可以在配置模块中检查这一点。进入 $GLOBALS['TCA']
然后 tt_content
=> ctrl
=> previewRenderer
。
如果您没有配置模块,您需要安装系统扩展 "lowlevel"。
从编辑的角度来看,对于编辑来说,在预览中以文本形式看到 CType 是否真的增加了价值?对我来说,这会使预览显得过于混乱。CType 也可以通过图标来确定,就像您提到的那样。如果编辑确实需要知道 CType,只需编辑该元素即可。
英文:
As far as I know it's not a default feature of TYPO3 v10 to show the CType in the backend preview as shown in your screenshots. We maintain a lot of instances and I can't find one which shows the CType like you.
What extensions do you have installed in your TYPO3 instance? Maybe there is an extension which adds a Custom Backend Preview?
You can check that in the Configuration Module. Got to $GLOBALS['TCA']
and then tt_content
=> ctrl
=> previewRenderer
.
If you don't have the configuration module you need to install the system extension "lowlevel".
From an editors point of view: it is really an added value for the editor to see the CType as text in the preview? For me it clutters the preview too much. The CType can be determined by the icon as you mentioned as well. And if an Editor really needs to know the CType, simply edit that element.
答案2
得分: 1
这可以通过上述“配置内容元素的自定义后端预览”第二部分中描述的挂钩轻松完成。我几乎在所有自己的内容元素中都使用这个。
我以与你相同的方式添加图标,只是用自定义图标。不应该有任何干扰。
英文:
This can easily be done via a hook which is described in the second part „With "Classic" Page Module“ of the above mentioned „Configure Custom Backend Preview for Content Element“. I'm using this with nearly all of my own content elements.
I'm adding the icon the same way as you, but with a custom icon. There should be no interference.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论