配置rte以启用我自己的链接类

时间:2017-03-06 15:22:44

标签: typo3 typo3-7.6.x rte

我有一个TYPO3安装配置,可以在RTE中为多种链接使用单独的样式。如果我手动使用这些样式(将它们插入"切换" -mode)一切都很好。但是尝试在链接向导中使用它们会导致混乱,因为某些样式可用,但某些样式不可用。

我的RTE-config,因为它包含在根页面中(仅使用链接类提取):

RTE {

    default {
        contentCSS.rte = EXT:my_site/Resources/Public/Css/rte.css

        allowedClasses := addToList(link-int,link-ext,link-mail,link-tel,link-mobile,link-file,link-no-icon)

        proc {
            allowTags = a, abbr, article, b, bdo, big, blockquote, br, caption, center, cite, code, div, em, footer, header, h2, h3, h4, h5, h6, hr, i, li, link, nav, ol, p, pre, section, small, span, strike, strong, sub, sup, table, thead, tbody, tfoot, td, th, tr, u, ul
        }
        showButtons = ...
        toolbarOrder = ...
        defaultContentLanguage = de
        buttons {
            textstyle {
                tags.a.allowedClasses := addtoList(link-int,link-ext,link-mail,link-tel,link-mobile,link-no-icon,link-file)
                showTagFreeClasses = 1
            }

            link.properties.class.allowedClasses := addToList(link-int,link-ext,link-mail,link-tel,link-mobile,link-no-icon,link-file)

}
        rteResize = 1
    }

    classes {

        link-int.name = interner Link
        link-ext.name = externer Link
        link-mail.name = Mail Link
        link-tel.name = Telefon Link
        link-mobile.name = Handy Link
        link-file.name = Datei Link
        link-no-icon.name = ohne Icon
        download.name = automatische download klasse?
        mail.name = automatische mail klasse?
    }

    proc {
        // Keep unknown tags
        dontRemoveUnknownTags_db = 1

        // Allow tables
        preserveTables = 1

        entryHTMLparser_db = 1
        entryHTMLparser_db {

            // Tags allowed
            allowTags < RTE.default.proc.allowTags

            // HTML special characters
            htmlSpecialChars = 0

            // Additionnal attributes for P & DIV
            tags.div.allowedAttribs = class,style,align
            tags.p.allowedAttribs = class,style,align

            // Keep non matched tags
            keepNonMatchedTags = protect
        }

        // Exit HTML parser
        exitHTMLparser_db = 1
        exitHTMLparser_db {
            // Keep non matched tags
            keepNonMatchedTags = 1

            // HTML special character
            htmlSpecialChars = 0
        }
    }
    classesAnchor {
        // in case of old styles: 
        externalLink {
            class = link-ext
        }
        externalLinkInNewWindow {
            class = link-ext
        }
        internalLink {
            class = link-int
        }
        internalLinkInNewWindow {
            class = link-int
        }
        download {
            class = link-file
        }
        mail {
            class = link-mail
        }
    }

    default.proc.allowedClasses < .default.allowedClasses

    default.FE >
    default.FE < .default
}
奇怪的是: 这些课程出现并且运作良好:

  • externer Link(link-ext)
  • Telefon Link(link-tel)
  • Handy link(link-mobile)
  • ohne icon(link-no-icon

这些类在向导的下拉列表中不可用:

  • interner Link(link-int)
  • Datei Link(链接文件)

在提到的rte.css中就是这个块(真正的样式出现在全局CSS中)

a.link-file {}
a.link-int {}
a.link-ext {}
a.link-mail {}
a.link-tel {}
a.link-mobile {}
a.link-no-icon {}

为什么这两个班级丢失了? 如何删除或替换内置类?

0 个答案:

没有答案