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.

Forum Module

Discuss the Forum Module.

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

Short Codes (or Extending BBCode) in the Forum Module


5 Posts   1073 Views


20 October 2011 at 4:44am Community Member, 61 Posts

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




20 October 2011 at 4:55am Forum Moderator, 1796 Posts

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


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


20 October 2011 at 5:56am Community Member, 61 Posts

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.


10 January 2013 at 9:56am Community Member, 2 Posts

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



10 January 2013 at 10:49am Community Member, 61 Posts

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.