This contao module adds a Content Element that allows you to choose from different content layouts.
- Contao 4.13+
- PHP 7.4 or 8.0+
$ composer require guave/flexiblecontent-bundle
To change which fields are shown or add a new one, add the template name without ce_
into your config.php
:
$GLOBALS['TL_FLEXIBLE_CONTENT']['templates'] = [
'2col-text',
];
then add a new subpalette for your template in your tl_content.php
, only with the fields you would like to add as your
content:
$GLOBALS['TL_DCA']['tl_content']['subpalettes']['flexibleTemplate_2col-text'] = 'flexibleTitle,flexibleText,flexibleTextColumn';
using the name of your template from $GLOBALS['TL_FLEXIBLE_CONTENT']['templates']
in the
subpalette's flexibleTemplate_<template-name>
key