how to get the current url in a user defined tag [SOLVED]
Posted: Sun Feb 14, 2010 3:33 pm
Hello.
I am trying to get the current url in a user defined tag. I tried the method suggested on http://wiki.cmsmadesimple.org/index.php ... fined_Tags , and it did not work correctly. This is what it is:
global $gCms;
$hm =& $gCms->GetHierarchyManager();
$curnode =& $hm->getNodeById($page_content_id);
$curcontent =& $curnode->GetContent();
echo 'Page URL: ' . $curcontent->GetURL();
I also tried changing $page_content_id to $page_id, and $content_id (I looked at the template vars and I think $contnet_id is correct).
What happens is any content below the tag is simply not displayed.
Thanks in advance
Isaac.
I am trying to get the current url in a user defined tag. I tried the method suggested on http://wiki.cmsmadesimple.org/index.php ... fined_Tags , and it did not work correctly. This is what it is:
global $gCms;
$hm =& $gCms->GetHierarchyManager();
$curnode =& $hm->getNodeById($page_content_id);
$curcontent =& $curnode->GetContent();
echo 'Page URL: ' . $curcontent->GetURL();
I also tried changing $page_content_id to $page_id, and $content_id (I looked at the template vars and I think $contnet_id is correct).
What happens is any content below the tag is simply not displayed.
Thanks in advance
Isaac.