{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Client Area Output","description":"Developer documentation for the WHMCS API — the","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"client-area-output","__idx":0},"children":["Client Area Output"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Another key function of a module is to give clients access to extra options and output within the client area. Done either on the product details page (using the ClientArea function of a module), or as a ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/provisioning-modules/custom-functions#example-function","title":"Custom Function Example"},"children":["custom function/action"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"product-details-page-output","__idx":1},"children":["Product Details Page Output ",{"$$mdtype":"Tag","name":"a","attributes":{"id":"product-details-output"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Creating output to display on the same page as the product details in the client area is easy."," ","Create a template file named “clientarea.tpl” within the module folder."," ","This template file will process as a Smarty template file."," ","This means it can make use of Smarty variables."," ","The variables will be the same module vars as passed to every module function."," ","Also, other smarty functions such as logic functions are available."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["More advanced actions, such as performing API Calls or defining variables for the output are possible."," ","A ClientArea function within the module that runs any code and returns an array with the template file to use, and any variables desired besides the defaults."," ","Returning different template file values based on data in the $_GET or $_POST array data, allows for many pages which can have direct links."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"function mymodule_ClientArea($vars) {\n    return array(\n        'templatefile' => 'clientarea',\n        'vars' => array(\n            'test1' => 'hello',\n            'test2' => 'world',\n        ),\n    );\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"custom-pages","__idx":2},"children":["Custom Pages ",{"$$mdtype":"Tag","name":"a","attributes":{"id":"custom-pages"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Situations that need a custom page, rather than output on the existing product details page, are possible."," ","Done using ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/provisioning-modules/custom-functions#example-function","title":"Custom Function Example"},"children":["custom functions"]}," as described earlier, with that function returning an array as follows:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"function mymodule_mycustomfunction($vars) {\n    return array(\n        'templatefile' => 'customfunc',\n        'breadcrumb' => array(\n            'stepurl.php?action=this&var=that' => 'Custom Function',\n        ),\n        'vars' => array(\n            'test1' => 'hello',\n            'test2' => 'world',\n        ),\n    );\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Clients then need access to use this function, and a link in the product details page."," ","Do this using the methods described in the previous '",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/provisioning-modules/custom-functions#example-function","title":"Custom Function Example"},"children":["Custom Functions"]},"' section."]}]},"headings":[{"value":"Client Area Output","id":"client-area-output","depth":1},{"value":"Product Details Page Output","id":"product-details-page-output","depth":2},{"value":"Custom Pages","id":"custom-pages","depth":2}],"frontmatter":{"title":"Client Area Output","seo":{"title":"Client Area Output"}},"lastModified":"2026-08-03T17:00:42.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/provisioning-modules/client-area-output","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}