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>


Comments

  1. content1?
    return "<%= UnicodeFormatter.toString(content1) %>

    ReplyDelete
    Replies
    1. "content1" is where we are getting the entered value from the editor. Something like this String content1 = Paramutil.getString("request","dynamicContent");

      Delete
  2. It is not working in my custom portlet liferay 6.0.6.

    ReplyDelete
    Replies
    1. What is the error you are getting??

      Delete
    2. I tried using the same code but I was unable to sent the data using editor.
      It was not written in the database nor I am able to print it using Syso.

      Delete
    3. If there is no error!! Can you paste your editor code. I wil test from my side.

      which version your using?

      Delete
    4. I'm using Liferay 6.0.6.

      Delete
  3. how to add change event to ckeditor

    ReplyDelete
  4. denlecges_da Maritza Jackson Download
    gingchecogbers

    ReplyDelete

Post a Comment

Popular posts from this blog

Theme display in javascript

How to know which liferay version we are using

Opening portlet in popup