We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19159
    • 13 Posts
    hi there

    i found out, that if i call a snippet with ajax call using the "Lightweight solution" (i just need to grap a few news headlines), friendly urls are broken. the problem seems to be in "manager/includes/document.parser.class.inc.php".

    i have to use this code in my snippet:
    require_once(MODX_MANAGER_PATH . '/includes/protect.inc.php');
        
    // Setup the MODx API
    define('MODX_API_MODE', true);
    // initiate a new document parser
    include_once(MODX_MANAGER_PATH.'/includes/document.parser.class.inc.php');
    $modx = new DocumentParser;


    and as far as i could see it does not output properly the following config variable:
    $this->config['friendly_urls']


    it should be 1 (for friendly url), but it’s not set therefore it switches to:
    $url= 'index.php?id=' . $id . $args;



    this only happens if i initiate a new document parser class. if someone can point me to right solution.
    do i need to use the full "The Full MODx solution" for ajax call to prevent this?

    Cheers
    M