
(c) www.typo3.org, CC BY-ND 2.5
Eine für die meisten Standard Use Cases passende Konfiguration für den bei TYPO3 mitgelieferten Rich Text Editor htmlarea.
Inklusive der passenden processing rules und Unerstützung von DAM (auch in tt_news).
Ich erweitere hier, im Gegensatz zur früheren Konfiguration, die bei htmlarea mitgelieferte Standard Konfiguration.
Beide Snippets müssen ins Page TS. Die processing rules sollten vor den htmlarea Einstellungen platziert werden.
Im Extension Manager müssen idealerweise die folgenden Einstellungen getroffen werden:
HtmlArea
DAM
Ggf. müssen noch die erlaubten tags (allowTags) in den Constants erweitert werden (siehe letztes Snippet), zum Beispiel wenn attr als tag benutzt werden soll.
# ***************************************************************************************
# htmlArea RTE Configuration
#
# Author: Felix Nagel for Paints Multimedia GmbH, http://www.paints.de
# Info & DL: http://www.felixnagel.com/blog/kategorie/typo3/
# ***************************************************************************************
# we need to include default parsing rules
<INCLUDE_TYPOSCRIPT: source="FILE: fileadmin/templates/skin_standard/typoscript/system/rte_tsconfig.ts">
# Define labels and styles to be applied to class selectors in the interface of the RTE
RTE.classes >
# this class needs to be added to you CSS file (contentCSS)
RTE.classes.special-text {
name = Abgesetzter Text
}
# Anchor classes configuration for use by the anchor accesibility feature (htmlArea RTE only)
RTE.classesAnchor >
# Default RTE configuration
RTE.default {
# add CSS file for rte
contentCSS = fileadmin/templates/css/rte.css
# disable right click
disableRightClick = 1
# acronym sys folder (id, not needed for admins as webmount is used)
# buttons.acronym.pages = 306
# buttons.lockBEUserToDBmounts = 1
# image in RTE relevant
# please note you need to enable images in the EM and add width and height to RTE.default.proc.entryHTMLparser_db.tags.img.allowedAttribs
# media_ prefix when using DAM, see http://bugs.typo3.org/bug_view_advanced_page.php?bug_id=13902
buttons.image.options.removeItems = dragdrop, media_dragdrop, magic, media_magic
buttons.image.options.plain.maxWidth = 960
buttons.image.options.plain.maxHeight = 1000
buttons.image.properties.removeItems = align, border, float, paddingTop, paddingRight, paddingBottom, paddingLeft, clickenlarge
# clean out crap
removeComments = 1
enableWordClean = 1
# removed strike and u tag from default config
removeTags = center, font, o:p, sdfield
# modified showButtons array (should be sufficient in most use cases)
# row 1: text styles and tools
# row 2: standard buttons
# row 3: table operations
showButtons (
blockstyle, formatblock, bar, copy, cut, paste, pastebehaviour, pastetoggle, findreplace, bar, undo, redo, bar, linebreak,
link, image, bar, bold, italic, underline, strikethrough, bar, subscript, superscript, bar, orderedlist, unorderedlist, acronym, insertcharacter, line, bar, removeformat, chMode
)
# need to use one line! Just copy showButtons into one line!
toolbarOrder = blockstyle, formatblock, copy, cut, paste, pastebehaviour, pastetoggle, findreplace, bar, undo, redo, bar, linebreak, link, image, bar, bold, italic, underline, strikethrough, bar, subscript, superscript, bar, orderedlist, unorderedlist, acronym, insertcharacter, line, bar, removeformat, chMode
# added div element to default config
hidePStyleItems = pre,address,div
# Use stylesheet file rather than the above mainStyleOverride and inlineStyle properties to style the contents (htmlArea RTE only).
# ignoreMainStyleOverride = 1
# List all class selectors that are allowed on the way to the database
proc.allowedClasses (
more,
pdf,
external-link,
lightbox,
special-text
)
# Configuration of the anchor accessibility feature (htmlArea RTE only)
# These classes should also be in the list of allowedClasses.
classesAnchor = more, more-button, external-link, modalbox, modalbox-big, company, exploration, oilgas
classesAnchor.default {
page =
url =
file =
mail =
}
}
# needed, otherwise enableWordClean wont work, regression, see http://forge.typo3.org/issues/19697
RTE.default.showButtons := addToList(cleanword)
RTE.default.toolbarOrder := addToList(cleanword)
# Use same processing as on entry to database to clean content pasted into the editor
RTE.default.enableWordClean.HTMLparser < RTE.default.proc.entryHTMLparser_db
# remove all classes so we have a clean start after pasting (allowed classed wont work on enableWordClean)
RTE.default.enableWordClean.HTMLparser.tags.p.fixAttrib.class.unset = 1
# make DAM usable in tt_news entries
RTE.config.tt_news.bodytext.proc.overruleMode = ts_css,txdam_media
TYPO3 RTE proc rules
# ***************************************************************************************
# htmlArea RTE Configuration
#
# Author: Felix Nagel for Paints Multimedia GmbH, http://www.paints.de
# Info & DL: http://www.felixnagel.com/blog/kategorie/typo3/
# ***************************************************************************************
# Define labels and styles to be applied to class selectors in the interface of the RTE
RTE.classes >
RTE.classes.special-text {
name = Abgesetzter Text
}
# Anchor classes configuration for use by the anchor accesibility feature (htmlArea RTE only)
RTE.classesAnchor >
# Default RTE configuration
RTE.default {
# add CSS file for rte
contentCSS = fileadmin/templates/css/rte.css
# disable right click
disableRightClick = 1
# acronym sys folder (id, not needed for admins as webmounts is used)
# buttons.acronym.pages = 306
# buttons.lockBEUserToDBmounts = 1
# image in RTE relevant
# please note you need to enable images in the EM and add width and height to RTE.default.proc.entryHTMLparser_db.tags.img.allowedAttribs
# media_ prefix when using DAM, see http://bugs.typo3.org/bug_view_advanced_page.php?bug_id=13902
buttons.image.options.removeItems = dragdrop, media_dragdrop
buttons.image.options.plain.maxWidth = 980
buttons.image.options.plain.maxHeight = 1000
buttons.image.properties.removeItems = align, border, float, paddingTop, paddingRight, paddingBottom, paddingLeft, clickenlarge
# removed strike and u tag from default config
removeTags = center, font, o:p, sdfield
# modified showButtons array (should be sufficient in most use cases)
# row 1: text styles and tools
# row 2: standard buttons
showButtons (
blockstyle, formatblock, bar, copy, cut, paste, pastebehaviour, pastetoggle, findreplace, bar, undo, redo, bar, linebreak,
link, image, bar, bold, italic, underline, strikethrough, bar, subscript, superscript, bar, orderedlist, unorderedlist, acronym, insertcharacter, line, bar, removeformat, chMode
)
# need to use one line! Just copy showButtons into one line!
toolbarOrder = blockstyle, formatblock, copy, cut, paste, pastebehaviour, pastetoggle, findreplace, bar, undo, redo, bar, linebreak, link, image, bar, bold, italic, underline, strikethrough, bar, subscript, superscript, bar, orderedlist, unorderedlist, acronym, insertcharacter, line, bar, removeformat, chMode
# added div element to default config
hidePStyleItems = pre,address,div
# List all class selectors that are allowed on the way to the database
proc.allowedClasses (
more,
more-button,
external-link,
modalbox,
special-text,
company,
exploration,
oilgas
)
# Configuration of the anchor accessibility feature (htmlArea RTE only)
# These classes should also be in the list of allowedClasses.
classesAnchor = more, more-button, external-link, modalbox, company, exploration, oilgas
classesAnchor.default {
page =
url =
file =
mail =
}
}
# make DAM usable in tt_news entries
RTE.config.tt_news.bodytext.proc.overruleMode = ts_css,txdam_media
TYPO3 htmlarea RTE configuration
# Add tags to constants styles.content.links.allowTags := addToList(abbr, acronym)TYPO3 add tags to constants
RSS: Blog | Kommentare | Was ist RSS?
Kommentar schreiben