【问题标题】:TYPO3 v7.6 - How to render a tt_content on backend (Page Module)TYPO3 v7.6 - 如何在后端呈现 tt_content(页面模块)
【发布时间】: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


    【解决方案1】:

    您现在需要做的就是将&lt;flux:widget.grid /&gt; 放入预览部分。

    这是我的 2column 内容元素的代码(在后端可见,包括拖放):

    {namespace flux=FluidTYPO3\Flux\ViewHelpers}
    
        <f:layout name="Content" />
    
        <f:section name="Configuration">
            <flux:form id="2column" label="2 Columns" options="{icon: 'Icons/Content/Example.gif', group: 'MyGroup'}">
            </flux:form>
            <flux:grid>
                <flux:grid.row>
                    <flux:grid.column colPos="0" label="Column 1" style="width: 50%" name="column1" />
                    <flux:grid.column colPos="1" label="Column 2" style="width: 50%" name="column2" />
                </flux:grid.row>
            </flux:grid>
        </f:section>
    
        <f:section name="Preview">
            <flux:widget.grid />
        </f:section>
    
        <f:section name="Main">
            <div class="twocolumn1">
                <flux:content.render area="column1" />
            </div>
            <div class="twocolumn2">
                <flux:content.render area="column2" />  
            </div>
            <div class="clear"></div>
        </f:section>
    

    【讨论】:

      【解决方案2】:

      扩展 Gridelements 允许您在其他内容元素中创建内容元素(很像 TemplaVoilà 所做的)。我还没有尝试过它是否允许您将内容元素拖到其他人中,但如果它也涵盖了这一点,我不会感到惊讶。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-05-11
        • 2010-09-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多