Jump to:

1835 Posts in 1139 Topics by 554 members

Blog Module

SilverStripe Forums » Blog Module » The old tinymce instead of bbcode question...

Discuss the Blog Module.

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

Page: 1
Go to End
Author Topic: 3008 Views
  • Woody
    Avatar
    Community Member
    3 Posts

    The old tinymce instead of bbcode question... Link to this post

    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?

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: The old tinymce instead of bbcode question... Link to this post

    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.

  • Jsn
    Avatar
    Community Member
    2 Posts

    Re: The old tinymce instead of bbcode question... Link to this post

    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.

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: The old tinymce instead of bbcode question... Link to this post

    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

  • Jsn
    Avatar
    Community Member
    2 Posts

    Re: The old tinymce instead of bbcode question... Link to this post

    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.

  • HansR
    Avatar
    Community Member
    140 Posts

    Re: The old tinymce instead of bbcode question... Link to this post

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

    Hans

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: The old tinymce instead of bbcode question... Link to this post

    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.

    3008 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.