Media Sites HTML Callback of a TEMPLATE doesn't count as post content?

Jaxel

Well-known member
I have a BB Code Media Site that has an HTML Callback for the embed code. I am trying to make a post on my site that has ONLY a single bb code for this media site. I'm embedding a video, and the video is the only contents of the post.

If my HTML callback is as follows, it works fine:
Code:
    public static function embed($key, array $site)
    {
        return 'this is a test';
    }
However, if my HTML callback is as follows, I always get the error "Please enter a valid message.":
Code:
    public static function embed($key, array $site)
    {
        return new XenForo_Template_Public('My_Template', array('key' => $key));
    }
For some reason, the contents of the template are never considered in the length of the message.
 

Arty

Well-known member
Second code returns template object, not HTML code. You should call render() method and return code
Code:
public static function embed($key, array $site)
   {
       $template = new XenForo_Template_Public('My_Template', array('key' => $key));
       return $template->render();
   }
 
Top