阅读文档(见 https://docs.typo3.org/typo3cms/extensions/rte_ckeditor_image/(和其他相关问题(见FAL的Typo3 CKEditor图像(后,我仍然遇到问题,保存内容后图像保持300px宽度。
关于这一点的问题是,第一次,后端视图已经加载,调整大小功能在保存 cpntent 后工作。后端和前端的图像大小正确。
当我第二次更改大小并保存内容时,它再次获得 300px 的宽度。
对我来说,配置第二次被忽略了。
有人有建议吗?
我已经多次清除缓存,重新加载帧以便在后端获取其他 js 并再次保存。
配置:
page_ts_config.ts(行中没有注释(
RTE.default.buttons.image.options.magic {
maxWidth = 1200
maxHeight = 1200
}
RTE.default.buttons.image.options.plain {
maxWidth = 1200
maxHeight = 1200
}
ext_localconf.php
$GLOBALS['TYPO3_CONF_VARS']['RTE']['Presets']['default'] = 'fileadmin/templates/yaml/rte/config.yaml';
fileadmin/templates/yaml/rte/config.yaml
#
# Load default processing options
imports:
- { resource: "fileadmin/templates/yaml/rte/processing.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" }
- { resource: "EXT:rte_ckeditor_image/Configuration/RTE/Plugin.yaml" }
# Custom configuration for the editor
editor:
#externalPlugins: find, dialog, dialogui, fakeobjects, ckfinder
#externalPlugins:
#imageuploader: { resource: 'SYSEXT:rte_ckeditor/plugins/imageuploader' }
#ckfinder: { resource: "EXT:rte_ckeditor/plugins/ckfinder" }
config:
toolbarGroups:
# TODO: find/replace doesn't work/show up although given in config
- { name: editing, groups: [find, replace, selection, spellchecker, editing] }
- { name: basicstyles, groups: [ basicstyles, cleanup] }
- { name: clipboard, groups: [clipboard, undo] }
- { name: document, groups: [mode, document, doctools] }
- { name: forms, groups: [forms] }
- { name: paragraph, groups: [list, indent, blocks, align, bidi, paragraph] }
- { name: links, groups: [links] }
- { name: insert, groups: [insert] }
- { name: styles, groups: [styles, format] }
- { name: colors, groups: [colors] }
- { name: tools, groups: [tools] }
- { name: others, groups: [others] }
- { name: about, groups: [about] }
removeButtons:
- Anchor
- Superscript
- Subscript
- Strike
- Font
- FontSize
- Save
- NewPage
- Preview
- Print
- Templates
- Cut
- Copy
- Paste
- PasteText
- PasteFromWord
- SelectAll
- Scayt
- Form
- Checkbox
- HiddenField
- Radio
- TextField
- Textarea
- Button
- ImageButton
- CopyFormatting
- Blockquote
- CreateDiv
- JustifyLeft
- JustifyCenter
- JustifyRight
- JustifyBlock
- BidiLtr
- BidiRtl
- Language
- Unlink
- Flash
- Smiley
- PageBreak
- Iframe
- Maximize
- ShowBlocks
- About
- TextColor
- BGColor
format_tags: "p;h1;h2;h3;h4"
contentsCss: "/fileadmin/templates/css/rte.css"
stylesSet:
- { name: "Textlink", element: "a", attributes: { class: "textlink" } }
- { name: "Textlink im Layer öffnen", element: "a", attributes: { class: "textlink layerbox" } }
- { name: "RSS", element: "a", attributes: { class: "rss" } }
- { name: "Button-Link", element: "a", attributes: { class: "button" } }
- { name: "Button-Link im Layer öffnen", element: "a", attributes: { class: "button layerbox" } }
- { name: "Großer Button-Link", element: "a", attributes: { class: "button big" } }
- { name: "Großer Button-Link im Layer", element: "a", attributes: { class: "button big layerbox" } }
- { name: "Blauer Button-Link", element: "a", attributes: { class: "button blue" } }
- { name: "Blauer Button-Link im Layer", element: "a", attributes: { class: "button blue layerbox" } }
- { name: "Großer blauer Button-Link", element: "a", attributes: { class: "button big blue" } }
- { name: "Großer blauer Button-Link im Layer", element: "a", attributes: { class: "button big blue layerbox" } }
- { name: "Umfließen links", element: "img", attributes: { class: "floatleft" } }
- { name: "Umfließen rechts", element: "img", attributes: { class: "floatright" } }
- { name: "nicht umfließen", element: "img", attributes: { class: "floatnone" } }
- { name: "Zentrieren", element: "p", attributes: { class: "center"}}
fileadmin/templates/yaml/rte/processing.yaml
processing:
# previously known as "ts_css" for transformations
mode: default
# Tags that are allowed in the content in general
allowTags:
- table
- tbody
- tr
- th
- td
- h1
- h2
- h3
- h4
- h5
- h6
- div
- p
- br
- span
- ul
- ol
- li
- re
- blockquote
- strong
- em
- b
- i
- u
- ub
- sup
- strike
- a
- img
- nobr
- hr
- tt
- q
- cite
- abbr
- acronym
- center
denyTags:
- font
## erlaubte Attribute in p, div tags
keepPDIVattribs: [align, class, style, id]
## br wird nicht zu p konvertiert
dontConvBRtoParagraph: 1
## List all class selectors that are allowed on the way to the database
allowedClasses: [txtlink, button, layerbox, zebra_row, zebra_column,visual, big, blue, center]
## Keine Maskierung für HTML-Chars
htmlSpecialChars: 0
htmlSpecialChars.preserveEntities: 1
rmTagIfNoAttrib: span,div,font
## Do not allow insertion of the following tags
hideTags: font
## tags die untersagt sind
removeTags: font
## entfernt html-kommentare
removeComments: 1
## Tags die nicht übereinstimmen werden nicht entfernt (protect / 1 / 0)
keepNonMatchedTags: 0
## Tags that are allowed outside of paragraphs
allowTagsOutside: img, hr
## allowed default attributes
allowAttributes: [class, id, title, dir, lang, xml:lang, itemscope, itemtype, itemprop]
## CONTENT TO DATABASE
HTMLparser_db:
## STRIP ALL ATTRIBUTES FROM THESE TAGS
## If this list of tags is not set, it will default to: b,i,u,br,center,hr,sub,sup,strong,em,li,ul,ol,blockquote,strike.
## However, we want to keep xml:lang attribute on most tags and tags from the default list were cleaned on entry.
noAttrib: b, i, u, strike, sub, sup, strong, em, quote, blockquote, cite, tt, br, center
# Can be disabled if you trust ckeditor (If Automatic Content Formatting is enabled, this should be OK)
# allowTags: %default%
allowTags: table, tbody, tr, th, td, h1, h2, h3, h4, h5, h6, div, p, br, span, ul, ol, li, re, blockquote, strong, em, b, i, u, sub, sup, strike, a, img, nobr, hr, tt, q, cite, abbr, acronym, center
denyTags: font
tags:
hr:
allowedAttribs:
- class
# Keine Maskierung beim Speichern von HTML-Chars
htmlSpecialChars: -1
rmTagIfNoAttrib: span,div,font
## REMOVE OPEN OFFICE META DATA TAGS, WORD 2003 TAGS, LINK, META, STYLE AND TITLE TAGS, AND DEPRECATED HTML TAGS
## We use this rule instead of the denyTags rule so that we can protect custom tags without protecting these unwanted tags.
removeTags: center, font, link, meta, o:p, sdfield, strike, style, title, u
## PROTECT CUSTOM TAGS
keepNonMatchedTags: protect
对我来说,在 TYPO3 9.5.x 中,Page-TSconfig 中的此设置有效:
#this makes the images in bodytext larger, Also for text in news articles
RTE.default.buttons.image.options.magic {
maxWidth = 1020
# Default: 300
maxHeight = 800
# Default: 1000
}
对于内容元素Images
我在页面的通用 TypoScript 模板中使用此设置来扩展呈现宽度:
tt_content.image {
dataProcessing.20 {
maxGalleryWidth = 644
maxGalleryWidthInText = 644
}
}
但是 Contentelementimage
与 CKEditor 无关。
如果您在TypoSript Object Browser中搜索,您会找到最大值,300
其他ContentElements,可能是textpic
和textmedia
。 您也可以以相同的类型更改这些元素。它看起来像这样:
tt_content.textmedia {
dataProcessing.20 {
maxGalleryWidth = 644
maxGalleryWidthInText = 644
}
}
tt_content.textpic {
dataProcessing.20 {
maxGalleryWidth = 644
maxGalleryWidthInText = 644
}
}
然后,这些元素与CKEditor相关。
您也可以尝试更改相同类型的高度,我不确定这是否有效,因为我在 TypoSript 对象浏览器中看不到相应的高度变量。
当然,您可以根据布局使用要定义的值。