Is this the best way to get the page URL when writing a user defined tag?
global $gCms;
$hm =& $gCms->GetHierarchyManager();
$pageinfo = &$gCms->variables['pageinfo'];
$content_id = $pageinfo->content_id;
$curnode =& $hm->getNodeById($content_id);
$curcontent =& $curnode->GetContent();
$current_url = $curcontent->GetURL();
... or is there some better/less_code way to do it?
Thanks!
rustyk
Question about getting the current page url in a user defined tag
Re: Question about getting the current page url in a user defined tag
Hi rustyk
Sorry for my late answer. A shorter way would be:
global $gCms;
$config =& $gCms->GetConfig();
$current_url = $config['root_url'] . "/" . $_GET['page'];
Have a good time.
so what?
Sorry for my late answer. A shorter way would be:
global $gCms;
$config =& $gCms->GetConfig();
$current_url = $config['root_url'] . "/" . $_GET['page'];
Have a good time.
so what?
Last edited by so what? on Fri Nov 28, 2008 6:12 pm, edited 1 time in total.