kitzberger/dragon-drop 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kitzberger/dragon-drop

Composer 安装命令:

composer require kitzberger/dragon-drop

包简介

ViewHelper to add 'copy-paste' to EXT:mask containers in the page module

关键字:

README 文档

README

This extension provides fluid viewhelpers to add copy/paste functionality to EXT:mask backend templates.

CopyRecord/CutRecord ViewHelper

These two viewhelpers can be used within backend templates to provide "copy CE" and "cut CE" links:

<html data-namespace-typo3-fluid="true"
      xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
      xmlns:dnd="http://typo3.org/ns/Kitzberger/DragonDrop/ViewHelpers">

<div class="mask-element">
    <dnd:be.copyRecord uid="{row.uid}" />
    <dnd:be.cutRecord uid="{row.uid}" />
    <h4>{row.header}</h4>
</div>

PasteLink ViewHelper

This viewhelper can be used within backend templates to provide a paste link for "clipped" CEs within container elements.

<html data-namespace-typo3-fluid="true"
      xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
      xmlns:dnd="http://typo3.org/ns/Kitzberger/DragonDrop/ViewHelpers">

<div class="mask-accordion">
    <dnd:be.pasteLink target="{row}"
                      override="{colPos:999, tx_mask_accordion_items_parent: row.uid}" />

    <ul>
        <f:for each="{data.tx_mask_accordion_items}" as="item">
            <li>
                {item.header} (id={item.uid})
            </li>
        </f:for>
    </ul>
</div>

This'll render an extra paste button into the accordion element:

page module

These are the attributes

  • target which needs to be set to a array representing the target record. Currently only the array key pid is being used internally.
  • override which contains the field modifications the newly created record will be updated with. For EXT:mask containers that's at least colPos=999 and the "parent field".

This extension comes with a DataHandler hook that updates the "children count" field of the container after attaching the copied CE to it. The name of said "children count" will be derived from TCA.

Compatibility with EXT:mask

In order to make this work with EXT:mask you need to make sure that the "parent field" is present in TCA. Please check the configuration module in the backend.

If it's not present (yet) you need to provide it yourself, see github.com/Gernott/mask/issues/389 for details.

Prevent hidden records

In case you don't want the paste record to be hidden, you can override the hidden property with 0 via the override attribute, e.g.

<dnd:be.pasteLink target="{row}"
                  override="{colPos:999, tx_mask_accordion_items_parent: row.uid, hidden:0}" />

Allowed CTypes

To prevent certain CTypes to be pasted into your mask element you can specify the allowed attribute:

<dnd:be.pasteLink target="{row}"
                  override="{colPos:999, tx_mask_accordion_items_parent: row.uid}"
                  allowed="textmedia,mask_elementX" />

Customize button text

In case you don't want the button text to be that paste icon, you can set a different button text:

<dnd:be.pasteLink target="{row}" ...>
    Paste here
</dnd:be.pasteLink>

统计信息

  • 总下载量: 3.85k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2021-03-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固