guave/flexiblecontent-bundle

Flexible Content Element for Contao 4.13+

2.3.0 2024-04-08 13:17 UTC

This package is auto-updated.

Last update: 2024-04-08 13:18:33 UTC


README

This contao module adds a Content Element that allows you to choose from different content layouts.

Requirements

  • Contao 4.13+
  • PHP 7.4 or 8.0+

Install

$ composer require guave/flexiblecontent-bundle

Usage

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