guave / flexiblecontent-bundle
Contao 4.13+ 的灵活内容元素
2.4.0
2024-06-10 16:10 UTC
Requires
- php: ^7.4 || ^8.0
- contao/core-bundle: ^4.13
- guave/visualradio-bundle: ^2.3
- symfony/config: ^5.4
- symfony/dependency-injection: ^5.4
- symfony/http-kernel: ^5.4
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.5
- contao/manager-plugin: ^2.0
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-latest
- symfony/phpunit-bridge: ^6.1
Conflicts
- contao/manager-plugin: <2.0 || >=3.0
README
此 Contao 模块添加了一个内容元素,允许您从不同的内容布局中进行选择。
要求
- Contao 4.13+
- PHP 7.4 或 8.0+
安装
$ composer require guave/flexiblecontent-bundle
用法
要更改显示的字段或添加新的字段,请将不带 ce_
的模板名称添加到您的 config.php
$GLOBALS['TL_FLEXIBLE_CONTENT']['templates'] = [ '2col-text', ];
然后,在您的 tl_content.php
中为您的模板添加一个新的子面板,只添加您希望作为内容添加的字段
$GLOBALS['TL_DCA']['tl_content']['subpalettes']['flexibleTemplate_2col-text'] = 'flexibleTitle,flexibleText,flexibleTextColumn';
在子面板的 flexibleTemplate_<template-name>
键中使用来自 $GLOBALS['TL_FLEXIBLE_CONTENT']['templates']
的您的模板名称