Basic Development

- Do I need that “index.php” outside the template folder?
Initially I have to say, yes you do. This file as it parses all the requests that don’t have actual files linked to them (aka 404 errors). As most of the URLs template blocks uses are “imaginary” it needs this parsing mechanism to analyze the URL and load up the correct template accordingly. But as the template engine is working on two levels: 1) providing static content internally and 2) wrapping around other scripts that provide the content externally, you may not need it if you are going to use it just for the second case. The reason it is not needed then is because the URL is parsed by the external script itself and not by index.php.

- Where is the engine? I need to code everything!
Yes, you will need to code - you will need to create markup. Template Blocks works in the background when compiling your template and aims (among others): to free you from the repetitive tasks of compiling the templates manually, to separate your code completely from the template and to help you bring out the logic you have in your mind and convert it in to a real structure effortlessly.

- Can Template Blocks work with another server setup?
At present, the engine works in a PHP-MySQL environment although it is possible to be ported in any platform. At the moment, this development is left for the end users that want these extra features.

- Can I rename the template folder (or put it somewhere else)?
Although the engine by design does give you the possibility to rename the template folder to anything you like it is not recommended as not all functions have been tested thoroughly for any given name or folder level. That means we do not guarantee it will work as well as it does under the “template” folder.

- Can I use variables in my HTML blocks?
Yes, you can use a number of variables and they will be replaced before outputting the content. Call them as such:
$Website = The Website Title
$Template_dir = where Template Block is located (used for paths)
$Title = The title of the section

- I want to have my own PHP classes and reference them in my PHP blocks.
That’s fine. The best way is to create your classes inside the “/template/admin/classes” folder, preferably one file for each different class. Then you can call them from a PHP block as usual…

Leave a Reply