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.

Blog Module

Discuss the Blog Module.

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

The old tinymce instead of bbcode question...


Reply

7 Posts   3143 Views

Avatar
Woody

15 January 2009 at 5:28pm Community Member, 3 Posts

Ok. I understand that I rode a shorter bus than most, but this is driving me crazy. I am attempting to use the tinymce editor (like the rest of SilverStripe) *instead* of BBCode for the blog. I have read thru the archives, and attempted to implement what seemed to work for some. It just won't work for me.

I have tried adding the line;

BlogEntry::allow_wysiwyg_editing('true');


or

BlogEntry::allow_wysiwyg_editing();


to my mysite/_config.php

the entry (made in any way) breaks the site and I get an error that points to that line.

What am I doing wrong?

Avatar
Liam

16 January 2009 at 10:22am Community Member, 470 Posts

You need to be using a latest build of the blog, not the stable version from what I remember.

If you open up BlogEntry.php in the code folder of the blog, you should see this line static $allow_wysiwyg_editing = false;

That can be changed to true.

Support was added to put it in the config file so upgrades didn't overwrite it.

If you can't see that line if your file, you're using a version that doesn't support it.

Avatar
Jsn

24 January 2009 at 9:42am (Last edited: 24 January 2009 9:42am), Community Member, 2 Posts

Boy, is this ever not working for me. I'm running 2.3.0-rc2 and Blog 0.2.0-rc1, but I can't get tinymce to open in the blog post window. I've set

$allow_wysiwyg_editing = true;

in the BlogEntry.php file, AND I've added

BlogEntry::allow_wysiwyg_editing('true');

to mysite/_config.php

And, of course, I've experimented with the obvious variations: adding one and not the other, then vice versa.

At best I turn off bbcode parsing, giving me raw text. At worst I break the site.

What am I missing? Any help would be most appreciated. Thanks.

Avatar
Willr

25 January 2009 at 2:58pm Forum Moderator, 5511 Posts

blog post window? are you talking about the post form on the front end? I dont think even if you enable it the toolbar appears on the front end, this setting only enables it in the CMS

Avatar
Jsn

25 January 2009 at 6:04pm Community Member, 2 Posts

Well, that explains it. Thank you, Will.

Setting that one value ($allow_wysiwyg_editing = true;) does indeed enable tinyMCE, but only in the CMS itself, not in the posting field you can access from the blog page itself. Two things should be noted:

1. This turns off bbcode entirely in the blog-level text entry field; you're now left with zero formatting options, aside from raw HTML.

2. This also retroactively renders any previous bbcode blog entries completely unparsed. All code is just displayed as text. It won't even inherit body styling until you open and re-save the post from within the CMS. Not a big deal during the installation process, but could be a bother if you have a lot of prior posts.

I can understand not being able to have the full tinyMCE feature set within the blog post window itself, but I'm not clear on why we have to lose bbcode in that window--or at least have some simple formatting shortcut options.

Avatar
HansR

3 March 2009 at 7:09pm Community Member, 140 Posts

Add BlogEntry::allow_wysiwyg_editing('true'); to blog/_config.php instead of to mysite/_config.php, and it should work.

Hans

Avatar
Sam

3 March 2009 at 9:59pm Administrator, 685 Posts

Jsn - are you using 2.3.0? 2.3.0 should give you TinyMCE editing in the front-end, whereas 2.2.3 did not.