lumturo-net/article-properties-bundle

Contao4的文章配置包

1.1 2022-05-02 08:47 UTC

This package is auto-updated.

Last update: 2024-09-30 01:32:32 UTC


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