Jump to content

URL Template variable


charliez

Recommended Posts

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 :?:)...

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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