Loading...
 
Features / Usability

Features / Usability


Re: Adding a new template to Tiki

posts: 63 United Kingdom

Templates are assigned and displaid through SMARTY

Firstly, oif you edit that header information out, you'll need to provide it somewhere else to make the downloads actually happen. Which I'll assume you've already figured out.

An alternative method would be to create - whatever it is you're trying to display between the click and the download - as a new PHP and tpl combination which you edit into the file-galleries instead of tiki-download file, then you can show whatever you need to show there, which can included the necessary link to the file download or a meta-redirect to it etc.

Is that what ytou were after, there follows a short tutorial on calling templates, which I expect is not the answer to your question, but I already wrote it, so lets leave it be.

The proper method is to assign the contents of your template to the "mid" DIV of the tiki layout. then display the tiki.tpl, which will include the mid DIV thereby including your template in the middle of the page based on your configured layout.

the command is
$smarty->assign('mid', 'template_file.tpl'); $smarty->display("tiki.tpl");

which occurs inside the PHP file AFTER all the processing of the data for the page / error checking etc. takes place.

If you wanted to use your template INSTEAD of the tiki tpl - like the error.tpl file is displaid. You can call it directly using the command
$smarty->display("template_file.tpl");
which will override all the layout in tiki.tpl, unless you copy into your template.

The path and naming convention for templates is to place the template file in the /templates/ folder and the template file should be named the same as the PHP file.

Hope that helps :-)

RW

There are no comments at this time.