[[Wayfinder? &startId=`130`]]
require_once '../config.core.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('web');echo $modx->runSnippet('Wayfinder', array('startId' => 130));Call to a member function get() on a non-object
This question has been answered by BobRay. See the first response.
So I've researched how to load Modx externally, and came up with this:
require_once '../config.core.php'; require_once MODX_CORE_PATH . 'model/modx/modx.class.php'; $modx = new modX(); $modx->initialize('web');
define('MODX_API_MODE', true);
include_once 'index.php'; // your MODX's main index.php
define('MODX_API_MODE', true);
// Full path to the index
require_once('/path/to/modx/public_html/index.php');
$modx = new modX();
$modx->initialize('mgr');
define('MODX_API_MODE', true);
include_once '../index.php';global $modx;
echo $modx->runSnippet('Wayfinder', array('startId' => 130));$modx->initialize('web');