Feature Requests
Share ideas, discuss and vote on requests from other users in community
 
This object is in archive! 

Hook can override template file displayed

aisonet shared this idea 2 years ago
Under Consideration

I need the ability for a hook to override what template file is displayed to the client in the client area. I have a module that displays KB articles in WHMCS from an external API, and I want to use the templates that is setup for the client area and just pass template variables to the KB templates. Is not working since there are no KB articles/categories in WHMCS DB, it does a 301 redirect back to the main KB home template/URL. I need to be able to override this and display the KB article page for example. The templatefile variable passed in the return array does not over ride it and WHMCS support says its not possible apparently.

URL of page is /knowledgebase.php instead of displaying the knowledgebase.tpl it normally would, I want to override it and display knowledgebasecat.tpl or knowledgebasearticle.tpl for example. Example code that is not working in a hook file in the /includes/hooks folder:

function testfunction($vars) {

return array("filename"=>"knowledgebasecat");

}

add_hook("ClientAreaPage",11,"testfunction");