earthgirlllc Posted July 16, 2020 Share Posted July 16, 2020 I'm learning to create addon modules and not able to find documentation on using an addon to modify, or replace, a tpl file. I know how to use hooks to add fields, but there are fields I want to hide entirely (without using CSS/Javascript) when a module is enabled. What's protocol for this? Thanks! 0 Quote Link to comment Share on other sites More sharing options...
earthgirlllc Posted August 6, 2020 Author Share Posted August 6, 2020 Per WHMCS support, this cannot be done. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted August 7, 2020 Share Posted August 7, 2020 Your only option is jQuery. Only few pages of admin area have a tpl file. Anyway with jQuery you can do pretty much anything. 1 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 7, 2020 Share Posted August 7, 2020 10 hours ago, earthgirlllc said: Per WHMCS support, this cannot be done. I wouldn't treat statements like that from WHMCS Support as gospel or definitive - it usually just means that they don't know how to do it, not that it cannot be done.... and I speak from once being told that very same thing about another issue, that I was able to resolve myself within an hour. 0 Quote Link to comment Share on other sites More sharing options...
Wouter0100 Posted August 7, 2020 Share Posted August 7, 2020 (edited) Replacing a tpl file with your own is sometimes possible, but what's your ultimate goal to achieve? Sometimes it's enough to create a different page in a module, and redirect the customer to it. Regardless, the procedure to replace a tpl file depends on which one you'd like to replace. In some of them, you can listen to the `ClientAreaPage` hook and replace the tpl file in one of the params. Otherwise, doing a `global $smarty` could also give you access to the smarty object to further manipulate the response. 1 hour ago, brian! said: I wouldn't treat statements like that from WHMCS Support as gospel or definitive - it usually just means that they don't know how to do it, not that it cannot be done.... and I speak from once being told that very same thing about another issue, that I was able to resolve myself within an hour. And most of the time this means that it can't be done by default in WHMCS. But, in my experience you can get way more done using code if you know the WHMCS core a bit. Edited August 7, 2020 by Wouter0100 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.