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

The old tinymce instead of bbcode question...


Go to End


7 Posts   4328 Views

Avatar
Woody

Community Member, 3 Posts

15 January 2009 at 5:28pm

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

Community Member, 470 Posts

16 January 2009 at 10:22am

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

Community Member, 2 Posts

24 January 2009 at 9:42am

Edited: 24/01/2009 9:42am

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

Forum Moderator, 5523 Posts

25 January 2009 at 2:58pm

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

Community Member, 2 Posts

25 January 2009 at 6:04pm

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

Community Member, 141 Posts

3 March 2009 at 7:09pm

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

Hans

Avatar
Sam

Administrator, 690 Posts

3 March 2009 at 9:59pm

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.