CenterWeb 0 Posted January 25 Hello. I created 2 pages: page.php /public_html page .tpl /temaplates/mytemplate It looks good, but where do I add the text? This is how it looks page.php and page.tpl <?php use WHMCS\Authentication\CurrentUser; use WHMCS\ClientArea; use WHMCS\Database\Capsule; define('CLIENTAREA', true); require __DIR__ . '/init.php'; $ca = new ClientArea(); $ca->setPageTitle('Termeni și Condiții '); $ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname')); $ca->addToBreadCrumb('termeni-si-conditii.php', 'Termeni și Condiții'); $ca->initPage(); //$ca->requireLogin(); // Uncomment this line to require a login to access this page // To assign variables to the template system use the following syntax. // These can then be referenced using {$variablename} in the template. //$ca->assign('variablename', $value); $currentUser = new CurrentUser(); $authUser = $currentUser->user(); // Check login status if ($authUser) { /** * User is logged in - put any code you like here * * Use the User model to access information about the authenticated User */ $ca->assign('userFullname', $authUser->fullName); $selectedClient = $currentUser->client(); if ($selectedClient) { /** * If the authenticated User has selected a Client Account to manage, * the model will be available - put any code you like here */ $ca->assign( 'clientInvoiceCount', $selectedClient->invoices()->count() ); } } else { // User is not logged in $ca->assign('userFullname', 'Guest'); } /** * Set a context for sidebars * * @link http://docs.whmcs.com/Editing_Client_Area_Menus#Context */ //Menu::addContext(); /** * Setup the primary and secondary sidebars * * @link http://docs.whmcs.com/Editing_Client_Area_Menus#Context */ # Define the template filename to be used without the .tpl extension $ca->setTemplate('termeni-si-conditii.tpl'); $ca->output(); 0 Quote Share this post Link to post Share on other sites
DennisHermannsen 109 Posted January 25 You would add your HTML inside of /templates/<your theme>/termeni-si-conditii.tpl. The $ca->setTemplate function specifies the name of the template file to be used for the page. 0 Quote Share this post Link to post Share on other sites
CenterWeb 0 Posted January 29 I found what needs to be added to mypage.tpl and it doesn't work. What am I doing wrong? <h3>This is my custom WHMCS page's content</h3> <p>I used the code found <a href="https://developers.whmcs.com/advanced/creating-pages/" target="_blank" title="Click here to navigate to WHMCS Support to obtain the code needed for creating a custom page.">here</a>.</p> <p>I put that code into a file named: </p> <p><code>termeni-si-conditii.php</code>, which resides in the root directory (where my WHMCS is installed).</p> <p>Now, I can write HTML into the file named:</p> <p><code>termeni-si-conditii.tpl</code>, located in the templates/six/ directory. Any HTML I save into that file, will be displayed on my new custom page.</p> 0 Quote Share this post Link to post Share on other sites
CenterWeb 0 Posted March 3 (edited) WHERE CAN ADD TEXT!!!!!???? Edited March 4 by CenterWeb 0 Quote Share this post Link to post Share on other sites
DennisHermannsen 109 Posted March 4 You don't put .tpl in the $ca->setTemplate() function. 1 Quote Share this post Link to post Share on other sites
CenterWeb 0 Posted March 4 Now it works perfectly. THANK YOU! 0 Quote Share this post Link to post Share on other sites