Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Here is a short (at the moment) list of tips and tricks you can use during developing/integrating HostBill templates.

General templating instructions

Can be found in this post: Link

Template cache

...

Sometimes your changes are not displayed immediately after modifying tpl file. To make it work you can:

  • clear contents of /templates_c files under your main HostBill directory
  • add &fcompile=true param to url you're viewing - this will force Smarty template engine to recompile your template

Enabling PHP tags in smarty templates

...

{PHP} smarty tags are disabled for security purposes from smarty library. You can enable them at your own risk by editing Smarty library:

...

Make sure not to overwrite your changes with upgrade.

Main Template file

...

Template file rendered when HostBill index.php is called without params is

...

Located in your template directory.

Previewing new template

...

If you're working on new template in separate directory under /templates [ex. /templates/myintegration/ ]dir you don't need to change your current template just to preview your changes. You can add &systemtemplate=myintegration param to url just to change current template for your session.

Debugging template

...

When you've made mistake in Smarty syntax you wont be able to see your template (it will rende render blank) - you can enable error reporting in /includes/config.php file of your HostBill to locate where error has been made.

Getting full list of available variables in template

...

  • since HostBill 2.8

In order to do so you need to enable Smarty debugging in /includes/libs/smarty/Smarty.class.php (its not encrypted). Edit line 103: Code:

...

Now with each page accessed smarty will pop-up debug console with list of all variables.

Including javascript code

...

If you wish to enter javascript code in your template files you need to enter them in {literal}{/literal} block - more info here: Link

...