【发布时间】:2016-06-01 11:43:37
【问题描述】:
我正在开发一个 TYPO3 v7.6 项目,并创建了一个带有 flexform 的内容元素,其中包含一个 group 类型字段,允许其他 tt_content。这是该字段的配置:
<config type="array">
<type>group</type>
<internal_type>db</internal_type>
<allowed>tt_content</allowed>
<size>5</size>
<maxitems>200</maxitems>
<minitems>0</minitems>
<multiple>1</multiple>
<show_thumbs>1</show_thumbs>
</config>
flexform 工作正常,我可以在编辑时添加内容。但是,我需要的是允许用户将同一页面上的内容移动(拖放)到该字段内,就像在以前的版本中使用 TemplaVoila 时一样。
我为 tt_content_drawItem 创建了一个钩子,它实现了 PageLayoutViewDrawItemHookInterface 接口,并且我能够为我的插件更改 preProcess 函数,但我不知道如何创建一个带有“创建新内容元素”的放置区域,该区域允许将 tt_content 移入其中。
看起来处理此问题的原始 TYPO3 的 DragDrop.js 文件无法移动到内容元素中,而只能移动到页面中。是这样吗?
是否有实现此功能的方法,或任何允许此功能的扩展?
编辑
经过几天的研究并尝试了一些扩展,我可以找到适合我需求的解决方案。我正在使用扩展 fluidcontent 来创建具有以下流体模板的内容元素:
{namespace flux=FluidTYPO3\Flux\ViewHelpers}
<f:layout name="Default" />
<f:section name="Configuration">
<flux:grid>
<flux:grid.row >
<flux:grid.column name="content" label="Content"/>
</flux:grid.row>
</flux:grid>
</flux:form>
</f:section>
<f:section name="Preview">
</f:section>
<f:section name="Main">
<flux:content.render area="content" />
</f:section>
但是,对于包含内容区域的 flexform 字段,我仍然无法在后端拖放甚至可视化内容。
【问题讨论】:
标签: typo3 typo3-7.6.x