Code: Select all
<script>console.log('ON: ' + {{ON_PAGE}});</script>
How can I get the current page number?
As a bonus question, is there any better documentation for the the available template variables? I'm finding out it depends on where you call them, but without adequate documentation they might as well be random. I've already spent hours scouring the forums and https://wiki.phpbb.com/Category:Template_Variables.
Bonus question v2: Why is phpbb 3.1 using twig 1.20.0? Has anyone updated to the latest version? The composer manifest just says "1.*", but the phpBB guide says only 1.13.2 is accepted. There's a dump() function in 1.5 (http://twig.sensiolabs.org/doc/functions/dump.html) that seems like it could be useful when determining what objects and variables are available, and when. Anyone tried twig 1.5? Are there any "safer" alternatives?
Thanks, I'm a fairly seasoned dev, but i'm really struggling with the proprietary, and limitations of some things in phpBB. I'm sure I'll get it, but tasks that should only take me a couple hours are taking days.