Jump to content

how to link to template file


japes

Recommended Posts

Hopefully a stupid question, I have very little experience working with WHMCS and joined this project after it's been mostly set up

I need to load a template file for my "about.php" page. The template is "about.tpl".

How are these .php pages set up initially with the encoded php and how can I load my template whenever someone visits the about page?

 

 

 

Link to comment
Share on other sites

19 hours ago, japes said:

How are these .php pages set up initially with the encoded php and how can I load my template whenever someone visits the about page?

assuming there are no existing sidebars to be added, and you're not checking the users loggedin status, that example on the docs page can be simplified to...

<?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('about.php', 'Your Custom Page Name');
$ca->initPage();
$ca->setTemplate('about');
$ca->output();

it assumes that the about.tpl template is in your active template folder (e.g Six if you aren't using a custom theme).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated