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

XF 2.0 $postsOnPage in post_macros template?

im searching for a solution to get the posts on page count in post_macros template.
In the thread_view template I could do something like this:

$postsOnPage = count($posts);
Should I extend the post controller to get the count in the $post object or exist it somewhere?

Chris D

XenForo developer
Staff member
You can probably do this, but not tested:
{{ count($__globals.posts) }}
$__globals gives you access to the parent variable scope.