Categories > TinyButStrong general >

I just found out something... is it normal?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: OverNode
Date: 2007-01-12
Time: 11:44

I just found out something... is it normal?

Hi Skrol29,
I found something about the 'script' and 'file' parameters.
My index.html template is in a subfolder, and here are the pages used:
index.php
main.php
/inc/classes/template.php (TBS)
/tpl/default_tpl/html/index.html
/tpl/default_tpl/html/footer.html
/tpl/default_tpl/html/header.html
/tpl/default_tpl/positions/left.php
/tpl/default_tpl/positions/right.php

Ok, I know, there's quite a bit of files..
So in the index.html template I have:
<table width="951" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td colspan="3">[onload;file='header.html']</td>
  </tr>
  <tr>
    <td>[onload;script='tpl/default_tpl/positions/left.php';subtpl]</td>
    <td>[onload;script='main.php';subtpl]</td>
    <td>[onload;script='tpl/default_tpl/positions/right.php';subtpl]</td>
  </tr>
  <tr>
    <td colspan="3">[onload;file='footer.html']</td>
  </tr>
</table>

So I just figured out that the 'file' parameter searches the files relatively to the position of index.html in the site while the 'script' parameter searches the files relatively to the file(here index.php) in which the template(here index.html) is called.

Why is there such a difference?
Thanks for your answer

OverNode
By: OverNode
Date: 2007-01-12
Time: 11:49

Re: I just found out something... is it normal?

Aww, I can't edit my previous post :S
That's I wanted to add:
Also, I didn't see it mentionned anywhere in the manual, so that's why I mentionned it :)
Have a nice day,

OverNode
By: Skrol29
Date: 2007-01-15
Time: 19:09

Re: I just found out something... is it normal?

Hi,

This is probably because of this new feature in TBS 3.2.0 :
New feature: enhancement for files.
The LoadTemplate() method, and both parameters file and script also look their file in the directory of the last opened template. It can be useful to simplify subtemplate inclusion.

I agree it is not mentioned for both parameter "script" and "file".
I will update the manual.
Thanks,
By: Skrol29
Date: 2007-01-15
Time: 19:14

Re: I just found out something... is it normal?

Well in fact the feature is not working for parameter "script" in TBS 3.2.0.
That's probably why you have this difference.