Jump to:

1030 Posts in 805 Topics by 311 members

Forum Module

SilverStripe Forums » Forum Module » Short Codes (or Extending BBCode) in the Forum Module

Discuss the Forum Module.

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

Page: 1
Go to End
Author Topic: 1034 Views
  • johnmblack
    Avatar
    Community Member
    61 Posts

    Short Codes (or Extending BBCode) in the Forum Module Link to this post

    We added some custom short codes to the "core" site code to allow various media embedding. We are now installing the Forum Module. The customer's two biggest requirements are:

    - BBCode or similar, not full HTML, for security reasons
    - Authors must be able to embed the same kinds of media as the core site.

    Is this possible out of the box? Do I understand correctly that the BBCode components are totally separate from the SS ShortCode capabilities? If that is the case, is there a way to *add* a custom BBCode similar to how I added the SS shortcodes? (I don't mind hacking into the bbcode php, if that is possible.)

    Thanks!

    -John

  • swaiba
    Avatar
    Forum Moderator
    1786 Posts

    Re: Short Codes (or Extending BBCode) in the Forum Module Link to this post

    Hi John,

    I can't comment too much on the forum module, however regarding bbcode. out of the box silverstripe itself supprots basic bbcode. Just replace $Content this in your template with...

    $Content.Parse(BBCodeParser)

    have a look at "sapphire\parsers\BBCodeParser.php" for the available tags

  • johnmblack
    Avatar
    Community Member
    61 Posts

    Re: Short Codes (or Extending BBCode) in the Forum Module Link to this post

    Thanks swaiba, I actually need to go in the other direction (get SS shortcodes working inside blog/forum) but you've just pointed me in the right direction for hooking into the bbcode parser.

    I think my short term fix is going to be simply adding the 2 or 3 custom codes there to try to function the same way as over on the main site. But I'm also wondering if I could make BBCodeParser.php look at the SS shortcode collection in real time, and include them, such that *any* custom shortcode also works in Blog/Forum. If that works out, maybe you folks would find it useful in the core? I'll let you know how it goes.

  • wojt
    Avatar
    Community Member
    2 Posts

    Re: Short Codes (or Extending BBCode) in the Forum Module Link to this post

    Hi johnmblack, have you managed to implement short codes in forums? I'd like to do exactly the same.

    Regards,
    wojt

  • johnmblack
    Avatar
    Community Member
    61 Posts

    Re: Short Codes (or Extending BBCode) in the Forum Module Link to this post

    I'm actually not on that project anymore since last year; but I think the rest of the team worked something else out. I'll reach out to the current developers to see if they ever solved this, and if so, how.

    -John

    1034 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.