Categories > TinyButStrong general >

Real life example? How to use a "general" template?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: jaitaran
Date: 2008-06-28
Time: 15:46

Real life example? How to use a "general" template?

I'm wondering how you solve the following situation:
most of the time, a website has a general layout, that is kept in 1 file, and the specific layout is kept in seperate files that are loaded for every page.

Something like this:
there is on template file that should hold the header & footer of the site, and for every page (login, show clients, ...), I'd like to load the appropriate parts from another file. There should be only one file that defines the header&footers of course.

How is that possible in TBS ?
By: Trent
Date: 2008-06-28
Time: 22:30

Re: Real life example? How to use a "general" template?

template.html
==============
<!--HEADER-->
BLAH BLAH
<!--/HEADER-->
<!--FILE TO LOAD-->
[onload;file=[var.tpl]]
<!--/FILE TO LOAD-->
<!--FOOTER-->
BLAH BLAH
<!--/FOOTER-->


page.php
========
$tpl = 'page.html';
.....
.....
$TBS = new clsTinyButStrong;
$TBS->LoadTemplate('template.html',false);
$TBS->MergeBlock('data',$data);
$TBS->Show();