I named this topic after an exiting one, available at the following address, but "more than 120 days old" and suggesting to start a new one to get an answer.
http://forum.cmsmadesimple.org/index.php/topic,13267.30.html
I wrote a simple User Defined Tag that is supposed to give me the alias of a modified page. The idea is to develop a bit more and get the script send a notification email when a content is modified, as it is written in the forum post that I mentionned. But as I can't get it working, I simplified to get the single Alias value. Whatever I try (including copy/paste of the examples found in the forum and wiki pages) the error is always the same, as stated a bit later. Here is my code :
Code: Select all
global $gCms;
$manager =& $gCms->GetHierarchyManager();
$thisPage = $gCms->variables['content_id'];
$currentNode = &$manager->sureGetNodeById($thisPage);
$currentContent =& $currentNode->getContent();
$mail_content = 'Alias : '.$currentContent->Alias();
It's when the UDT is used by an event, added to the ContentEditPost event, as this page instructs, that ot all goes wrong :
http://wiki.cmsmadesimple.org/index.php/User_Handbook/Admin_Panel/Extensions/Event_Manager
I'm running the actual last version 1.5.3 "Arecibo" on a PHP5/Apache Server and here is the error that I keep getting :
Code: Select all
Call to a member function getContent() on a non-object in [...]\www\lib\classes\class.usertagoperations.inc.php(158) : eval()'d code on line [...]
Thank you by advance.