Jump to content

{$pagetitle}


kmm2908

Recommended Posts

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.

Link to comment
Share on other sites

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. :idea:

Link to comment
Share on other sites

Would be nice to have a central reference for all the functions, template variables and development tips; is there one somewhere?

in my head? :twisted:

 

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 ! :roll:

 

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated