We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33372
    • 1,611 Posts
    I couldn’t get the PageTrail snippet to work for me as included in the latest distribution. Updating the API calls to more current ones seems to fix it. Here’s what works for me (in case anyone else needs it):

    $sep = isset($sep) ? $sep :" » ";
    $style = isset($style) ? " style=\"$style\" " :"";
    $class = isset($class) ? " class=\"$class\" " :"";
    
    // end config
    
    $docInfo = $modx->getDocument($modx->documentIdentifier);
    
    $ptarr = array();
    $pid = $docInfo['parent'];
    $ptarr[] = "<a $class $style href='[~".$docInfo['id']."~]'>".$docInfo['pagetitle']."</a>";
    
    while ($parent=$modx->getDocument($pid)) {
        $ptarr[] = "<a $class $style href='[~".$parent['id']."~]'>".$parent['pagetitle']."</a>";
        $pid = $parent['parent'];
    }
    
    $ptarr = array_reverse($ptarr);
    return join($ptarr, $sep);
      "Things are not what they appear to be; nor are they otherwise." - Buddha

      "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

      Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
      • 25663 MODX Staff
      • 12,272 Posts
      Why not post that as a new release or an extra in the repository?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 33372
        • 1,611 Posts
        I’m not sure how to do that, but if I do it should include the original credits (since I didn’t really do anything except change a few API calls).

        Does this snippet not functioning anymore indicate that a recent change has broken some of the backwards-compatibility in previous versions?

        Or maybe I’m the only one who had trouble with this...
          "Things are not what they appear to be; nor are they otherwise." - Buddha

          "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

          Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options