Categories > TinyButStrong general >

Can't display header correctly??

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Kaisifus
Date: 2010-04-25
Time: 01:05

Can't display header correctly??

Hi, this is my first time using the TBS system, I am having some trouble getting my php script to output corrrectly. It is the header for my website, and I am currently using
<!--[onload.theHeader;comm]-->
to display it, but the problem is that it only displays the HTML source code of the variable as opposed to actually rendering the output in HTML. I'm pretty sure this is just a basic beginners mistake, but I have spent about an hour now reading the manual and just can't figure it out. Any help is gladly appreciated.
By: Skrol29
Date: 2010-04-26
Time: 00:16

Re: Can't display header correctly??

Hi Kaisifus,
<!--[onload.theHeader;comm;htmlconv=no]-->
By: Kaisifus
Date: 2010-04-26
Time: 01:20

Re: Can't display header correctly??

Cheers for the help, I was messing around with that one, but had it in my head the opposite way round
By: Kaisifus
Date: 2010-04-27
Time: 19:44

Re: Can't display header correctly??

O.K., I think I understand this syntax a little more, but I need a little clarification. If I wanted to load the variable $theHeader from the file header.php in my template, would the code be:

[onload;file=[var.header];comm;htmlconv=no]

?
By: TomH
Date: 2010-04-27
Time: 20:49

Re: Can't display header correctly??

You are asking about reading in a PHP file which would be considered a 'script' which TBS will be treating as code to be interpreted (as opposed to an HTML template to be rendered directly).
That would be a two step...
PHP
$filename="header.php";
template
[onload.filename;file=[val];subtpl]

And yes, the header.php file could be a script that uses TBS class and has a template called from within as well.
By: Kaisifus
Date: 2010-04-27
Time: 22:41

Re: Can't display header correctly??

O.K. that makes sense, but where would I go about placing the $filename variable so that it would be accessible site wide? I currently have the equivalent in my index.php file, but that means as soon as they leave, it dissapears
By: TomH
Date: 2010-04-28
Time: 12:40

Re: Can't display header correctly??

Well, the way I do it is to set up a PHP auto_prepend file.

In that file I put all my code/statements to initialize TBS and the plugins, my database access class and the db login info, some miscellaneous custom functions, and all the config vars for the application.

That way everything gets included automagically into all php pahes site wide.