Script Tips

Wednesday, 15 February 2012 01:24

WHMCS Template viewer

Written by 
Rate this item
(0 votes)

How to view your WHMCS Template before you upload it

WHMCS uses Smarty templates which can be setup on your PC to view your changes before you upload them.
Of course there are some linits as the variables must be set for each page which make it a bit of a task.

But if all you want to do is edit the header and footer then I have done the work for you.

Create a index.php file and add the following to it.

 // put full path to Smarty.class.php
$smarty = new Smarty();

$smarty->assign('companyname',your title here');  //<<-- Your Company Title
$smarty->assign('systemurl','http://localhost/');  //<<-- place the url here
$smarty->setTemplateDir('templates/default');  //<<-- this and the next two must match exact your folder names.

$smarty->assign('template','default');  //<<- Set it to template folder name and do not change anything below this.
$smarty->assign('LANG' , array('hometitle'=>'Home','announcementstitle'=>'Announcements',
                                'networkstatustitle'=>'Network Status',
                                'affiliatestitle' => 'affiliatestitle','contactus'=>'Contact Us',
                                 'account'=>'Account','login' =>'Login', 'register'=> 'Register',
                                  'forgotpw'=> 'Forgot Password?'));

$smarty->debugging = false;
$smarty->caching = false;
$smarty->cache_lifetime = 120;


That's all you need - now download Smarty 3.x1.7 and copy your WHMCS template folder including all files in it and the includes/jscript folder to your PC

create a directory structure under your web folder as follows


That's it - you should be able to view the header and footer as it will look on your site in WHMCS.
There was one problem I had which was the menu didn't work under this proper. For some reason the background color didn't show on the default template and the drop down menu didn't work. This could be due to WHMCS using an older version of Smarty. ( ver 2.6.26)

But you really don't need those to work since they should be changed.
You can set the debug or the cache on if you wish but it's best to leave the cache off for development since you will need to view changes. Having the cache on will require you to erase the cache files in order to see changes made.

Have fun

Read 7017 times Last modified on Saturday, 25 April 2015 20:07

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.