Adding CK Editor in Liferay
<form>
<table>
<tr>
<td>
<aui:field-wrapper label="Editor">
<liferay-ui:input-editor editorImpl=" <%= EDITOR_WYSIWYG_IMPL_KEY %>" />
<aui:input name="dynamicContent" id="dynamicContent" type="hidden" />
</aui:field-wrapper>
</td>
</tr>
</table>
<input type="submit" value="Save" onclick="<%= renderResponse.getNamespace() %>save();"/>
<%!
public static final String EDITOR_WYSIWYG_IMPL_KEY = "editor.wysiwyg.portal- web.docroot.html.portlet.blogs.edit_entry.jsp";
%>
<aui:script>
function <portlet:namespace />initEditor() {
return "<%= UnicodeFormatter.toString(content1) %>";
}
Liferay.provide(
window,
'<portlet:namespace />saveEntry',
function() {
var A = AUI();
document.getElementById('<portlet:namespace /> dynamicContent').value = window.eEditor.getHTML();
},
['aui-io']
);
</aui:script>
<table>
<tr>
<td>
<aui:field-wrapper label="Editor">
<liferay-ui:input-editor editorImpl=" <%= EDITOR_WYSIWYG_IMPL_KEY %>" />
<aui:input name="dynamicContent" id="dynamicContent" type="hidden" />
</aui:field-wrapper>
</td>
</tr>
</table>
<input type="submit" value="Save" onclick="<%= renderResponse.getNamespace() %>save();"/>
<%!
public static final String EDITOR_WYSIWYG_IMPL_KEY = "editor.wysiwyg.portal- web.docroot.html.portlet.blogs.edit_entry.jsp";
%>
<aui:script>
function <portlet:namespace />initEditor() {
return "<%= UnicodeFormatter.toString(content1) %>";
}
Liferay.provide(
window,
'<portlet:namespace />saveEntry',
function() {
var A = AUI();
document.getElementById('<portlet:namespace /> dynamicContent').value = window.eEditor.getHTML();
},
['aui-io']
);
</aui:script>
content1?
ReplyDeletereturn "<%= UnicodeFormatter.toString(content1) %>
"content1" is where we are getting the entered value from the editor. Something like this String content1 = Paramutil.getString("request","dynamicContent");
DeleteIt is not working in my custom portlet liferay 6.0.6.
ReplyDeleteWhat is the error you are getting??
DeleteI tried using the same code but I was unable to sent the data using editor.
DeleteIt was not written in the database nor I am able to print it using Syso.
If there is no error!! Can you paste your editor code. I wil test from my side.
Deletewhich version your using?
I'm using Liferay 6.0.6.
DeleteIs it is working??
Deletehow to add change event to ckeditor
ReplyDeletedenlecges_da Maritza Jackson Download
ReplyDeletegingchecogbers
subsspec0sipe Lorrie Hart AAct Portable 4.2.7
ReplyDeleteBlender 3D 3.2.1
JetBrains PhpStorm 2022.2
Outbyte Driver Updater 2.1.16.3554
chelmensnali