KyleJ144 Posted February 4, 2018 Share Posted February 4, 2018 Hey I have bee trying for hours on how to create my own custom page as i want to create an "about us" page and when i follow any tutorial then i receive the 404 error code when trying to load the page, so i don't know if i am doing it correctly. Help is greatly appreciated and thanks in advance Link to comment Share on other sites More sharing options...
brian! Posted February 5, 2018 Share Posted February 5, 2018 21 hours ago, KyleJ144 said: I have bee trying for hours on how to create my own custom page as i want to create an "about us" page and when i follow any tutorial then i receive the 404 error code when trying to load the page, so i don't know if i am doing it correctly. did you follow the instruction in the documentation...? https://developers.whmcs.com/advanced/creating-pages/ you basically just need a .php (similar to the one above) in the WHMCS root folder and a template in your active /templates/ folder (e.g Six). as a VERY basic example, imagine you put a 'kyle.php' file in your WHMCS folder, which contains the following code... <?php use WHMCS\ClientArea; define('CLIENTAREA', true); require __DIR__ . '/init.php'; $ca = new ClientArea(); $ca->setPageTitle('Your Page Title Goes Here'); $ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname')); $ca->addToBreadCrumb('kyle.php', 'Your Custom Page Name'); $ca->initPage(); $ca->setTemplate('kyle'); $ca->output(); and in /template/six/ you add a 'kyle.tpl' template that just contains... hello world when you then visit kyle.php in the browser, you should see... as I said previously, this is a VERY basic example because i've removed the database/sidebar/loggedin features.... depending on what you want to do, you may need to add some of those features back in... but you should at least be able to create new pages now. Link to comment Share on other sites More sharing options...
Recommended Posts