kmm2908 Posted November 8, 2016 Share Posted November 8, 2016 I am adding a custom tracking code that will run on all pages so it's placed in footer.tpl However, I need to set some of the parameters based on the page being displayed, is there a list of page titles that I could access via the {$pagetitle} variable? Specifically for now: complete.tpl viewcart.tpl (all of the cart stages if possible so we can track cart fall offs) Thanks in advance for any help. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 8, 2016 Share Posted November 8, 2016 does {$pagetitle} change during the cart stages - I think it's always "Shopping Cart" (or the language equivalent) isn't it? if you need to know where you are in the process, $templatefile may be a better bet... e.g on products.tpl, it's value is "products" you could add {debug} to each of the templates if you wanted to get a popup of variable values for that page... but if memory serves, the templatefile values are the same as the template name minus the tpl extension. 0 Quote Link to comment Share on other sites More sharing options...
kmm2908 Posted November 9, 2016 Author Share Posted November 9, 2016 Thank you that makes a lot of sense. Would be nice to have a central reference for all the functions, template variables and development tips; is there one somewhere? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 9, 2016 Share Posted November 9, 2016 Would be nice to have a central reference for all the functions, template variables and development tips; is there one somewhere? in my head? there's the Documentation for general guidance - http://docs.whmcs.com - but that's all it's useful for, guidance - there's no guarantee that it's going to be a) accurate, b) well maintained or even c) useful ! you'll get the occasional forum post from a user who tries to list the available variables in the email templates or elsewhere - but unless they plan to regularly update it after each WHMCS update, it would quickly become outdated - if you want to know what variables you can access in a template, as I said earlier the easiest way is to just add {debug} to the end of the template code and you'll get a popup window of Smarty variables and arrays.. if what you want to use is in there, you're good to go... if it's not, then the next step is to figure out how to get what you need. 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.