Question about getting the current page url in a user defined tag
Posted: Sat Apr 12, 2008 12:07 am
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
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