We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7455
    • 2,204 Posts
    I am working on a plugin that generates a personal page for a new webuser, now I want to send the url for that new page to the new user.

    the page is created but how do i return a value to the websignup snippet? (how do you return from a plugin in general is maybe a better question)
    I tryed the $result array but that did not had it.

    this is my plugin:
    <?php //for nice colors only
    if($mode=="new"){              
    //maak nieuwe pagina aan
    $sql = "INSERT INTO ".$modx->getFullTableName('site_content')." 
    (type,contentType,pagetitle,longtitle,published,parent,isfolder,template,cacheable,createdby,createdon,editedon,publishedon,hidemenu) 
    VALUES ('document','text/html','".$username."',' ".$fullname."','1','9','0','4','0','".$userid."','".time()."','".time()."','".time()."','1')";
    $result = $modx->db->query($sql);
    $eigenpaginaid = $modx->db->getInsertId();
    return $eigenpaginaid;
    }
    


    Plugins are realy nice but still not realy documented yet.

    DImmy
      follow me on twitter: @dimmy01
      • 27376
      • 576 Posts
      Depending on when your plugin is executed in the order of execution, you can use [tt]$modx->setPlaceholder()[/tt].
        • 7455
        • 2,204 Posts
        Thats a great idea indeed I now used a session but that ment that I needed to hack in the snippet to get my placeholder
          follow me on twitter: @dimmy01