VicToMeyeZR Posted January 1, 2010 Share Posted January 1, 2010 I am trying to add custom content to homepage. I ran {include file="file.php"} and in that file put in the $smartyvalues["value"] = "Content"; but it is not showing. I ran the {debug} console and the file is being included, but the content is not. Is custom PHP not able to be included this way? 0 Quote Link to comment Share on other sites More sharing options...
atDev Posted January 1, 2010 Share Posted January 1, 2010 Are you doing this in the template file? 0 Quote Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted January 1, 2010 Author Share Posted January 1, 2010 well yes, since the index.php in encoded, and I don't want to load my TPL files down with PHP. Smarty recommends against doing this, because of slow downs. 0 Quote Link to comment Share on other sites More sharing options...
thehost5968 Posted January 2, 2010 Share Posted January 2, 2010 I may be wrong but should this $smartyvalues["value"] = "Content";not be {php}$smartyvalues["value"] = "Content";{/php} 0 Quote Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted January 4, 2010 Author Share Posted January 4, 2010 I may be wrong but should this not be lol. um no. I actually need a staff member to reply to this. The PHP is in a PHP file, not in the TPL file. 0 Quote Link to comment Share on other sites More sharing options...
atDev Posted January 4, 2010 Share Posted January 4, 2010 If you are including file.php into your index TPL file then in file.php you should do something like: $this->assign('value','Content'); Because if you were to do it straight into the .tpl this is what would be used: {php}$this->assign('value','Content');{/php} 0 Quote Link to comment Share on other sites More sharing options...
thehost5968 Posted January 4, 2010 Share Posted January 4, 2010 lol. um then may be you should of opened tieckt? lol. um no. I actually need a staff member to reply to this. lol. um You own .php file will need to be the same as if it was being coded in your .tpl file else all othere PHP goes in to the main PHP file (Yes I now 90% of whmcs files are encoded). The PHP is in a PHP file, not in the TPL file. 0 Quote Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted January 4, 2010 Author Share Posted January 4, 2010 What I am getting at, is if your IN the TPL file, which is IN smarty, why would you assign a smarty value to something, thats a waiste of code. and if you look at this page... http://wiki.whmcs.com/Creating_Pages Is says exactly what I did. Thats what I meant by can not you not assign them from with in the include file? I will try the $this-> And if I open a ticket, then no one else will get to see the answer would they? 0 Quote Link to comment Share on other sites More sharing options...
thehost5968 Posted January 4, 2010 Share Posted January 4, 2010 But you are not "Creating Pages" a new page so that link is not valid. And while you are spending all this time on trying to get smarty "$smartyvalues["value"] = "Content";" code to display why do you not just put {php} your full STD PHP code{/php} in the include file. And as to I don't want to load my TPL files down with PHP. Smarty recommends against doing this, because of slow downs. there is not that much of a differences and this would stand more if the .php file was not encoded but as it is they "smarty" would also say just use {php}{/php} instead. 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.