• 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?

#1
Hi,
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:

PHP:
$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
#2
You can probably do this, but not tested:
HTML:
{{ count($__globals.posts) }}
$__globals gives you access to the parent variable scope.