We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3689
    • 264 Posts
    Quote from: BobRay at Mar 05, 2010, 10:04 PM

    You had several unclosed braces. One of the problems with Plugins is that if there is any typo or syntax error it just does nothing. You’ve also got a fair amount of unnecessary code since you don’t have to identify the event or do any decision making in the plugin (since the plugin is only triggered by one event). Try this:


    <?php
    
    //Plugin attached to OnManagerWelcomeHome System Event
    
    $e = &$modx->Event;
    $output ='';
    // set generic params
    
     $rowTpl = 'homeCustom';
     $params['level'] = '1';
     $params['ignoreHidden'] = 'TRUE';
     
    // set params for Current Properties and call Wayfinder
                    
            $outerTpl = '@CODE: <h3 class="h3pad">Current Properties</h3><ul class="ulpad">[+wf.wrapper+]</ul>';
            
            $params['startId'] = '4';
            
            $params['rowTpl'] = $rowTpl;
            $params['outerTpl'] = $outerTpl;
            $output = $modx->runSnippet('Wayfinder', $params);
            $output .= '<hr />';
    
    // set params for Pending Properties and call Wayfinder
            
            $outerTpl = '@CODE: <h3 class="h3pad">Pending Properties</h3><ul class="ulpad">[+wf.wrapper+]</ul>';
            
            $params['startId'] = '34';
            
            $params['rowTpl'] = $rowTpl;
            $params['outerTpl'] = $outerTpl;
            $output .= $modx->runSnippet('Wayfinder', $params);
            $output .= '<hr />';
    
    // set params for Sold Properties and call Wayfinder        
            
            $outerTpl = '@CODE: <h3 class="h3pad">Sold Properties</h3><ul class="ulpad">[+wf.wrapper+]</ul>';
            
            $params['startId'] = '27';
            
            $params['rowTpl'] = $rowTpl;
            $params['outerTpl'] = $outerTpl;
            
            $output .= $modx->runSnippet('Wayfinder', $params);
            $output .= '<hr />';
    
            $e->output($output);
            
            return;
    


    Make sure the plugin is tied to the OnManagerWelcomeHomeEvent.



    thanks! it works fine smiley I had to add "//" in front of the <?php in the beginnin for it to work but it works perfectly smiley
      • 3749
      • 24,544 Posts
      I’m glad it worked. smiley

      Plugins don’t need the <?php tag (you can just remove it), but it provides syntax highlighting in Forum postings which makes them easier to read.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting