zomex Posted March 31, 2011 Share Posted March 31, 2011 Hello everyone, I'm currently working on a WHMCS template and need some help with 1 area. What I need to do is allow the users to set for example their web hosting plan price in one file which is then applied across the template. I would really like to be able to create custom language snippets in the language files but I haven't been able to find out if this is possible. In the mean time I'm using the following: {php} $whp1_price = "4.00"; {/php} which is then applied with: ${php} echo $whp1_price; {/php}/month The problem is that if I add the top code to the header.tpl file the code to display the option won't work. The only way to get this to work is to add the top code to each page where it's used. The problem with this is that it then means updating multiple pages with the options. Does anyone know of a better way? Thanks, Jack 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 31, 2011 Share Posted March 31, 2011 http://www.smarty.net/docs/en/language.function.assign.tpl 0 Quote Link to comment Share on other sites More sharing options...
zomex Posted March 31, 2011 Author Share Posted March 31, 2011 Thanks Sparky, Works perfectly. 0 Quote Link to comment Share on other sites More sharing options...
zomex Posted April 1, 2011 Author Share Posted April 1, 2011 Hello Sparky, Everything is working great but I do get the following error in the WHMCS log: Smarty Error: [in template/header.tpl line 55]: syntax error: expecting '=' after attribute name 'nocache' (Smarty_Compiler.class.php, line 1591) Would the following have the same effect? {assign var="color" value="red" cache="nocache"} I tried it for one and the variable still works but it's probably easier to ask than change everything only for it not to be right Thanks in advance for any assistance. Jack EDIT: I'm currently using the following which is one of the examples given: {assign var="color" value="red" nocache} 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted April 1, 2011 Share Posted April 1, 2011 Sorry... gave you the wrong link. That was for the smarty V3 docs whmcs is still on V2 http://www.smarty.net/docsv2/en/language.custom.functions.tpl#language.function.assign 0 Quote Link to comment Share on other sites More sharing options...
zomex Posted April 1, 2011 Author Share Posted April 1, 2011 Thanks mate that's perfect. I just need to figure out how to add notes to the .tpl file that won't display in the source then everything is finished. 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.