Post Problem

ScottLott

Member
Hey Guys,
I'm trying to get a thread to display inside a page node.

So far I've go this code:
PHP:
class scootloot_ShowBlogStyle
{
    public static function showThreadsinPage(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response)
    {
   
        $threadToRender = 14;

        $visitor = XenForo_Visitor::getInstance();
        $request = new Zend_Controller_Request_Http();
        $request->setParam('thread_id', $threadToRender);
        $responseForum = new Zend_Controller_Response_Http();
        $routeMatch = new XenForo_RouteMatch();

        $controllerThread = new XenForo_ControllerPublic_Thread($request, $responseForum, $routeMatch);
        $controllerResponse = $controllerThread->{'actionIndex'}();
        $controllerResponse->params['visitor'] = $visitor->toArray();

        $threadList = new XenForo_Template_Public('thread_view', $controllerResponse->params);

        $response->params['displayThreads'] = $threadList;

        return $response;
    }
}

I'm using a PHP callback on the page node and using <xen:raw> to get the template to load, and it's SO close to working.

There's just one snag, the contents or "message" of each post aren't showing up, at all.

I var dumped the "$post" variable (which is what the template uses to render the thread posts) and saw that the messages are actually there, the view controller just isn't rendering them into the template.

Any ideas?
 
Top Bottom