m12/neos-utils

Neos 工具库

安装量: 2,219

依赖者: 2

建议者: 0

安全性: 0

星标: 3

关注者: 4

分支: 5

公开问题: 0

类型:typo3-flow-plugin

0.2.0 2015-02-19 18:48 UTC

This package is not auto-updated.

Last update: 2024-09-14 16:03:14 UTC


README

其他 M12.* Neos 插件使用的额外辅助器/库。

M12.Utils:WrapRemover

移除额外的 DIV 包装器 - 根据定义,Neos 后端(包括围绕内容集合或任何其他节点类型的那些)需要,但在前端(实时)工作区中并不是必需的。

此辅助器仅在找到确切的 <div class="[wrapperClass]">[内容]</div> 时才工作 - 如果添加了额外的属性或类,它将不会运行。此外,如果您更改了 Neos 节点类型的默认类(在 attributes.class.@process.nodeType 中定义,用于 TYPO3.Neos:Content),则必须相应地调整 .wrapperClass

示例用法

要移除包装器 <div class="neos-contentcollection">...</div>,添加到您的 TypoScript 中

prototype(TYPO3.Neos:ContentCollection) {
	@process.wrapRemover = M12.Utils:WrapRemover
	@process.wrapRemover.wrapperClass = 'neos-contentcollection'
}

要移除围绕文本元素(例如 <div class="typo3-neos-nodetypes-text">...</div>)的包装器,添加到您的 TypoScript 中

prototype(TYPO3.Neos.NodeTypes:Text) {
	@process.wrapRemover = M12.Utils:WrapRemover
	@process.wrapRemover.wrapperClass = 'typo3-neos-nodetypes-text'
}

安装

它被定义为 typo3-flow-plugin,因此需要放置在 /Packages/Plugins/ 目录中。通过手动将此存储库克隆到那里或将其添加为网站包的依赖项来完成此操作。

composer.json

    "repositories": [
        { "type": "git", "url": "https://github.com/million12/M12.Utils.git" }
    ],
    "require": {
        "your/dependencies": "*",
        "m12/utils": "*"
    },

然后运行 composer update。