HTML-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',
paste_as_text: true,
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(); });
},
<?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) {
callback(val.join(','));
}
});
},
file_picker_types: <?= json_encode($this->fileBrowserTypes) ?>,
<?php $this->endblock(); ?>
<?php $this->block('content_css'); ?>
content_css: [
'system/themes/<?= Backend::getTheme() ?>/tinymce.min.css',
'/files/tinymce/tinymce.css',
],
style_formats_merge: false,
style_formats: [
{title: 'Theme Styles', items: [
{title: 'Button Primary', block: 'div', classes: 'btn btn--primary', exact: true },
{title: 'Button Secondary', block: 'div', classes: 'btn btn--secondary', exact: true },
{title: 'Text klein', block: 'p', classes: 'text--small', exact: true },
{title: 'Text Attention', block: 'p', classes: 'text--attention', exact: true }
]},
{title: 'Basic', items: [
{title: 'Absatz', format: 'p'},
{title: 'Überschrift h2', format: 'h2'},
{title: 'Überschrift h3', format: 'h3'},
{title: 'Überschrift h4', format: 'h4'},
]},
{title: 'Entwicklung', items: [
{title: 'Bündigkeit', inline: 'span', classes: 'flush'},
{title: 'Überprüfen', inline: 'span', classes: 'check'},
]},
],
<?php $this->endblock(); ?>
<?php $this->block('plugins'); ?>
plugins: 'autosave charmap code link lists paste searchreplace',
<?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: false,
<?php $this->endblock(); ?>
<?php $this->block('toolbar'); ?>
toolbar: 'undo redo | cut copy paste searchreplace | styleselect bold italic underline strikethrough superscript subscript aligncenter alignright alignjustify removeformat | link unlink | bullist numlist blockquote | charmap <?php if (BackendUser::getInstance()->isAdmin): ?>| code<?php endif ?>',
<?php $this->endblock(); ?>
<?php $this->block('custom'); ?>
<?php $this->endblock(); ?>
browser_spellcheck: true,
tabfocus_elements: ':prev,:next',
importcss_append: true
});
</script>
<?php endif; ?>
Lesezeichen