xxkylexx Posted April 29, 2006 Share Posted April 29, 2006 Hello, I am trying to do an include via the smarty .tpl templates for WHMCS. I know the smart command for a file include is {include file='header.php'}, however, this doesnt seem to be working... just displaying the text of the command. Any ideas on how I can do an include of my header.php and footer.php file within the .tpl template? Thanks. 0 Quote Link to comment Share on other sites More sharing options...
pxtek Posted April 29, 2006 Share Posted April 29, 2006 php commands does not function on a .tpl file. The only way to include header.php and footer.php is to actually paste the contents into the .tpl file ( my opinion ) 0 Quote Link to comment Share on other sites More sharing options...
xxkylexx Posted April 29, 2006 Author Share Posted April 29, 2006 Are these smarty .tpl templates? If so, you should be able to use the smarty include? {include file='header.php'} 0 Quote Link to comment Share on other sites More sharing options...
pxtek Posted April 29, 2006 Share Posted April 29, 2006 Not sure if these = smart .tpl templates but as the site indicated It includes .tpl files, and you included php files, this might make a difference. I guess it's worth a try. 0 Quote Link to comment Share on other sites More sharing options...
xxkylexx Posted April 29, 2006 Author Share Posted April 29, 2006 Yea, I tried including them as .tpl's, but no luck. Any other ideas on how I might be able to include files in these template files? 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted May 10, 2006 Share Posted May 10, 2006 Matt, let me help you migrate to the smarty template engine. I got a few ideas for keeping your components encrypted, but also allow full templating. 0 Quote Link to comment Share on other sites More sharing options...
xxkylexx Posted May 10, 2006 Author Share Posted May 10, 2006 I would love to be able to run includes with smarty templates. Would allow making edits to my headers and footers alot easier. 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted May 10, 2006 Share Posted May 10, 2006 if your just wanting to make header/footer changes, then powerful smarty isnt needed. Thats just a simple include. We need to template ALL presentation output of WHMCS IMHO. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted May 10, 2006 WHMCS CEO Share Posted May 10, 2006 Let me put some of my points of view accross on this issue. Firstly, the system doesn't not use Smarty because of fears about encryption. It doesn't use Smarty because it is a lot of work to make the whole system templated for such a very small gain. Only a few users would ever fully customise the look of WHMCS using all the templates and up until now at least it has been much more important to users to have new features and improvements on existing features than full capabilities to modify every little thing in the clients frontend of the system. In addition to that, every time an upgrade is released some templates will need to be overwritten to accomodate for the new features meaning some need to be created again. The whole system is devoloping so rapidly that once a lot of customisations have been made some users may not be inclined to upgrade and we do not offer support to any users not running the latest version of the system. However, if the demand is there, I will implement it so if Smarty is what everyone wants then this can become part of the system. In addition, if some of you are willing to help make the transition to this by taking the output from View Source and making the required Smarty Templates ready for data to be parsed into then the transition can be made even quicker. Matt 0 Quote Link to comment Share on other sites More sharing options...
MACscr Posted May 10, 2006 Share Posted May 10, 2006 Kind of hard to make smarty templates if you dont know how its being pushed to the template. =( As far as the upgrading situation, this is a way to do it. /whmcsroot/templates/core /whmcsroot/templates/custom You could even expand further and have subfolder for specific modules, would keep the directory structure a little cleaner. If someone wants to customize a template, they simply copy that file and put it in the custom folder. Any template that exists in the custom folder overides the template in the core folder. When the upgrade script runs runs, it creates two lists of templates, one with contents of core and the other with the contents of custom. It checks version numbers in the template header that will post a flag if the core template has been updated. If you wanted to, you could even have it rename the custom template to something like templatename.tpl.old. eh, its just an idea. Could explain further if you like. Smarty and encryption can work hand in hand just fine. MB is a great example of this. Developing a solid API and template engine will allow you to give access to a small part of the code, but encrypt your core code, thus protecting yourself (sidenote: you dont have to encrypt your code to protect yourself). I am definately not trying to make things harder on you, just making suggestions to make it easier and more profitable to you in the long run, and also provide more functionality to the end users. Your operation might be small right now, but I really think it could grow over 500% in just the next 12 months. I have only been a customer two days and have already referred a client that purchased two licenses from you. 0 Quote Link to comment Share on other sites More sharing options...
xxkylexx Posted May 11, 2006 Author Share Posted May 11, 2006 if your just wanting to make header/footer changes, then powerful smarty isnt needed. Thats just a simple include. We need to template ALL presentation output of WHMCS IMHO. But includes, as simple as they may be, can't be done without the .tpl's being smarty. Kyle 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.