ffans / bbcode-studio
Custom BBCode rules, media embeds, and composer buttons for Flarum.
Fund package maintenance!
v2.0.0-beta.3
2026-10-03 10:49 UTC
Requires
- flarum/core: ^2.0.0
- s9e/text-formatter: ^2.19
Requires (Dev)
- flarum/testing: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-03 10:56:31 UTC
README
A Flarum extension. Create custom BBCode, link recognition, and automatic media embedding rules, powered by s9e TextFormatter.
This extension was developed with AI assistance. Custom rendering rules can load third-party content, so administrators should review the service provider's privacy policy before enabling them.
Preview
Features
- Includes Bilibili, YouTube, Vimeo, Spotify and NetEase Cloud Music media embed rules, disabled by default.
- Includes Notice, Collapser, and KDB BBCode rules, disabled by default.
- Create, edit, reorder, enable, disable, delete, and test custom BBCode and media embed rules in the administration dashboard.
- Create a composer button and default inserted content for each BBCode.
Requirements
| Flarum version | Extension version | Branch |
|---|---|---|
| 2.x | 2.x |
2.x |
Installation
Install with Composer:
composer require ffans/bbcode-studio php flarum cache:clear
Enable the extension in the Flarum Dashboard.
Updating
composer update ffans/bbcode-studio php flarum migrate php flarum cache:clear
For Use
- Custom BBCode
- Custom BBCode rules define an s9e TextFormatter usage and rendering template, which are compiled and checked before saving.
- Custom BBCode roots receive
BbcodeStudio-bbcodeandBbcodeStudio-bbcode-{tag}classes for custom styling. - Custom BBCode can configure default tag attributes inserted by its composer button.
- Media embeds
- Automatically detect URLs and convert them into iframes or other embedded media based on rules.
- Media embeds define PHP PCRE-based rules that extract resource identifiers from URLs, along with player dimensions.
- Media roots receive
BbcodeStudio-mediaandBbcodeStudio-media-{tag}classes for custom styling. - Recognition rules extract resource identifiers directly from URLs, so you can't use a short link like
b23.tv, which have no video identifier in the slug. - Once a media embed is enabled, matching links in posts are automatically converted into responsive players. BBCode usage can also be enabled separately.
- Media rules can configure iframe attributes:
allowfullscreensupports forms with or without a value, whileallow,referrerpolicy, andscrollingrequire values.
Translations
To help translate this extension, visit Weblate.
