使用 Bootstrap_package 为 Typo3 中的内容元素添加多个额外的预定义背景颜色

Add multiple additional predefined background colours for content elements in Typo3 with Bootstrap_package

我尝试根据 bootstrap_package

的说明添加新的预定义背景颜色

https://github.com/benjaminkott/bootstrap_package/wiki/Add-additional-Background-Colors-to-Content-Elements

它只使用一种额外的颜色就可以正常工作,将指令中的代码添加到 PageTsConfig 和 TypoScript 常量(SCSS 片段似乎不是必需的)。 但是,我无法让它使用多种颜色。 pageTsConfig 部分似乎有效(我在后端编辑器中看到所有新颜色作为选项)。

TCEFORM {
    tt_content {
        background_color_class {
            addItems {
                red = Red
                white = White
                hblau = Herth-Blau
            }
        }
    }
}

但是 CSS 中的更改(通过扩展的常量)不起作用。 我在那里试过这段代码:

plugin.bootstrap_package.settings.scss {
    frame-backgrounds = ( hblau:(background: #0092d0, link-color: #e0efff, link-hover-color: #ffffff),
                          white:(background: #ffffff, link-color: #e0efff, link-hover-color: #ffffff),
                          red:(background: #ff0000, link-color: #ffeeee, link-hover-color: #ffffff)
     )
} 

还有其他人知道我做错了什么吗?

非常感谢任何帮助。

亲切的问候 克里斯

当您编写 TypoScript 代码时,您正在使用赋值运算符“=”并且您必须在同一行中写入所有值;我将从 official documentation

中借用一些台词

Value assignment: The “=” operator

This simply assigns a value to an object path.

Rules:

Everything after the = sign and up to the end of the line is considered to be the value. > In other words: You don’t need to quote anything!

Be aware that the value will be trimmed, which means stripped of whitespace at both ends

示例:

myObject.myProperty = value 2

如果要使用多行值,则必须使用 "()" 运算符并编写

  • 左括号在对象的同一行
  • 在新行(或多行)上分配的值
  • 和新行的右括号

Multi-line values: The ( ) signs Opening and closing parenthesis are used to assign a multi-line value . With this method you can define values which span several lines and thus include line breaks.

Important

You cannot use multi-line values in constants. They are only available in the setup part of TypoScript.

示例

myObject = TEXT
myObject.value (
   <p class="warning">
     This is HTML code.
   </p>
)