markocupic / contao-article-class-select-bundle
Contao 4 Article Class Select Bundle
Installs: 715
Dependents: 2
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 1
Open Issues: 1
Type:contao-module
Requires
- php: ^8.0
- contao/core-bundle: ^4.13 || ^5.0
Requires (Dev)
- contao/manager-plugin: ^2.3.1
README
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
Frontend
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'
- 'container p-0'
- 'container px-0'
- 'container py-0'
- 'container-fluid'
- 'container-fluid p-0 m-0'
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',
];