XF 2.2 How to display forum_list on a page with php callback

Marcus

Well-known member
Is it possible to get the forum_list template displayed on a custom page with php_callback? That would be too simple I guess.
 
Yes I think all you need is to copy the method from the Pub > Controller > Forum > assertViewableForum method and use it in your callback and you can use it as the way you want it.
 
Thanks, but is it possible to directly use the XF > Pub > Controller > Forum ... function without the need of a custom callback? My plan is to use the existing xf functions as a php callback to display forum_list on a page using php callback.
 
This only code will give you a list of nodes

PHP:
$nodeRepo = $this->getNodeRepo();
        $nodes = $nodeRepo->getNodeList();

        $nodeTree = $nodeRepo->createNodeTree($nodes);
        $nodeExtras = $nodeRepo->getNodeListExtras($nodeTree);

It's an existing xf functionality.
 
Back
Top Bottom