The CodePlex page is not maintained anymore, but still here for historical reference.
Documentation
Usage
After installing and enabling the module, you can use the filter in the following ways. Note that either way, if you want to have the default styling the module includes you have to include the piedone-bbcode-styles.css stylesheet (or the "BBCode" resource) on the pages you have BB codes.
As a Body flavor
You can set the flavor to "bbcode" (case-insensitive) on the Body of the contenty type(s) you want to have BBCode support.
As a filter on arbitrary strings
Just request an IBBCodeFilter instance in the constructor of the class you want to use it (this is standard dependency injection in Orchard) and use the object's Parse() method.
Note that the string to be parsed is html encoded before parsing, therefore the result will be html encoded too!
As an html helper
Add the @using Piedone.BBCode.Extensions; directive to the top of the Razor view. Then you can use the new Html.ParseBBCode() helper to parse BB codes in-place.
Note that the string to be parsed is html encoded before parsing, therefore the result will be html encoded too!
Supported tags
The default tags are: b, i, u, s, code, img, quote, sup, sub, url (all in the standard BBCode form). Use the
BBCode test text to test the parser.
You can add new tags or remove defaults with the IBBCodeFilter's AddTag() and RemoveTag() methods. Since the filter uses
Codekicker.BBCode internally, you have to supply AddTag() with a BBTag object.
Styling
Just look at the default stylesheet included in the Styles folder. Override the styles in your theme's stylesheet as you like.
Version history
- v1.2.4 (19.11.2012):
- Updating to VS 2012 project file
- Small enhancements and fixes
- v1.2.3 (12.01.2012): Made Orchard 1.4-proof
- v1.2.2 (13.12.2011): Emergency bugfix
- v1.2 (13.12.2011): Improved inner workings
- v1.1 (12.11.2011): Improved inner workings, bugfixes and new html helper
- v1 (06.11.2011): First public release