markocupic/contao-article-class-select-bundle

Contao 4 Article Class Select Bundle

2.2.4 2023-12-30 23:39 UTC

This package is auto-updated.

Last update: 2024-03-30 00:23:34 UTC


README

Marko Cupic

Contao Article Class Select Bundle

With this extension for Contao 4 you can inject two more classes in the article settings of the contao backend.

The extension comes with a customized article template, in which an additional DIV element has been built in to use the Bootstrap container classes.

Inject a container- and a background CSS class

Alt text

Frontend

Alt text

Configuration

To replace the preconfigured classes with your own classes, you have two options.

The modern way:

# Inside your config/config.yaml you write:

markocupic_article_class_select:
  container_class:
    - container-sm
    - container-lg
    - container-fluid

  background_class:
    - white-background
    - gray-background
    - my-dark-background

In a more classic way:

<?php

// Inside your contao/dca/tl_article.php you write:

$GLOBALS['TL_DCA']['tl_article']['fields']['containerClass']['options'] = [
    'container-sm',
    'container-lg',
    'container-fluid',
];

$GLOBALS['TL_DCA']['tl_article']['fields']['backgroundClass']['options'] = [
    'white-background',
    'gray-background',
    'dark-background',
];