Hi All,
I'm trying to use this tag:
global $gCms;
$hm =& $gCms->GetHierarchyManager();
$curnode =& $hm->getNodeById($gCms->variables["page_id"]);
$curcontent =& $curnode->GetContent();
echo 'Page URL: ' . $curcontent->GetURL();
in the page template, and it gives me:
Page URL: http://DOMAIN.COM/index.php/page-alias
But the REAL URL of that page is:
Page URL: http://DOMAIN.COM/index.php?mact=_page- ... eturnid=56 .....
So How can I retrive the COMPLETE URL that I actually see in the browser url bar?
Thanks!
Page URL tag to show complete url
Re: Page URL tag to show complete url
There's a pretty standard php recipe for that:
Code: Select all
$uri = 'http'. ($_SERVER['HTTPS'] ? 's' : '') .'://'. $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
[solved] Re: Page URL tag to show complete url
Code: Select all
$uri = 'http'. ($_SERVER['HTTPS'] ? 's' : '') .'://'. $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
i want to be able to use the above $uri value in a comparison string within a modules template.
UPDATE
Used smarty to retrieve what I needed.
Code: Select all
{$smarty.get.page}
Last edited by geepers on Fri Jun 05, 2009 4:48 pm, edited 1 time in total.