GORF Posted April 24, 2009 Share Posted April 24, 2009 Using the standard "Creating Pages" structure, I would like to dynamically generate the .tpl file contents. Let's say I have a (global?) variable $content that contains what would normally be in a .tpl file: <p><b>This is the stuff!</b><br>New things happening...</p> <p>TEST = {$test}<p> <p>{$something}<p> If I simply put {$content} in the .tpl file, the end result is verbatim. I have played with eval() and other things to no avail. Anyone have any direction? 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted April 24, 2009 Share Posted April 24, 2009 If I simply put {$content} in the .tpl file, the end result is verbatim. {php} echo $content; {/php} 0 Quote Link to comment Share on other sites More sharing options...
GORF Posted April 24, 2009 Author Share Posted April 24, 2009 Rob, I tried that with no luck. The Smartyvalues for $test and $something are getting to the .tpl from the .php file but I can't get the $content working. I guess this weekend will be sitting down with the Smarty site for some long reading!! If I can get past this, I think I will have the next cool thing since sliced bread 0 Quote Link to comment Share on other sites More sharing options...
annomander Posted April 24, 2009 Share Posted April 24, 2009 I'm not fully understanding the question, but I've hit a rock with rename the $pagetitle variable so when I needed I can up with another solution. {php}$this->assign('pagetest',$_SERVER['REQUEST_URI']);{/php} and the did a test on: $pagetest eg: {if $pagetest == '/submitticket.php?step=4'}Do something here{/if} The problem I found is that its pretty easy to change the $pagetitle in relevant tpl, the problem is this isn't carried across to the header or footer file :-/ 0 Quote Link to comment Share on other sites More sharing options...
GORF Posted April 26, 2009 Author Share Posted April 26, 2009 Found it! {eval var=$content} in the template file where $content is assigned in the php file as $smartyvalues["content"] = $content; 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.