Categories > TinyButStrong general >

Set tplvars from PHP-side?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Scythe
Date: 2008-12-12
Time: 16:08

Set tplvars from PHP-side?

Hey guys, I have a question I could use a little help with.

I currently have a header defined by doing the following:
[onload;tplvars;template_js='login';template_css='login']
[onload;file=header.tpl;]
Within header.tpl, using the passed in template_js and template_css variables -- I determine which CSS files and JS files to include.

So, that works like charm. The problem I'm having is that I have a login box in the header.tpl, that I don't want to display if the user is logged in.  In the session, I have a check to see if the user is indeed logged in, which if I could pass off to the template I could simply use to set a magnet within the div. The variable for that is:
$_SESSION['user_logged_in']

I tried passing it off to header.tpl like the tplvars within the main template itself, via:
$TBS->TplVars['user_logged_in'] = $_SESSION['user_logged_in'];

This however doesn't work at all.  Any thoughts on how to pass it in (I'm trying to avoid a simple: [var.user_logged_in] and making it a bit cleaner)
By: TomH
Date: 2008-12-12
Time: 18:20

Re: Set tplvars from PHP-side?

Please post the actual code in header.tpl so we can see what you're doing there