lumturo-net / article-properties-bundle
Contao4的文章配置包
1.1
2022-05-02 08:47 UTC
Requires
- php: ^8.0
- contao/core-bundle: 4.9.*
- symfony/framework-bundle: ^4.2
Requires (Dev)
- contao/manager-plugin: ^2.11
- doctrine/doctrine-cache-bundle: ^1.3
- friendsofphp/php-cs-fixer: ^2.12
- php-http/guzzle6-adapter: ^1.1
- php-http/message-factory: ^1.0.2
- phpunit/phpunit: ^5.7.26
- symfony/phpunit-bridge: ^3.2
Conflicts
- contao/core: *
- contao/manager-plugin: <2.0 || >=3.0
README
此扩展包增加了文章配置功能。对于每个文章,可以定义以下内容:
- 容器(固定,流动,缩进)
- 内间距(正常,无)
- 背景颜色
- 背景图片
- 填充方法(内部,填充,全屏)
- 文字颜色(浅色,深色)
这些定义将作为CSS类在文章模板内部输出。然后可以使用自定义CSS进一步定义。
安装
composer require lumturo-net/article-properties-bundle
之后,需要调用Contao安装工具,在https://example.com/contao/install
上创建额外的数据库字段。
自定义包配置
输出的CSS类可以被覆盖或任意扩展。为了做到这一点,需要在config/
目录下创建一个名为config.yml
的文件。在那里,可以像以下这样覆盖或扩展包配置:
parameters: article.paddings: section-padding-normal: Normal section-padding-none: Keiner article.containers: container: Fixed container-fluid: Fluid container-indent: Eingerückt article.background-colors: bg-color-white: Weiß bg-color-black: Schwarz bg-color-red: Rot article.background-sizes: bg-image-contain: Innen bg-image-cover: Ausgefüllt bg-image-full: Vollflächig article.background-positions: bg-image-center: Zentriert article.text-colors: text-bright: Hell text-dark: Dunkel
第一个值(例如,container-fluid
)确定CSS类。
第二个值(例如,Fixed
)确定在管理界面下拉菜单中显示的值。
可以在相应的部分下添加新的CSS类。例如。
article.background-colors: bg-color-yellow: Gelb