Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Customising the blog HTML editor


Go to End


5 Posts   2505 Views

Avatar
Bruce B

Community Member, 164 Posts

24 June 2010 at 6:32pm

I have just switched one of my site blogs from BBcode to wysiwyg editing. Unfortunately, this removed the ability to insert links or images into blog entries. The solution is to add a few lines to /blog/_config.php:

HtmlEditorConfig::get('blog')->insertButtonsBefore('advcode', 'image', 'link', 'unlink', 'separator' );
HtmlEditorConfig::get('blog')->removeButtons('tablecontrols');
HtmlEditorConfig::get('blog')->addButtonsToLine(3, 'tablecontrols');

HtmlEditorConfig::set_active('blog');

Sources for this idea included:
SSbits website: http://www.ssbits.com/customising-the-wysywig-editor-in-v2-3-2-tinymce/
SilverStripe docs: http://doc.silverstripe.org/htmleditorconfig
The comments in /sapphire/forms/HtmlEditorConfig.php

Hope this helps somebody. Let me know if is causes problems. I'm using SS 2.4 and blog 0.4

Avatar
wainui

Community Member, 56 Posts

27 August 2010 at 8:00pm

cheers bro... just what I was after :)

Avatar
wainui

Community Member, 56 Posts

27 August 2010 at 8:10pm

Just incase anyone ants to activate the media plugin to add dyoutube videos..

HtmlEditorConfig::get('blog')->enablePlugins('media'); // enables plugin
HtmlEditorConfig::get('blog')->insertButtonsBefore('advcode', 'media' );

Avatar
Artyom

Community Member, 22 Posts

4 October 2010 at 12:12pm

Thanks gents, but the image button is nearly useless, since it only allows one to type in a URL, and not upload an image. wtf? any thoughts?

Avatar
Plato Creative

Community Member, 26 Posts

4 October 2010 at 2:48pm

Edited: 04/10/2010 2:49pm

It's the default image button for the editor, is why.
The one in the CMS is a custom plugin called ss_buttons. But it's specifically designed to work with the CMS...

Unfortunatly I think you're going to have to hack around the issue to get uploads that land nicely in the assets folder.