RTE Beispielkonfiguration
Gerade das Konfigurieren des RichText-Editors (RTE) von Typo3 benötigt etwas Fingerspitzengefühl, die unten angeführte Beispielkonfiguration soll dabei als Vorlage dienen. Das TypoScript wird dabei in das TSConfig-Feld der entsprechenden Seite kopiert (Einstellungen werden im Baum nach unten weitervererbt).
#
# RTE config
#
# define classes for link-types
RTE.classesAnchor {
externalLink {
class = link_external
type = url
image >
titleText =
}
internalLink {
class = link_internal
type = page
image >
titleText =
}
download {
class = link_file
type = file
image >
titleText =
}
mail {
class = link_mail
type = mail
image >
titleText =
}
}
# configure RTE
RTE.default {
# set CSS where content is defined
# Attention -> CSS must be simple, no charset no media definition
contentCSS = fileadmin/rte.css
useCSS = 1
# hide classes which are not configured above
#showTagFreeClasses = 1
# disable make paragraphs on enter
#disableEnterParagraphs = 1
# remove trailing br-tags
removeTrailingBR=1
# markup options
enableWordClean = 1
removeComments = 1
removeTags = center, sdfield
removeTagsAndContents = style,script
# set max image size
buttons.image.options.plain.maxWidth = 370
buttons.image.options.magic.maxWidth = 370
# set allowed classes for links
classesAnchor = link_internal, link_external, link_file, link_mail
# set default link classes for different types
classesAnchor.default {
page = link_internal
url = link_external
file = link_file
mail = link_mail
}
# set allowed classes for paragraphs
classesParagraph =
# set class for image
classesImage = rte_image
# add inline style
#inlineStyle.text-alignment (
# p.nomargin {margin: 0}
# p.greytext {padding:0 0 20px 0; margin:0; line-height: 1.5em; color:#777777;}
# p.smalltext {padding:0 0 1em 0; margin:0; line-height: 1.5em; font-size:0.6em;}
#)
ignoreMainStyleOverride = 1
# define formatblock
buttons.formatblock.orderItems = p, h1, h2, h3, h4, h5, h6
# set allowed tags and cleaning options
proc {
allowTags = table, tbody, tr, th, td, h1, h2, h3, h4, h5, h6, div, p, br, ul, ol, li,strong, em, b, i, u, sub, sup, a, img
denyTags = span, font, re, blockqote, strong, strike, nobr, hr, tt, q, cite, abbr, acronym
dontConvBRtoParagraph = 1
allowTagsOutside = img,hr,a,p,div
keepPDIVattribs = class,style,id
# set all used classes here
allowedClasses = link_internal, link_external, link_file, link_mail
entryHTMLparser_db = 1
entryHTMLparser_db {
# xhtml cleaning
xhtml_cleaning = 1
# remiove attributes at following tags
noAttrib = b,i,u,strike,sub,sup,strong,em,quote,blockquote,cite,tt,br,center
# remap b and i tags
tags.b.remap = strong
tags.i.remap = em
# remove tags without attributes
rmTagIfNoAttrib = span,div,font
# enable special html chars, not needed in utf-8 environment
#htmlSpecialChars = 1
}
}
# show hide buttons
showButtons = image, formatblock, chMode, inserttag, bold, italic, underline, left, center, right, orderedlist, unorderedlist, insertcharacter, link, removeformat, findreplace, insertcharacter, undo, redo, showhelp, about, subscript, superscript
hideButtons = textstyle, textstylelabel, blockstyle, blockstylelabel, fontstyle, fontsize, strikethrough, lefttoright, righttoleft, textcolor, bgcolor, textindicator, emoticon, line, user, spellcheck, outdent, indent, justifyfull, acronym, copy, cut, pastetable, toggleborders, tableproperties, rowproperties, rowinsertabove, rowinsertunder, rowdelete, rowsplit, columninsertbefore, columninsertafter, columndelete, columnsplit, cellproperties, cellinsertbefore, cellinsertafter, celldelete, cellsplit, cellmerge
}
# Breite des RTE in Fullscreen-Ansicht
TCEFORM.tt_content.bodytext.RTEfullScreenWidth= 80%