charliez Posted July 14, 2008 Share Posted July 14, 2008 Is there a template variable that returns de current page URL? {$url} I want to change my sidebar depending on the page I am in... I could use $pagetitle but some pages have the same title like Domianchecker and BulkDomainchecker.... plus I do not have control over the title of the pages.... (I think )... 0 Quote Link to comment Share on other sites More sharing options...
charliez Posted July 14, 2008 Author Share Posted July 14, 2008 I tried $smarty.get.page as the Smarty manual suggests, but it does not work... I also placed {$debug} in my sidebar to get the list of all the template variables, as by the manual, but nothing shows up ??? appreciate any help with this... 0 Quote Link to comment Share on other sites More sharing options...
charliez Posted July 15, 2008 Author Share Posted July 15, 2008 Solution: 1) use $SCRIPT_NAME and if statements to decide between pages. It only gives you a part of the url, /whmcs/cart.php or /whmcs/domainchcker.php. But it is useful... 2) for more control combine $SCRIPT_NAME with $pagetitle in the if statements 3) for ultimate control assign your own variables {php} $smarty->assign('page1', 'www.domain.com/whmcs/cart.php?a=add&pid=1'); $smarty->assign('page2', 'www.domain.com/whmcs/cart.php?a=add&pid=2'); $smarty->assign('page3', 'www.domain.com/whmcs/cart.php?a=view'); {/php} and then use it later in your template as: {$page1}, {$page2} and {$page3} and combine them with $pagetitle hope this helps... 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.