Foren

message board with fckeditor

Suganda Sidharta, geändert vor 16 Jahren.

message board with fckeditor

Junior Member Beiträge: 69 Beitrittsdatum: 01.03.07 Neueste Beiträge
Hi all,

just want to ask simple question

how do i use fckeditor for adding thread instead of BBEditor (forget the jspf name for default liferay message board editor) like the one that liferay currently using

even for real liferay , when i add this new thread it also still use the default simple editor

thanks in advance,
Suganda
Suganda Sidharta, geändert vor 16 Jahren.

RE: message board with fckeditor

Junior Member Beiträge: 69 Beitrittsdatum: 01.03.07 Neueste Beiträge
hello , is there any answer for my question ?

thanks,
suganda
Suganda Sidharta, geändert vor 16 Jahren.

RE: message board with fckeditor

Junior Member Beiträge: 69 Beitrittsdatum: 01.03.07 Neueste Beiträge
Hello , is there any answer for this question ?

thanks in advance,
Suganda
thumbnail
Christophe Cariou, geändert vor 15 Jahren.

RE: message board with fckeditor

Junior Member Beiträge: 57 Beitrittsdatum: 01.10.07 Neueste Beiträge
Hi,
I need the same feature.

The BBCode editor is not enough for me. When I write a post, I want to be able to link to a document in the Library.

The FCK Editor used by the Journal (an I think by the Blogs) is a good one.

How to use it in the Messages Board ?

Christophe
thumbnail
Alex Wallace, geändert vor 15 Jahren.

RE: message board with fckeditor

Liferay Master Beiträge: 640 Beitrittsdatum: 05.11.07 Neueste Beiträge
There is a property in portal.properties (which you can override in portal-ext.properties)...


    editor.wysiwyg.portal-web.docroot.html.portlet.message_boards.edit_configuration.jsp=fckeditor


However, I have not tried changing this and it actually has the fckeditor as a devault value... This property may reffer to a different functionality in the message boards, than that of adding threads... And that seems to be the only configurable property for editors for the message board... So, if this is not it, there may not be one...

Additionally, the fckeditor is for HTML and the message board is not meant to parse HTML, it uses it's own tags.... Allowing html on it seems rather dangerous in my opinion...
alain raybon, geändert vor 14 Jahren.

RE: message board with fckeditor

New Member Beiträge: 9 Beitrittsdatum: 26.05.08 Neueste Beiträge
Hi,

I have the same need, how I can replace the bbcode editor for ''message_board'' by the FCK editor,,,


plz help
Alain
Paul Brennan, geändert vor 14 Jahren.

RE: message board with fckeditor

New Member Beiträge: 4 Beitrittsdatum: 05.08.09 Neueste Beiträge
I spent ages trying to get this work and here's what I did.
You will need the EXT environment.

In the message boards portlet - there is a file edit_message.jsp which include the file bbcode_editor.jspf. Now the proper thing is probably to change edit_message.jsp but I wanted to modify as little files as I can, so its easier to track the source code.
So in your EXT environment,
ext-web/docroot/html/portlet/message_boards/bbcode_editor.jspf
This file includes a textarea:

<textarea class="lfr-textarea message-edit" name="<portlet:namespace />textArea" id="<portlet:namespace />textArea"><%= HtmlUtil.escape(GetterUtil.getString(body)) %></textarea>

This (along with the JS at the top of the file) puts the BB code editor into the file.
I then commented out this line and "borrowed" the code from the journal portlet to add the editor (slightly modified):

<liferay-ui:input-editor editorImpl="editor.wysiwyg.default" toolbarSet="liferay-article" initMethod="getCurrentText" onChangeMethod='<%= renderResponse.getNamespace() + "editorContentChanged" %>' width="100%" />

editorImpl has been hard coded as just the default editor. This is good enough for me. I couldn't get it to work using <%= EDITOR_WYSIWYG_IMPL_KEY %>, which would be the better way of doing it.
I have also added
initMethod="getCurrentText"
this snippet is the javascript function that gets the current content when a user edits the message. The content of this function is "borrowed" from the original code. So added another function within bbcode_editor.jspf:

function getCurrentText(){
return "<%= HtmlUtil.escape(GetterUtil.getString(body)) %>"
}

One file modified - FCK editor used. Although it would be good if the source code takes the value in portal.properties, rather than hard coding the BBcode editor.
thumbnail
Michael Hanisch, geändert vor 14 Jahren.

RE: message board with fckeditor

New Member Beitrag: 1 Beitrittsdatum: 16.10.08 Neueste Beiträge
Hi Paul,

thank you for the patch (for LPS-4573)!

I've tried it out on a message board on my local installation, but for some reason it doesn't work: the text I enter in the FCKEditor is never passed on to the portlet, <portlet:namespace/>_body is always empty!

Could it be that your patch and the explanation in your post is missing something? A bit of javascript perhaps?

Thanks,

Michael.

aaaa
thumbnail
Juan Fernández, geändert vor 13 Jahren.

RE: message board with fckeditor

Liferay Legend Beiträge: 1261 Beitrittsdatum: 02.10.08 Neueste Beiträge
Hi guys:
just for your information, we have already implemented this in Liferay trunk, so this will be available in the next major version (Liferay 6.1).
You can see the submitted code in this ticket
Thanks for your comments and feedback
Regards,
Juan Fernández
Fran Garcia, geändert vor 13 Jahren.

RE: message board with fckeditor

Regular Member Beiträge: 113 Beitrittsdatum: 09.04.10 Neueste Beiträge
Hi Juan!

What about it? Do you find any solution?

I need to change the editor in the message boards!

Thank u!
thumbnail
David Toutant, geändert vor 13 Jahren.

RE: message board with fckeditor

New Member Beiträge: 8 Beitrittsdatum: 02.09.10 Neueste Beiträge
Hi all,
Here are the steps i took to replace the messageboard editor by fckeditor :

1) In /ROOT/html/portlet/message_boards edit bbcode_editor.jspf

Replace:
<textarea class="lfr-textarea message-edit" name="<portlet:namespace />textArea" id="<portlet:namespace />textArea"><%= HtmlUtil.escape(GetterUtil.getString(body)) %></textarea>

By these lines:
<liferay-ui:input-editor
editorImpl="editor.wysiwyg.default"
toolbarSet="liferay-article"
initMethod='<%= "getCurrentText" %>'
onChangeMethod='<%= renderResponse.getNamespace() + "editorContentChanged" %>'
width="100%"
/>

2) Add the following function in the script tag:
function getCurrentText(){
return "<%= UnicodeFormatter.toString(body) %>"
}

3)Replace:
function <portlet:namespace />getHTML() {
return <portlet:namespace />bbCode.getHTML();
}

By:
function <portlet:namespace />getHTML() {
return window.<portlet:namespace />editor.getHTML();
}

Now the editor of the messageboard is fck and you can save the message without error. To view the message in html:

4) In /ROOT/html/portlet/message_boards edit view_thread_message.jspf
Look for <div class="thread-body"> and replace <%= msgBody %> by <%= message.getBody() %>

That's it!

David
Fran Garcia, geändert vor 13 Jahren.

RE: message board with fckeditor

Regular Member Beiträge: 113 Beitrittsdatum: 09.04.10 Neueste Beiträge
Thank u!

That's the solution!
thumbnail
Brian Scott Schupbach, geändert vor 12 Jahren.

RE: message board with fckeditor

Expert Beiträge: 329 Beitrittsdatum: 23.10.08 Neueste Beiträge
I'm using version 6.0.6 and am having a little trouble. I've replaced the bbcode_editor.jspf file with the code below. Everything works except for editing. The content of the post isn't loaded if I try to edit an existing post. Can anyone see what I'm doing wrong? Thanks in advance.

Brian



<aui:field-wrapper label="content">
	<liferay-ui:input-editor editorImpl="<%= EDITOR_WYSIWYG_IMPL_KEY %>" />

	<aui:input name="content" type="hidden" />
</aui:field-wrapper>

<aui:script>
	function <portlet:namespace />getHTML() {
		return window.<portlet:namespace />editor.getHTML();
	}
	
	function getCurrentText(){
		return "&lt;%= UnicodeFormatter.toString(body) %&gt;"
	}
</aui:script>

&lt;%!
public static final String EDITOR_WYSIWYG_IMPL_KEY = "editor.wysiwyg.portal-web.docroot.html.portlet.journal.edit_article_content_xsd_el.jsp";

private String _buildMetaDataHTMLAttributes(Map<string, string> elMetaData, String elName) {
	if (elMetaData.isEmpty()) {
		return StringPool.BLANK;
	}

	StringBundler sb = new StringBundler(elMetaData.size() * 5);

	Iterator<string> keys = elMetaData.keySet().iterator();

	while (keys.hasNext()) {
		String name = keys.next();

		String content = elMetaData.get(name);

		sb.append("data");
		sb.append(name);
		sb.append("='");
		sb.append(HtmlUtil.escapeAttribute(content));
		sb.append("' ");
	}

	return sb.toString();
}
%&gt;
</string></string,>
thumbnail
Brian Scott Schupbach, geändert vor 12 Jahren.

RE: message board with fckeditor

Expert Beiträge: 329 Beitrittsdatum: 23.10.08 Neueste Beiträge
I added this line of code and it is now working perfectly.

function <portlet:namespace />initEditor() {
		return "&lt;%= UnicodeFormatter.toString(body) %&gt;";
	}
Jeremy Wier, geändert vor 12 Jahren.

RE: message board with fckeditor

New Member Beiträge: 9 Beitrittsdatum: 15.10.09 Neueste Beiträge
Brian, I just tried out your solution and it seems to work great except now all my existing posts contain the wiki markup in the ckeditor. And if you publish without removing all of the tags, they will show up in your edited post. Have you experienced this?
thumbnail
Brian Scott Schupbach, geändert vor 12 Jahren.

RE: message board with fckeditor

Expert Beiträge: 329 Beitrittsdatum: 23.10.08 Neueste Beiträge
Have you done this step?


In /ROOT/html/portlet/message_boards edit view_thread_message.jspf
Look for <div class="thread-body"> and replace <%= msgBody %> by <%= message.getBody() %>


I'm not experiencing those issues.
Jeremy Wier, geändert vor 12 Jahren.

RE: message board with fckeditor

New Member Beiträge: 9 Beitrittsdatum: 15.10.09 Neueste Beiträge
Thanks, Brian. I did miss that step!

However, even after applying the msgBody change, I am still seeing issues. On an existing post with a bulleted list, all the formatting is removed and I'm left with plain text with the
    and
  • tags still there.

    I'll keep digging!
Neha Goel, geändert vor 12 Jahren.

RE: message board with fckeditor

New Member Beiträge: 7 Beitrittsdatum: 22.11.10 Neueste Beiträge
Hi all,

I have a requirement where I am saving the body using the localservice API and when it hits bbcodeutil then it is throwing some error.So is there any way I can format my simple body how it is done when i post it from front end.

Any pointers would help

Regards
Neha