Wir nutzen CMS_TEXT in unseren Modulen sehr viel, um (teilweise auch größere) Textbereiche editierbar zu machen, ohne dass der Redakteur dort Formatierungen machen kann. In der neuen Version 4.9.4 erscheint aber nach dem Klick auf den Stift bei CMS_TEXT keine Textarea mehr, sondern nur noch ein kurzes Textfeld, in dem nur 50 Zeichen zu sehen sind und wo es keine Möglichkeit gibt, ohne html-Tags Zeilenumbrüche zu machen. Warum?
Den WYSIWYG Editor ganz zu deaktivieren und CMS_HTML zu verwenden ist keine Option, da wir den natürlich für andere Contentbereiche brauchen.
Auf der Seite https://docs.contenido.org/display/CONDEVE/CMS_TEXT ist folgende Grafik:
Es wäre viel besser, wenn bei einem CMS_TEXT ein größerer Texteditor erscheint, wie das bei Contenido 4.8 der Fall war, und die bearbeitbaren Bereiche genauso markiert wären, wie in der Grafik am besten mit einem Grünen Balken darüber in dem steht, ob es ein TEXT, HTML, HTMLHEAD usw. ist.
In der include.CMS_TEXT.php (https://git.contenido.org/projects/CON/ ... S_TEXT.php) steht in Zeile 86:
Code: Alles auswählen
<textarea name="CMS_TEXT" rows="15" cols="90"><?php echo $a_content[$type][$typenr]?></textarea>
Code: Alles auswählen
(function(Con, $) {
$(function() {
// replace the text div with an input field if the div or the edit button is clicked
$('#text_editbutton_100, #text_text_100').click(function() {
var text = $('#text_text_100').html();
$('#text_text_100').replaceWith('<input id="text_text_100" name="text_text_100" value="" size="50" type="text" class="edit-textfield edit-text-textfield">');
$('#text_text_100').val(text);
$('#text_text_100').focus();
$('#text_editbutton_100').replaceWith('<img id="text_savebutton_100" src="http://mb-wt.de/contenido/images/but_ok.gif" style="margin-left: 5px;cursor: pointer;">');
});
// submit the form if the save button or enter is clicked
$(document).on('click', '#text_savebutton_100', function() {
cContentTypetextSave100();
});
$(document).keypress(function(e) {
if (e.which == 13 && $('#text_text_100').is(':focus')) {
cContentTypetextSave100();
}
});
/**
* Adds the given name/value pair as a hidden field to the editform so that it
* is submitted to CONTENIDO. If a hidden field with the given name already
* exists, the value is overriden.
*
* @param {String} name The name of the form field which should be added.
* @param {String} value The value of the form field which should be added.
*/
function cContentTypetextAppendFormField100(name, value) {
// if a hidden input field with the given name already exists, just set the value
if ($('form[name="editcontent"] input[type="hidden"][name="' + name + '"]').length > 0) {
$('form[name="editcontent"] input[type="hidden"][name="' + name + '"]').val(value);
} else {
// otherwise append a new field to the form
$('form[name="editcontent"]').append('<input type="hidden" value="" name="' + name + '">');
$('form[name="editcontent"] input[type="hidden"][name="' + name + '"]').val(value);
}
};
/**
* Saves the entered text.
*/
function cContentTypetextSave100() {
cContentTypetextAppendFormField100('text_action', 'store');
cContentTypetextAppendFormField100('text_id', '100');
var text = $('#text_text_100').val();
cContentTypetextAppendFormField100('text_text_100', text);
Con.Tiny.setContent('1');
}
});
})(Con, Con.$);
Danke und schöne Grüße, Andras