Hallo Spooky,
Die beiden templates liegen unter /home/www/contao/templates
be_tinyMCE.html5
PHP-Code:
<?php
namespace Contao;
if ($GLOBALS['TL_CONFIG']['useRTE']):
// Use document.write() here in case TinyMCE is loaded in a subpalette (see #1424)
?>
<script>window.tinymce || document.write('<script src="<?= $this->asset('js/tinymce.min.js', 'contao-components/tinymce4') ?>">\x3C/script>')</script>
<script>
window.tinymce && tinymce.init({
selector: '#<?= $this->selector ?>',
min_height: 336,
language: '<?= Backend::getTinyMceLanguage() ?>',
element_format: 'html',
document_base_url: '<?= Environment::get('base') ?>',
entities: '160,nbsp,60,lt,62,gt,173,shy',
branding: false,
promotion: false,
skin: (document.documentElement.dataset.colorScheme === 'dark' ? 'tinymce-5-dark' : 'tinymce-5'),
setup: function(editor) {
editor.getElement().removeAttribute('required');
document.querySelectorAll('[accesskey]').forEach(function(el) {
editor.addShortcut('access+' + el.accessKey, el.id, () => el.click());
});
},
init_instance_callback: function(editor) {
if (document.activeElement && document.activeElement.id && document.activeElement.id == editor.id) {
editor.editorManager.get(editor.id).focus();
}
editor.on('focus', () => window.dispatchEvent(new Event('store-scroll-offset')));
},
<?php $this->block('picker'); ?>
file_picker_callback: function(callback, value, meta) {
Backend.openModalSelector({
'id': 'tl_listing',
'title': document.getElement('.tox-dialog__title').get('text'),
'url': Contao.routes.backend_picker + '?context=' + (meta.filetype == 'file' ? 'link' : 'file') + '&extras[fieldType]=radio&extras[filesOnly]=true&extras[source]=<?= $this->source ?>&value=' + value + '&popup=1',
'callback': function(table, val) {
document.getElement('.tox-dialog input')?.focus();
callback(val.join(','));
}
});
},
file_picker_types: '<?= $this->fileBrowserTypes ?>',
<?php $this->endblock(); ?>
<?php $this->block('content_css'); ?>
content_css: document.documentElement.dataset.colorScheme === 'dark' ? '<?= $this->asset('tinymce-dark.css', 'system/themes/'.Backend::getTheme()) ?>' : '<?= $this->asset('tinymce.css', 'system/themes/'.Backend::getTheme()) ?>',
<?php $this->endblock(); ?>
<?php $this->block('plugins'); ?>
plugins: 'autosave charmap code fullscreen image importcss link lists searchreplace stripnbsp table visualblocks visualchars',
<?php $this->endblock(); ?>
<?php $this->block('valid_elements'); ?>
extended_valid_elements: 'q[cite|class|title],article,section,hgroup,figure,figcaption',
<?php $this->endblock(); ?>
<?php $this->block('menubar'); ?>
menubar: 'file edit insert view format table',
<?php $this->endblock(); ?>
<?php $this->block('toolbar'); ?>
toolbar: 'link unlink | image | blocks | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | code',
<?php $this->endblock(); ?>
<?php $this->block('contextmenu'); ?>
contextmenu: false,
<?php $this->endblock(); ?>
<?php $this->block('cache_suffix'); ?>
cache_suffix: '?v=<?= $this->assetVersion('js/tinymce.min.js', 'contao-components/tinymce4') ?>',
<?php $this->endblock(); ?>
<?php $this->block('custom'); ?>
<?php $this->endblock(); ?>
<?php if ($this->readonly): ?>
readonly: true,
<?php endif; ?>
browser_spellcheck: true,
importcss_append: true
});
</script>
<?php endif; ?>
be_tinyNews.html5
PHP-Code:
<?php $this->extend('be_tinyMCE'); ?>
<?php $this->block('valid_elements'); ?>
extended_valid_elements: 'b/strong,i/em',
<?php $this->endblock(); ?>
<?php $this->block('custom'); ?>
doctype: '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">',
<?php $this->endblock(); ?>
Danke Dir,
Matthias
Lesezeichen