TYPO3:如何在后端中配置插件预览 [英] TYPO3: How to configure plugin preview in Backend
本文介绍了TYPO3:如何在后端中配置插件预览的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在后端,我想显示编辑器选择的插件的一些配置.就像在Powermail或新闻插件中一样.如何实现?
In the backend I want to display some configurations of the plugin the editor has selected. Like in powermail or news plugin. How can this be achieved?
推荐答案
您将应用与任何自定义元素的自定义预览:
-
或者您可以实现
tt_content_drawItem
钩子:$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['fluid_styled_slider'] = \Acme\Package\MyPreviewRenderer::class;
然后实现此钩子:
namespace Acme\Package; use TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface; class MyPreviewRenderer implements PageLayoutViewDrawItemHookInterface { /** * ... */ public function preProcess(PageLayoutView &$parentObject, &$drawItem, &$headerContent, &$itemContent, array &$row) { // 1. Check $row['CType'] for your content element and $row['list_type'] for your plugin in case of "list" // 2. Fill $itemContent with your preview // 3. Set $drawItem = false; to prevent rendering of the default preview } }
这篇关于TYPO3:如何在后端中配置插件预览的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文