Hallo zusammen, nach dem Update von 4.9 auf 4.13 greift im TinyMCE der Pfad zum einfügen von html-Vorlagen nicht mehr.
Mir ist klar, daß seit Contao4.10 eine neue Version des TinyMCE läuft und ich habe auch schon eine ganz frische be_tinyMCE.html5 angelegt.
Dort habe ich versucht die folgenden Angaben aus der alten be_tinyMCE.html5 einzubauen die dort bisher auch ohne Probleme funktioniert haben:
HTML-Code:
templates: [
<?php echo Backend::getTinyTemplates(); ?>
],
HTML-Code:
plugins: 'autosave charmap code fullscreen image importcss link lists paste searchreplace tabfocus table template visualblocks',
Die habe ich wie folgt in der neuen be_tinyMCE.html5 eingesetzt:
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',
branding: false,
templates: [
<?php echo Backend::getTinyTemplates(); ?>
],
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',
<?php $this->endblock(); ?>
<?php $this->block('plugins'); ?>
plugins: 'autosave charmap code fullscreen image importcss link lists paste searchreplace stripnbsp tabfocus table template 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 | formatselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | code',
<?php $this->endblock(); ?>
<?php $this->block('custom'); ?>
<?php $this->endblock(); ?>
browser_spellcheck: true,
tabfocus_elements: ':prev,:next',
importcss_append: true
});
</script>
<?php endif; ?>
Wenn ich jetzt im Backend über den TinyMCE eine Vorlage einfügen will, öffnet sich zwar das PopUp "Vorlage einfügen", aber das zeigt nichts an und läd und läd und läd... bis in alle Ewigkeit.
Der Ordner /files/tiny_templates hat auch keinen Verzeiochnisschutz, habe schon nachgesehen.
Ich habe es auch mal hiermit ausprobiert:
HTML-Code:
templates: [
{
title : "element.html",
src : "/files/tiny_templates/element.html",
}
],
Läd sich aber immer noch tot.
Kann mir jemand sagen woran es noch liegen kann?
Lesezeichen