Have a pre-existing blog done in wordpress, not integrating modx for the main site (but keeping the blog in wordpress).
For the template i’m trying to include 2 chunks frommodx (a masthead with a simple search form [simlpleSearchForm] snippet call and the sites main navigation [wayfinder] ) the modx navigation within wordpress.
Now with the following code i can get a shunk with a snippet within it, but it hasn’t processed the snippet just displays the raw text snippet call to the search form.
[[!SimpleSearchForm? &tpl=myISearchForm` &method=`POST` &landing=`106`]]
The same happens when i call the navigation chunk with the wayfinder snippet call within
//MODx API
define('MODX_CORE_PATH', '../core/');
define('MODX_CONFIG_KEY', 'config');
define('MODX_API_MODE', true);
define(’MODX_SITE_URL’, (!isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off' ? 'http://' : 'https://').$_SERVER['SERVER_NAME'].MODX_SITE_BASE_URL);
require_once '../config.core.php';
require_once MODX_CORE_PATH.'config/'.MODX_CONFIG_KEY.'.inc.php';
require_once MODX_CORE_PATH.'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('web');
// Set the base URL for any MODx snippets
$modx->config['base_url'] = MODX_SITE_BASE_URL;
$test = $modx->getObject('modChunk',array('name' => 'header_masthead' ));
if ($test) {
$content = $test->getContent();
}
var_dump($content);
is it possible to call a chunk externally and have it display as it would within modx? or am i tring to do some thing that isn’t possible