Jump to content

Modifying Template with Addon Module


Recommended Posts

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!

Link to comment
Share on other sites

  • 3 weeks later...
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.

Link to comment
Share on other sites

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 by Wouter0100
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated