guave/flexiblecontent-bundle

Contao 4.13+ 的灵活内容元素

安装数: 1,056

依赖项: 0

建议者: 0

安全: 0

星星: 0

关注者: 6

分支: 0

类型:contao-bundle

2.4.0 2024-06-10 16:10 UTC

This package is auto-updated.

Last update: 2024-09-11 15:24:06 UTC


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'] 的您的模板名称