【问题标题】:Typo3 7.6 Add custom class to Heading-Element in RTETypo3 7.6 将自定义类添加到 RTE 中的 Heading-Element
【发布时间】:2023-03-21 09:27:02
【问题描述】:

我尝试为标题添加一个新类 (headline-red),尤其是为 h5 元素。我正在使用以下 TS 设置:

RTE >

RTE {
    classes {
        headline-red {
            name = Heading Rot
        }
    }

    default {
        contentCSS = /typo3conf/ext/test/Resources/Public/rte.css
        useCSS = 1
        showTagFreeClasses = 1

        buttons {
            textstyle {
                tags {
                    h5 {
                        allowedClasses(
                            headline-red
                        )
                    }
                }
            }
        }

        proc {
            allowedClasses(
                headline-red
            )
        }
    }
}

我的 rte.css 只包含这个小测试件:

h5.headline-red {
    color: #c1002a;
}

但这不会改变 RTE 编辑器。我错过了什么吗?

【问题讨论】:

    标签: css typo3 rte typo3-7.x


    【解决方案1】:

    您使用打字稿添加客户标题标签。

    转到页面>>根>>编辑(页面)>>资源和以下排版

    TCEFORM.tt_content.header_layout {
        addItems {
            10 = Advance Header
        }
    }
    

    将您的标头包装在 TS 下方。

    lib.stdheader.10.10 >
    lib.stdheader.10.10 = COA
    lib.stdheader.10.10 {
       wrap = <div class="page-header"> | </div>
       20 = TEXT
       20.current = 1
       20.insertData = 1
       20.fontTag = <span class="h1" > &nbsp;|</span>
    }
    

    您将获得以下输出。

    【讨论】:

    • 嗯,这对我不起作用。此外,我只想将课程添加到RTE Editor
    【解决方案2】:

    我使用相同的解决方案,而且效果很好。

    在 TS 配置中:

    RTE.classes.h2-bis.name = H2 alternatif 
    RTE.default.contentCSS = typo3conf/ext/ps_template/res/ressources/css/rte.css
    

    在 Rte.css 中

    h2.h2-bis{color: #ff0000;}
    

    经过一些测试,我认为问题只是您的 css 路径中的“斜线”。尝试不使用它。

    再见

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-14
      相关资源
      最近更新 更多