graisbeck Posted April 16, 2017 Share Posted April 16, 2017 I'm wanting to add a terms of service page to my WHMCS site, but I'm confused as to which would be the best option. Do I create a tos.tpl and use includes to incorporate the header.tpl and footer.tpl or do I just copy and paste the header and footer code into my tos.tpl? Also, if I wanted to add it as a menu item in the top menu of WHMCS portal, how would I go about it? Thanks in advance for any help. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 16, 2017 Share Posted April 16, 2017 I'm wanting to add a terms of service page to my WHMCS site, but I'm confused as to which would be the best option. Do I create a tos.tpl and use includes to incorporate the header.tpl and footer.tpl or do I just copy and paste the header and footer code into my tos.tpl? there is a free addon in Marketplace that can do this for you - Terms of Service. but if you want to do it yourself, then your best bet might be to create a terms.php in the root of your WHMCS (e.g the same folder as configuration.php) and use similar code to below to create the parent page... <?php use WHMCS\ClientArea; define('CLIENTAREA', true); require __DIR__ . '/init.php'; $ca = new ClientArea(); $ca->setPageTitle(Lang::trans('ordertos')); $ca->addToBreadCrumb('index.php', Lang::trans('globalsystemname')); $ca->addToBreadCrumb('terms.php', Lang::trans('ordertos')); $ca->initPage(); $ca->setTemplate('terms'); $ca->output(); and then in your chosen template folder (e.g Six), create the terms.tpl template with your T&C formatted to however you want... Also, if I wanted to add it as a menu item in the top menu of WHMCS portal, how would I go about it? if you mean the navbar, then you'd need to use an action hook similar to below... e.g create a new .php file in /includes/hooks, call it termsnavbar.php and add the following code... <?php add_hook('ClientAreaPrimaryNavbar', 1, function($primaryNavbar) { $primaryNavbar->addChild('terms', array( 'uri' => 'terms.php', 'label' => Lang::trans('ordertos'), 'order' => 100, 'icon' => 'fa-gavel', )); }); and you'll get a link in the navbar... now, the exact hook code that you should use, will depend on exactly where you want to add the menu item, e.g is is primary (left side), is it secondary (right side - Account) and/or is it on it's own, or as part of an existing dropdown?? they can all be done, but would each require slightly different coding. the Navbar Cheatsheet from the documentation should help, but there are plenty of similar example hooks posted here in the forums - worst case, come back and tell us exactly where you want to add the link. 1 Quote Link to comment Share on other sites More sharing options...
graisbeck Posted April 19, 2017 Author Share Posted April 19, 2017 Thanks for the instructions brian! it was very useful. I used the addon module for the terms and created a page for my privacy policy then added an unordered list in the footer.tpl and linked to them both from there. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.