If you need to edit a textarea field with Rich text editor, the field in edit page is not so atractive.
IN Fields -> Properties set Edit as -> Readonly and in View as -> HTML
In Designer -> edit add a button next to field let's name it 'conclusions'
In client before of button write the code
var richField = pageObj.getControl("conclusions");
window.richField=richField;
var content=richField.getValue();
var popup = Runner.displayPopup( {
url: 'richField_popup.php?richField=' + content,
header: 'Edit field',
width: 850,
height: 620,
resize: false,
afterCreate: function(popup) {
window.popup = popup;
},
});
return false;
The contents of richField_popup.php file is
<?php
include "include/dbcommon.php";
include "include/dokimi_variables.php";
?>
<!DOCTYPE html>
<html>
<head>
<title>Επεξεργασία με την χρήση του TinyMCE </title>
<script type="text/javascript" src="plugins/tinymce/tinymce.min.js"></script>
<script>
tinymce.init({
selector: 'textarea#onoma', // Match the textarea ID
language: 'el',
min_width: 800,
min_height: 500,
plugins: 'anchor autolink charmap codesample emoticons image link lists media searchreplace table visualblocks wordcount',
toolbar: 'undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | link image media table | align lineheight | numlist bullist indent outdent | emoticons charmap | removeformat',
});
</script>
</head>
<body>
<?php
$onomaValue = $_GET["richField"];
?>
<form id="tinymceForm">
<textarea id="onoma" name="onoma"><?php echo $onomaValue; ?></textarea>
<button type="button" onclick="saveAndClose()">Save</button>
<button type="button" onclick="window.parent.popup.close()">Cancel</button>
</form>
<script>
function saveAndClose() {
var updatedContent = tinymce.get('onoma').getContent();
window.parent.onoma.setValue(updatedContent) ;
window.parent.popup.close();
}
</script>
</body>
</html>
- The tinymce.init({
selector: 'textarea#onoma', // Match the textarea ID
language: 'el',
min_width: 800,
min_height: 500,
plugins: 'anchor autolink charmap codesample emoticons image link lists media searchreplace table visualblocks wordcount',
toolbar: 'undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | link image media table | align lineheight | numlist bullist indent outdent | emoticons charmap | removeformat',
});
is from TinyMCE documentation https://www.tiny.cloud/docs/tinymce/latest/
Localization is in https://www.tiny.cloud/docs/tinymce/latest/ui-localization/
I hope is helpfull