In this article, we will walk you through the process of creating a custom page for our Lagom WHMCS Client Theme. Please note that building your own custom page requires basic HTML/PHP knowledge. WHMCS allows you to manually create custom pages for WHMCS templates. If you wish to find out more, please refer to WHMCS documentation (opens new window).
<?php
use WHMCS\ClientArea;
use WHMCS\Database\Capsule;
define('CLIENTAREA', true);
require __DIR__ . '/init.php';
$ca = new ClientArea();
$ca->setPageTitle('Your Page Title Goes Here');
$ca->initPage();
//$ca->assign('custompage', 'full'); // Uncoment this line if you'd like your page to be full width, it is necessary for pages like: https://lagom.rsstudio.net/demo-whmcs/index.php?rp=/store/website-builder
//$ca->requireLogin(); // Uncomment this line to require a login to access this page
# Define the template filename to be used without the .tpl extension
$ca->setTemplate('custom-page');
$ca->output();
Your Page Title Goes Here
in the following code line $ca->setPageTitle('Your Page Title Goes Here');
..tpl
extension in this code line $ca->setTemplate('custom-page');
..tpl
file in the /templates/lagom2
folder. The file name should be the same as the value which you have configured in step 5. In our case, it will be custom-page.tpl
.<h3>Hello World!</h3>
<p>This is my first custom WHMCS page</p>
The newly added page will be available under the following URL https://www.your-domain-name.com/custom-page.php
.
To ensure the page appears in the pages list within our addon, you must create a template for it. Please refer to the Create New Page Template (opens new window) article for detailed instructions.