HawtDogFlvrwtr Posted June 20, 2011 Share Posted June 20, 2011 I'm in the process of trying to figure out how to change a template for WHMCS on the fly based on variables received. I've created a smarty plugin that detects browser type and was curious if there was a way to switch templates based on this information? Essentially I need a way to change the template variable before displaying the page to the user. I've tested the plugin and it's working perfectly to display custom information based on browser type. I just need to make the template change based on those rules. Thanks, Chris 0 Quote Link to comment Share on other sites More sharing options...
HawtDogFlvrwtr Posted June 28, 2011 Author Share Posted June 28, 2011 Any ideas? In theory, this is the same as letting a user pick their template. Does this exist? I just need to select another template to display on the fly. Thanks 0 Quote Link to comment Share on other sites More sharing options...
Alistair Posted June 28, 2011 Share Posted June 28, 2011 To change template you can add ?systpl=TemplateName to the end of your URL. For example: http://www.site.com/whmcs/index.php?systpl=Template1 http://www.site.com/whmcs/index.php?systpl=Template2 http://www.site.com/whmcs/index.php?systpl=Template3 etc. I'm not sure if that's what you mean, but maybe it will help someone. 0 Quote Link to comment Share on other sites More sharing options...
HawtDogFlvrwtr Posted June 28, 2011 Author Share Posted June 28, 2011 I think I can use that. I did another search right after i re-posted a bit ago and found the same thing. The good thing is, it persists the session nicely. Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Alistair Posted June 28, 2011 Share Posted June 28, 2011 No problem. Yes - after a while it will revert to the template you have set as your default in your Admin panel. 0 Quote Link to comment Share on other sites More sharing options...
HawtDogFlvrwtr Posted July 7, 2011 Author Share Posted July 7, 2011 One more thing. Is it possible to do something similar for the order form template? 0 Quote Link to comment Share on other sites More sharing options...
Alistair Posted July 8, 2011 Share Posted July 8, 2011 Yes, you can use: cart.php?carttpl=cart-template-name 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.