Categories > TinyButStrong general >

template within a template

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: burden
Date: 2004-03-23
Time: 07:46

template within a template

As RwD pointed out in another post, when you load a template within another template the original template is overwritten. Only solution would be to put the template as html in the original template. Well unfortunately i cannot do this, for the template is shared between my whole site. I was just wondering if this was the intended behavior. and if it's not then what am i doing wrong? or, if it is, then how do i get around it?
By: RwD
Date: 2004-03-23
Time: 09:27

Re: template within a template

To be exact I said that when you include a script that on its own calls LoadTemplate it will overwrite the original template.

This is kinda logical as it loads the new template into the variables that stored the older template.

I think the best way is to jus rewrite your code a little bit?

When from a template I include another template it looks more or less like this:

calling htm template:
<table width="100%" border="0" bgcolor="#FFFFFF" cellpadding=3>
<tr>
    <td>
    {box.page_template;file={var._dir_templ}{val};htmlconv=no;protect=no;noerr}
    </td>
</tr>
</table>

included template:
{scriptinclude;script={var._dir_templ}default.php}
{def.page_content;htmlconv=look;protect=no}

the script called from within the included template:
<?php
//* Making the needed variables available
global $tbs, $DB, $def, $query, $keep_encaps_cell;

//Merge the block by page
$tbs->MergeBlock(    'def'
    ,    $DB->Link_ID
    ,    $query );
?>
By: burden
Date: 2004-03-26
Time: 03:23

Re: template within a template

so i'm assuming _dir_templ = the template file to be included. here's the problem though. i have one template that i use mainly for the whole site. so it isn't just logical to say "okay, here's the template for page 24" in the middle of page everything. think of it as a moduled site. when this.php is requested from the central script, that central script will grab page24, insert it into the script, and, theoretically, have more templated elements that would hopefully be executed and inserted into the content area of the original template/site. does that make sense? it would be really awesome if i could talk to you, or anyone else in some sort of real time chat. IM, irc, whatever.
By: RwD
Date: 2004-03-26
Time: 06:57

Re: template within a template

_dir_templ is one of the directory variables. In this case {var} is the actual template, _dir_templ just points to where all templates are

I do not understand the rest of you post, but I can say I do not have templates call templates unless the called template is a header, footer or a general template for that part.

do you have msn?
you can send me your msn address or post it here and I will add you
remove the SP.AM from my emailaddress and make it a .
By: RwD
Date: 2004-03-26
Time: 08:37

Re: template within a template

ps, rwd@rwd.tmfwebSP.AMnl without the SP AM is not my msn address. It is just my emailaddress