1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Parsing BBCode

Discussion in 'XenForo Development Discussions' started by Lee, Jun 22, 2013.

  1. Lee

    Lee Well-Known Member

    Is there a way in the template to parse BBCode, like xen:raw parses HTML?

    I have a pagenode which runs a query on the post table using a callback, and I want to parse the BBCode.
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Yeah.

    You will need to check it out in more detail, but essentially if you can pass the BB code parser as a parameter to the template ( I think ) then you can do something like this:

    {xen:helper bbCode, $bbCodeParser, $content.message}

    EDIT: I said "I think". I might be wrong. You may very well just be able to use $bbCodeParser in the template without passing it.

    Check it out. It's used on the BB Code Help page so you could check out XenForo_ControllerPublic_Help
     
    Lee likes this.
  3. Lee

    Lee Well-Known Member

    Cheers Chris, i'll let you know if I get something working!
     

Share This Page