JLHC Posted April 13, 2020 Share Posted April 13, 2020 (edited) I created a hook to change the Template a client will see depending on which Client Group they are lumped into:- <?php function clientgroupTemplate($vars) { $client = Menu::context('client'); $groupid = $client->groupid; if ($groupid == 1) { global $systpl; $systpl = 'MY_TEMPLATE'; $GLOBALS['_SESSION']['Template'] = 'MY_TEMPLATE'; $GLOBALS['CONFIG']['Template'] = 'MY_TEMPLATE'; } } add_hook("ClientAreaPage", 1, "clientgroupTemplate"); However, the hook seem to only work on the second load, which means that the client will first see the default Template after login and only after a refresh or going to the second page will they see MY_TEMPLATE. I tried disabling all other hooks to rule out any conflicts. Is this due to caching like OPCache or is there a better way to write this hook? Thank you. Edited April 13, 2020 by JLHC 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.