Hook between init and template

When writing a plugin and runnit it on init / directly the Kirby has not loaded all the template stuff, like $page.

Here is an issue:


A plugin I made which forced me to user server variables


In my template

Right now in my testing environment I have this to solve the problem.

<?php do_before_template( $page ); ?>
<!DOCTYPE html>

I don’t think the function do_before_template() should need to be in my template at all.

Hook solution

To be able to do things with $page but before the template has loaded it would require something like a hook. In WordPress this is solved like this:


I think Kirby perhaps can make it this good or better, especially a better and more general name for it, like “before_template” or something.