Jump to content

.tpl Include?


xxkylexx

Recommended Posts

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.

Link to comment
Share on other sites

  • 2 weeks later...
  • WHMCS CEO

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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