Using Xenforo editor in an external page


Is there a simple way to embed the Xenforo editor from our forum (complete with the WYSIWYG functionality) into an external PHP page? Been looking for solutions and can't find any, perhaps I'm the only one crazy enough to even attempt this :)



XenForo developer
Staff member
What exactly are you trying to accomplish?

The XF RTE has a lot of PHP behind it to do various XF-specific elements (BB code conversion, most significantly). If you just want an RTE, you can use one of the various libraries to do it if you prefer.
We're building a custom CMS for our main site and in our admin side of it, want to be able to write news stories and have them automatically create a thread in our forum with the text for discussion. We need to write the posts in our CMS side of things because additional properties for the article, to deal with positioning and formatting need to be set. Creating a new thread from our custom PHP is no problem, I have that working. But we need a WYSIWYG editor for BBCode for our authors. The problem with using another RTE is that while syntax for the basic text formatting is pretty much standard, everyone seems to use a different format for video embeds.

I figured if we could use the XenForo RTE, it would spit out XenForo compliant BBCode I can use to create a new thread from our code, and use the XenForo parser for converting it to HTML to display on our front page, which I also have working. The RTE is the last piece of the puzzle.

It might sound like we're over-engineering this, but there's a method to our madness.


XenForo developer
Staff member
It's going to be a fairly extensive setup, as you'd need to bring the whole JS framework in and set it up, which likely assumes the whole page is a XenForo page. Honestly, I'm not sure how this step will go exactly, but it'd be necessary. In an ideal world, you may need to be rendering templates from XF to respect the configuration properly.

You'd then need to process the submitted HTML to BB code using the XF PHP code. This is probably the simpler part of things.