PHP-Code:
<?php
namespace Contao;
if ($GLOBALS['TL_CONFIG']['useRTE']):
?>
<script>window.tinymce || document.write('<script src="<?= TL_ASSETS_URL ?>assets/tinymce4/js/tinymce.min.js">\x3C/script>')</script>
<script>
setTimeout(function() {
window.tinymce && tinymce.init({
skin: 'contao',
selector: '#<?= $this->selector ?>',
language: '<?= Backend::getTinyMceLanguage() ?>',
element_format: 'html',
document_base_url: '<?= Environment::get('base') ?>',
entities: '160,nbsp,60,lt,62,gt,173,shy',
branding: false,
setup: function(editor) {
editor.getElement().removeAttribute('required');
},
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', function() { Backend.getScrollOffset(); });
},
file_browser_callback: function(field_name, url, type, win) {
Backend.openModalBrowser(field_name, url, type, win, '<?= $this->source ?>');
},
// lade Styles der tinymce.css aber nur für den Backend - für Frontend eigenes Stylesheet im Theme angelegt
content_css: 'system/themes/<?= Backend::getTheme() ?>/tinymce.css, /files/kieks/layout/css/bundle.min.css',
importcss_selector_converter: function (selector) {
return false;
},
file_browser_callback_types: <?= json_encode($this->fileBrowserTypes) ?>,
plugins: 'autosave charmap code fullscreen image importcss link lists paste searchreplace stripnbsp tabfocus table visualblocks',
browser_spellcheck: true,
tabfocus_elements: ':prev,:next',
importcss_append: true,
extended_valid_elements: 'q[cite|class|title],article,section,hgroup,figure,figcaption',
menubar: 'file edit insert view format table',
toolbar: 'link unlink | image | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | undo redo | code',
style_formats_merge: true,
style_formats: [
{title: 'KDD', items: [
{ title: 'Groß und Blau', inline: 'span', classes: 'info-text--bigblue', exact: true },
{ title: 'Groß und Rot', inline: 'span', classes: 'info-text--bigred', exact: true },
{ title: 'Schrift größer (20px)', block: 'p', classes: 'text-lg', exact: true }
]}
]
});
}, 0);
</script>
<?php endif; ?>
Lesezeichen